算成本提示某货品成本溢出处理方法,该问题是由于货品成本异常,成本上亿或者负亿造成的;
1.首先通过语句:select * into tmp_goods from l_goods where ABS(aprice)>=100000,把成本价格超过10万的货品资料取出;
2.更新货品资料的成本价格:
update g set aprice =0
from l_goods g where exists(select * from tmp_goods tg where tg.goodsid=g.goodsid);
3.更新底稿表的成本价格:
update g set price =0, amount=0, eprice=0, eamount=0, difamount=0
from aa_billflow g where exists(select * from tmp_goods tg where tg.goodsid=g.goodsid)
4.更新底稿表的重算状态
update aa_billflow set status=0;
5.然后重算成本,对负库存出库、有异常的成本做调价处理;