2017年年初数
2016年年末数
第一步:将存货核算反年结(存货核算反年结总账必须将上年度12月份总账反结账后,在将存货核算上年度12月份反结账)
第二步:执行下列语句(如果有才刚刚模块)
update IA_valuationass set cflag=\'暂估记账\'
from IA_valuationass left join (select * from ia_subsidiary where (isnull(iainquantity,0)-isnull(iaoutquantity,0))>0 ) IA_SubTab on IA_SubTab.id=IA_valuationass.inid left join warehouse on IA_SubTab.cwhcode=warehouse.cwhcode
where IA_valuationass.dikeepdate=IA_SubTab.dkeepdate and (Warehouse.cWhvaluestyle=\'先进先出法\' or Warehouse.cWhvaluestyle=\'后进先出法\')
And (IA_SubTab.iMonth>0 or (IA_SubTab.iMonth=0 and IA_SubTab.cVouType=\'34\'))
and IA_SubTab.bflag=1 and cflag is null
第三步:执行重写计价辅助表工具
第四步:执行存货总账重算工具
先修复,后重算
第五步:重新对存货核算结账,再重新年结