变更付款单的往来户名称之后,历史收付款单的往来户名称数据怎么更新?
前台不可以进行更新,需要后台操作,原则上历史单据相当于已经归档,不允许再进行变更,否则会造成历史已打印的单据和更新后的系统单据不一致。
后台更新脚本如下:
1、更新付款单供应商名称
查询&备份语句
SELECT a.*
--into bak_paymentbill0514
FROM T_cas_paymentbill a
inner join T_BD_Supplier b ON A.FPAYEEID = B.FID
where a.FPAYEENAME_L2<>b.fname_l2 and a.FPAYEEID is not null
更新语句
UPDATE T_cas_paymentbill a SET FPAYEENAME_L2 =(select fname_l2 from T_BD_Supplier where fid=a.fpayeeid ) WHERE fid in (select fid from bak_paymentbill0514)
2、更新付款单客户名称
查询&备份语句
SELECT a.*
--into bak_paymentbill0514
FROM T_cas_paymentbill a
inner join T_BD_customer b ON A.FPAYEEID = B.FID
where a.FPAYEENAME_L2<>b.fname_l2 and a.FPAYEEID is not null
更新语句
UPDATE T_cas_paymentbill a SET FPAYEENAME_L2 =(select fname_l2 from T_BD_customer where fid=a.fpayeeid ) WHERE fid in (select fid from bak_paymentbill0514)
3、更新收款单供应商名称
查询&备份语句
SELECT a.*
--into bak_paymentbill0514
FROM T_cas_receivingbill a
inner join T_BD_Supplier b ON A.FPAYERID = B.FID
where a.FPAYERNAME_L2<>b.fname_l2 and A.FPAYERID is not null
更新语句
UPDATE T_cas_receivingbill a SET FPAYERNAME_L2 =(select fname_l2 from T_BD_Supplier where fid=a.fpayerid ) WHERE fid in (select fid from bak_paymentbill0514)
4、更新收款单客户名称
查询&备份语句
SELECT a.*
--into bak_paymentbill0514
FROM T_cas_receivingbill a
inner join T_BD_customer b ON A.FPAYERID = B.FID
where a.FPAYERNAME_L2<>b.fname_l2 and A.FPAYERID is not null
更新语句
UPDATE T_cas_receivingbill a SET FPAYERNAME_L2 =(select fname_l2 from T_BD_customer where fid=a.fpayerid ) WHERE fid in (select fid from bak_paymentbill0514)
变更付款单的往来户名称之后,历史收付款单的往来户名称数据怎么更新?
本文2024-09-16 22:00:21发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-45330.html