解决方案: |
经检查发现在库存系统与存货对帐对不上的原因是由于在参照委托代销发货单生成的委托代销退货单时用户手工修改过退货仓库,造成库存与存货对帐不正常,但总数量正确。已建议用户在做委托代销退货单时不要更改仓库。存货系统与总帐对帐124301科目对不上的原因有如下几方面:1.生成了凭证但存货帐上却没有存货科目,用语句更新即可。2.在总帐中使用存货科目生成了凭证。3.生成凭证时修改过科目或金额。以下附查找及更新语句:--筛选出生成了凭证但存货帐上却没有存货科目的语句:select coutno_id,summcas a into ee from gl_accvouch where ccode='124301' and mc<>0 group by coutno_id select coutno_id,isnullsummc,0 as dd into ff from gl_accvouch where coutno_id inselect cpzid from ia_subsidiary where imonth='1' and cinvhead='124301' group by cpzid and ccode='124301' and mc<>0 group by coutno_id select * from ee left join ff on ee.coutno_id=ff.coutno_id
--以下为更新语句:update ia_subsidiary set cinvhead='124301' where cpzid='IA0000000001461' and cinvhead is null update ia_subsidiary
set cinvhead='124301' where cpzid='IA0000000002112'
--筛选在总帐中使用存货科目生成的凭证 select ino_id from gl_accvouch where coutno_id='GL0000000000062'--387号凭证 --筛选生成凭证时修改过科目或金额的语句:select cpzid,isnullsumiainprice,0as aa,isnullsumiaoutprice,0as bb into aa from ia_subsidiary where imonth='1' and cinvhead='124301' group by cpzid
select coutno_id,isnullsummd,0 as cc,isnullsummc,0 as dd into cc from gl_accvouch where coutno_id inselect cpzid from ia_subsidiary where imonth='1' and cinvhead='124301' group by cpzid and ccode='124301' group by coutno_id
select * from aa join cc on aa.cpzid=cc.coutno_id where aa<>cc or bb<>dd
--有如下8张凭证存在生成时修改过科目及金额 253,280,282,316,317,344,422,491 |