解决方案: |
您好!请与该用户协商处理前,请先在库存系统中做现存量整理后,以下为问题原因及处理方法:问题一: /*检查发现类似CH02011与CE80000的存货的存货货位结存表与现存量对不上的原因是由于存货明细帐期初数据与货位期初数据不一致造成的。以下语句是检查存货明细帐期初与货位期初不一致的数据,请在货位期初或明细期初中进行相应录入或调整:*/ select (case when a.cwhcode is not null then a.cwhcode else b.cwhcode end) as 仓库, (case when a.cinvcode is not null then a.cinvcode else b.cinvcode end) as 存货, isnull(a.qc,0) 存货明细帐期初,isnull(b.hqc,0) 货位期初 from (select ia_subsidiary.cwhcode,ia_subsidiary.cinvcode,sum(isnull(iainquantity,0))as qc from ia_subsidiary join warehouse on warehouse.cwhcode=ia_subsidiary.cwhcode where bwhpos=1 and cvoutype='34' group by ia_subsidiary.cwhcode,cinvcode having sum(iainquantity)<>0) a full outer join ( select cwhcode,cinvcode,sum(isnull(iquantity,0)) as hqc from invposition WHERE ISNULL(RdsID,0)=0 AND ISNULL(cSource,'')='' group by cwhcode,cinvcode) b on a.cwhcode=b.cwhcode and a.cinvcode=b.cinvcode where abs(isnull(a.qc,0)-isnull(b.hqc,0))>0.01 or (a.cwhcode is null) or (b.cwhcode is null) /*检查发现类似BK11001B存货的存货货位结存表与现存量对不上的原因是由于相关出库单据(材料出库单)上货位没有填写,因为系统在审核时才检查货位,填写货位时系统自动回写invposition因此建议用户先将空缺的货位在单据界面补添完整。若存货的货位相对固定,可在存货档案中录入相应的货位,再录入单据时货位可自动带出(可修改)。以下语句是检查尚未录入货位的单据*/ select cbustype+'单' 单据类型,ccode 单据号,rdrecord.cwhcode 仓库, cinvcode 存货编码,cposition 货位 from rdrecord join warehouse on rdrecord.cwhcode=warehouse.cwhcode join rdrecords on rdrecord.id=rdrecords.id where cposition is null and bwhpos=1 and cvouchtype<>'34' order by 单据类型 /*以下语句请先征求用户意见后再进行调整,若不调整也不会影响数据,检查出CH02011存货货位31540入库20个,但实际出了21个,与实际不符,请征求用户意见后予以调整,现我处将该货位多出的1个调整到了09230货位上。 update invposition set cposcode='09230' where rdsid='10839' update rdrecords set cposition='09230' where autoid='10839'*/ ZZZ7001经过检查核对存货货位结存表与现存量一致。 问题2:存货编码为AG2530264032G经过检查发现它既有货位管理同时又带批次核算,发现她有三个不同的批次对应三个不同的货位,分别是cbatch='GSH5253041'对应03056货位,cbatch='GSH5455041'对应03057货位,cbatch='GSH55556041'对应03060货位均有结存数量,只要找到该批次对应相应的货位即可出库。 |