采购发票下推付款单携带金额不正确?
[概述]
采购发票付款关联金额错误,执行语句处理,参考语句:
----修复发票付款关联金额
--备份有问题发票分录体记录
select c.* into icpurchaseentry_bak20181027
from icpurchaseentry c left join
(select a.fbillno_src,a.fid_src,a.fentryid_src,sum(freceiveamount)+sum(fdiscount) as famount_commit ,sum(freceiveamountfor)+sum(fdiscountfor) as famountfor_commit ,
sum(FQuantity)as FQuantityReceive_Commit
from t_rp_arbillofsh a
where a.fclassid_src in (1000003,1000004)
group by a.fbillno_src,a.fid_src,a.fentryid_src) b
on c.fdetailid=b.fentryid_src and c.finterid=b.fid_src
where (c.famount_commit<> isnull( b.famount_commit,0)
or c.famountfor_commit<> isnull(b.famountfor_commit,0))
--更改发票付款关联金额
update c set c.famount_commit=isnull( b.famount_commit,0), c.famountfor_commit= isnull(b.famountfor_commit,0)
--select c.famount_commit, b.famount_commit, c.famountfor_commit, b.famountfor_commit,*
from icpurchaseentry c left join
(select a.fbillno_src,a.fid_src,a.fentryid_src,sum(freceiveamount)+sum(fdiscount) as famount_commit ,sum(freceiveamountfor)+sum(fdiscountfor) as famountfor_commit ,
sum(FQuantity)as FQuantityReceive_Commit
from t_rp_arbillofsh a
where a.fclassid_src in (1000003,1000004)
group by a.fbillno_src,a.fid_src,a.fentryid_src) b
on c.fdetailid=b.fentryid_src and c.finterid=b.fid_src
where (c.famount_commit<> isnull( b.famount_commit,0)
or c.famountfor_commit<> isnull(b.famountfor_commit,0))
and b.famount_commit is null
采购发票下推付款单携带金额不正确?
本文2024-09-22 13:53:05发表“k3wise知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3wise-71478.html