做了計劃價調(diào)整,導(dǎo)致明細(xì)帳不正確
發(fā)布于:2018-02-12 17:46:11
問題現(xiàn)象:對某存貨進(jìn)行了計劃價調(diào)整后,該存貨在明細(xì)帳中,期初的單價也變成了調(diào)整后的單價了,并且結(jié)存的金額不等于數(shù)量*單價
解決方案:(1)請下載最新850存貨核算補(bǔ)丁USEntQC.dll解決調(diào)整計劃單價同時調(diào)整期初計劃價的問題。(補(bǔ)丁時間:10月19日) (2)同時,請通過腳本將期初計劃價調(diào)整回原始的計劃價,同時會解決明細(xì)帳中結(jié)存單價*結(jié)存數(shù)量<>金額的問題。 相關(guān)腳本如下: (1)--查詢有類似問題的數(shù)據(jù) select a.*,s.inum,s.imoney,costjustvouchs.icjvbcost,costjustvouchs.icjvacost from (select cwhcode,cinvcode,sum(iainquantity) sq ,sum(iainprice) sp from ia_subsidiary where imonth=0 and cvoutype='34' group by cwhcode,cinvcode having cwhcode in (select cwhcode from warehouse where cwhvaluestyle='計劃價法') ) a left join ia_summary s on a.cwhcode=s.cwhcode and a.cinvcode=s.cinvcode and s.imonth=0 left join costjustvouchs on s.cinvcode=costjustvouchs.cinvcode where round(a.sq,8)<>round(s.inum,8) or round(a.sp,2)<>round(s.imoney,2) (2)--建立存儲過程 --@WhCode:倉庫編碼 @InvCode:存貨編碼 @PlanedPrice:要調(diào)整的單價 create proc JustIAQCPPrice @WhCode varchar(20), @InvCode varchar(20), @PlanedPrice decimal(20,8) as update ia_subsidiary set iincost=@PlanedPrice,iainprice=@PlanedPrice*iainquantity where cwhcode=@whcode and cinvcode=@invcode and imonth=0 and cvoutype='34' and not iainquantity is null and iincost<>@PlanedPrice (3)執(zhí)行存儲過程: --輸入要調(diào)整的倉庫,存貨,要調(diào)整的單價 exec JustIAQCPPrice @WhCode='01',@InvCode='0104017',@PlanedPrice='4.45' 請參考上述方法進(jìn)行測試解決,修改前請一定做好數(shù)據(jù)備份。