升级后存货中暂估余额表不正确
发布于:2018-02-13 14:32:30
问题现象:升级后存货中暂估余额表不正确,而且报销金额与红字回冲单的金额合计的绝对值不等。
解决方案:可以使用下面的脚本在查询分析器中针对错误帐套进行更改: 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))