解决方案: |
(1)请下载最新850存货核算补丁USEntQC.dll解决调整计划单价同时调整期初计划价的问题。(补丁时间:10月19日)
(2)同时,请通过脚本将期初计划价调整回原始的计划价,同时会解决明细帐中结存单价*结存数量<>金额的问题。
相关脚本如下:
(1)--查询有类似问题的数据
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:要调整的单价
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)执行存储过程:
--输入要调整的仓库,存货,要调整的单价
exec JustIAQCPPrice @WhCode='01',@InvCode='0104017',@PlanedPrice='4.45'
请参考上述方法进行测试解决,修改前请一定做好数据备份。 |