升級后存貨中暫估余額表不正確
發(fā)布于:2018-02-13 14:32:30
問題現(xiàn)象:升級后存貨中暫估余額表不正確,而且報銷金額與紅字回沖單的金額合計的絕對值不等。
解決方案:可以使用下面的腳本在查詢分析器中針對錯誤帳套進行更改: update a set iaprice=ipprice,facost=ipunitcost from rdrecords a inner join ia_subsidiary b on a.autoid=b.id where b.cvoutype in ('01','33') and bflag<>2 and cwhcode<>'01' and isnull(idebitdifcost,0)=0 and isnull(icreditdifcost,0)=0 and isnull(a.iaprice,0)<>isnull(iainprice,0) update a set iaprice=iprice,facost=iunitcost --select iprice,iaprice,ipprice,isnull(b.iainprice,0),isnull(idebitdifcost,0),isnull(icreditdifcost,0),* from rdrecords a inner join ia_subsidiary b on a.autoid=b.id where b.cvoutype in ('01','33') and bflag<>2 and cwhcode<>'01' and (isnull(idebitdifcost,0)<>0 or isnull(icreditdifcost,0)<>0) and isnull(a.iaprice,0)<>(isnull(b.iainprice,0)+isnull(idebitdifcost,0)-isnull(icreditdifcost,0)) update rdrecords set imoney=CONVERT(DECIMAL(20,2),iaprice) where convert(decimal(20,4),iquantity)=convert(decimal(20,4),isquantity) and isnull(imoney,0)<>iaprice update rdrecords set imoney=convert(decimal(20,2),isquantity*facost) where autoid in(select autoid from rdrecords where iquantity <> isnull(isquantity,0) and isnull(isquantity,0)<>0) update pursettlevouchs set isvacost=rdrecords.facost from pursettlevouchs left join rdrecords on rdrecords.autoid=pursettlevouchs.irdsid where isnull(pursettlevouchs.isvquantity,0)<>0 update pursettlevouchs set isvaprice=convert(decimal(20,2),isnull(isvquantity,0)*isnull(isvacost,0))