倉(cāng)庫(kù)不計(jì)入成本屬性更改
當(dāng)倉(cāng)庫(kù)屬性為不計(jì)入成本,而后續(xù)出入庫(kù)單單據(jù)又做了很多,造成存貨核算無(wú)法核算成本
后臺(tái)更改腳本如下
update Warehouse set bInCost = '1' where cWhCode in ('217','218','219') 更改倉(cāng)庫(kù)屬性為記入成本
update rdrecords01 set bCosting = '1'
where ID in (select id from RdRecord01 where cWhCode in ('217','218','219')) 更改采購(gòu)入庫(kù)單表體屬性為記入成本
將采購(gòu)入庫(kù)單插入存貨核算未記賬表中
insert into IA_ST_UnAccountVouch01
select rdrecord01.ID, rdrecords01.AutoID ,cVouchType, cBusType From rdrecord01 join rdrecords01
on rdrecord01.ID= rdrecords01.id where cbaccounter is null
and cwhcode in (select cwhcode from warehouse where bincost =1) And (( cWhCode IN (Select cWhCode From Warehouse Where bInCost = 1)) or cWhCode is null)
and rdrecords01 .AutoID not in( select idsun From IA_ST_UnAccountVouch01)