关于tiptop gp5.2采购模块,价格变更的随笔

采购价格变更要看具体环节,你可以把他当作是三张表,采购价格表、收货价格表、入库价格表,这些还好处理,如果已抛砖到财务端生成账款再要求改价格就更复杂,会产生更多张表了,改起来也就更复杂。

用apmt910改的价格是采购价格表,cpmq912查的是入库价格表的对账明细,所以当已入库的时候再改价格,就需要变更入库价格表信息,在apmt720里进行操作变更。这里就有一个问题,收货价格表怎么办?

是的,没有改,设计软件的时候忽略这个问题了,因为抛砖账款是通过入库价格表取值过去的,所以入库价格变了,抛砖的价格就是改后的价格。因为后面不受影响所以就忽略改收货价格表了。

当然这里指的表只是模糊的概念,具体通过已有程序无法完成操作,还可以通过sql变更。此时要考虑单身和单头都需要变更,以下是我写的sql,要看具体情况,供大家参考。

---批量改采购价格lms211015,具体要看采购单已流转到哪个环节进行改表
----1.更改前备份
select pmn01,pmn31,pmn31t,pmn44,pmn88,pmn88T,PMN90,PMN50,PMN20*PMN31,PMN20*PMN31T from pmn_file where pmn01='031-KT21060051';
select pmm40,pmm40t from pmm_file where pmm01='031-KT21060051';

---2.执行更新单身
update pmn_file b
set b.pmn31=(select pmn31 from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.pmn04),
b.pmn31T=(select pmn31T from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.pmn04),
b.pmn44=(select pmn44 from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.pmn04),
b.pmn88=(select pmn31T from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.pmn04),
b.pmn88T=(select pmn88T from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.pmn04),
b.pmn90=(select pmn90 from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.pmn04)
where b.pmn01='031-KT21060051' and b.pmn04 in (select pmn04 from pmn_file);
----3.执行更新单头
update pmm_file a
set pmm40=(select pmm40 from pmm_file b where b.pmm01='031-KT21100263'),
pmm40t=(select pmm40t from pmm_file b where b.pmm01='031-KT21100263')
where pmm01='031-KT21060051';
---4.更改前备份
select rvv38,rvv38t,rvv39,rvv39t,rvv38*rvv17,rvv38T*rvv17 from rvv_file where rvv36='031-KT21060051';
select rvb05,rvb07,rvb10,rvb10t,rvb88,rvb88t,rvb07*rvb10,rvb07*rvb10t from rvb_file where rvb04='031-KT21060051'

---5.执行更新收货单身
update rvb_file b
set rvb10=(select pmn31 from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.rvb05),
rvb10T=(select pmn31T from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.rvb05),
rvb88=rvb07*(select pmn31 from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.rvb05),
rvb88T=rvb07*(select pmn31T from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.rvb05)
where rvb04='031-KT21060051' and rvb05='1050110139'
---6.执行更新入库异动资料单身
update rvv_file b
set rvv38=(select pmn31 from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.rvv31),
rvv38t=(select pmn31T from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.rvv31),
rvv39=rvv17*(select pmn31 from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.rvv31),
rvv39t=rvv17*(select pmn31T from pmn_file a where a.pmn01='031-KT21100263' and a.pmn04=b.rvv31)
where rvv36='031-KT21060051' and rvv31='1050110139'

原文地址:https://www.cnblogs.com/mylive/p/15492371.html