K3 12.1wise 应收款转销后无法做应收冲应付款结算原因分析及解决方法

 

原因为K3结算查询代码多了个

 

select a.FExchangeRateType,b.FID,a.FClassTypeID,a.FCurrencyID,a.FCustomer,a.FDepartment ,a.FEmployee,a.FItemClassID,a.FBillID FInterID,0 FPre,
0 FIsInit,b.FK3Import,b.FStatus,b.FCheckType, 0 FInvoiceID,a.FBillID FRPBillID,0 FBillID,b.FType,
a.FNumber,a.FDate,a.FFIncDate,a.FAdjustExchangeRate FExchangeRate,a.fcontractno,a.FExplanation,cur.FName FCurrencyName,cur.FScale FScaleFor,
(case b.FType when 1 then '其他应收单'when 2 then '其他应付单' end) FBillTypeName,
i.FNumber FCustomerNo,i.FName FCustomerName,ii.FName FDepartmentName,iii.FName FEmployeeName,
s.FName FPrepareName,t.FName FCheckName,
  v.FName+'-'+cast(v.FNumber as Varchar) FVoucherNumber ,''FReceiveTypeName,''FSettleName,''FSettleNo,
'' FOrgNumber,'' FARNumber,''FBankName,'' FBankAccount,
'' FContractNo,''FOrderNo,
0 FReceiveBillID, (case  when abs(c.FRemainAmount)>=abs(c.FAmount_commit-c.FLinkCheckAmount-c.FInvoiceAmount-c.FInvLinkCheckAmount) then (c.FRemainAmount-c.FAmount_commit+c.FLinkCheckAmount+c.FInvoiceAmount+c.FInvLinkCheckAmount) else c.FRemainAmount end)FRemainAmount,
(case  when abs(c.FRemainAmountFor)>=abs(c.FAmountFor_commit-c.FLinkCheckAmountFor-c.FInvoiceAmountFor-c.FInvLinkCheckAmountFor) then (c.FRemainAmountFor-c.FAmountFor_commit+c.FLinkCheckAmountFor+c.FInvoiceAmountFor+c.FInvLinkCheckAmountFor) else c.FRemainAmountFor end)FRemainAmountFor,
a.FCheckStatus,c.FRemainAmount,c.FRemainAmountFor,c.FAmount,c.FAmountFor,
0 FReceiveAmountFor,0 FReceiveAmount,0 FDiscountAmount,0 FDiscountAmountFor,
0 FSettleAmount,0 FSettleAmountFor,0 FSettleDiscount,0 FSettleDiscountfor,
0 FClassTypeID
,c.FClassID_Src
from t_rp_arpbill a
inner join t_rp_arpbillEntry c  on a.FBillID=c.FBillID  join t_rp_contact b on a.FBillID=b.FRPBillID
left join t_currency cur on a.FCurrencyID=cur.FCurrencyID
left join t_item i on a.FCustomer=i.FItemID
left join t_item ii on a.FDepartment=ii.FItemID
left join t_item iii on a.FEmployee=iii.FItemID
left join t_user s on a.FPreParer=s.FUserID
left join t_user t on a.FChecker=t.FUserID
Left join (select v1.FVoucherID,v1.FNumber,v2.Fname FName from t_voucher v1
inner join t_vouchergroup v2 on v1.FGroupid=v2.fgroupid)v on b.FVoucherID=v.FVoucherID
where a.FRP=1
and c.FClassID_Src not in (1000021,1000022)
and b.FType not in(8,9) and a.FCheckStatus<>1
and a.FDate>= '1900-1-1'
and a.FDate<= '9999-12-1'
and a.FItemClassID=3
and  (b.FStatus & 1)=1
and  (b.FStatus & 16)=0
and i.FNumber>='03.0001'
and i.FNumber<='03.0001'
and a.FCurrencyID=1
 


对于应收款转销,应付款转销无法再进行应收冲应付核算,执行以下代码即可。

/**应收应付转销后bug解决代码**/
set nocount on

update c
set c.FClassID_Src=0
FROM t_RP_ARPBill a INNER JOIN
      t_rp_arpbillEntry c ON a.FBillID = c.FBillID
WHERE  a.FBillType in (994,991)  and c.FClassID_Src in(1000021,1000022)

select '数据处理完成' as sqlnote

set nocount off
/**应收应付转销后bug解决代码*/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值