问题现象: | 2012年转后库存产成品仓库与存货对账有3条记录不平,存货帐是正确,库存材料有出入库跟踪,修改不了数据。(做出库单据调账可以选到跟踪的数量但是保存不上提示余额为零) 3-TP9145J TP9145J整 4365.00 606.00 -3759.00 3-TP9147 TP9147整 1728.00 0.00 -1728.00 3-TP9243 TP9243整 2739.00 2061.00 -678.00 请帮助做个脚本把数量改成存货的数量。最好能做个脚本把所有材料及产成品的出入库跟踪都取消。 数据路径:ftp://125.35.5.138/u8jilin/一汽徐港2012年度帐.rar |
问题原因: | |
解决方案: | 您好, 此问题【经查看数据/测试】现做如下分析与答复: 【问题原因】 库存期初记录本身并没有错误,由于没有2011数据,无法判断是否上年数据不正确,所以导致库存期初是正常,但总数量不正确。请您检查2012年库存期初与2011年的库存结存是否一致,如一致就没有错误。 出库跟踪入库不能取消,如不想用,则请将这些存货盘点都出库后,在存货上录入停用日期,将存货停用,然后录入新的存货。 【解决方案】 如不一致,则请在查询分析器中执行下面语句,进行修改期初: insert into rdrecord (ID,bRdFlag,cVouchType,cBusType,cSource,cBusCode,cWhCode,dDate,cCode,cHandler,cMemo,bTransFlag,cAccounter,cMaker,iNetLock,dVeriDate,bpufirst,biafirst,vt_id,bIsSTQc,bOMFirst,bFromPreYear,dnmaketime,dnverifytime,bredvouch) values(1,0,'09','其他出库','库存',null,'03','2011-12-31',-1,'demo','调整',0,'asuser','demo',0,'2012-01-01',0,0,'85',1,0,1,'2012-01-01','2012-01-01',0) insert into rdrecords (AutoID,ID,cInvCode,iNum,iQuantity,cBatch,cVouchCode,iNQuantity,cInVouchCode) select '100000000'+a.AutoID,1,a.cInvCode,iNum,iQuantity,a.cbatch,c.autoid,iNQuantity,c.ccode from rdrecords a inner join rdrecord b on a.id=b.id inner join (select a.cbatch,a.cinvcode,a.autoid,b.ccode from rdrecords a inner join rdrecord b on a.id=b.id where cwhcode='03' and cinvcode in ('3-TP9145J','3-TP9243' ,'3-TP9147') and bisstqc=1 and ((brdflag=1 and iquantity>0) or (brdflag=0 and iquantity<0)) and cvouchcode is null and iquantity<>isnull(isoutquantity,0)) c on a.cbatch=c.cbatch and a.cinvcode=c.cinvcode where b.cwhcode='03' and a.cinvcode in ('3-TP9145J','3-TP9243' ,'3-TP9147') and a.cvouchcode not in (select autoid from rdrecords) go update a set isoutquantity=isnull(a.isoutquantity,0)+c.iquantity from rdrecords a inner join rdrecord b on a.id=b.id inner join (select a.* from rdrecords a inner join rdrecord b on a.id=b.id where b.cwhcode='03' and a.cinvcode in ('3-TP9145J','3-TP9243' ,'3-TP9147') and a.cvouchcode not in (select autoid from rdrecords a inner join rdrecord b on a.id=b.id where bisstqc=1)) c on a.cinvcode=c.cinvcode and a.cbatch=c.cbatch where cwhcode='03' and a.cinvcode in ('3-TP9145J','3-TP9243' ,'3-TP9147') and bisstqc=1 and ((brdflag=1 and a.iquantity>0) or (brdflag=0 and a.iquantity<0)) and a.cvouchcode is null and a.iquantity<>isnull(a.isoutquantity,0) 【注意事项】修改前请务必做好数据备份;由于网站的关系,上述语句中如有标点符号' % + 则必需在输入法为英文的状态下重新录入后再执行; |
相关补丁: | |
版本: | 8.90 |
模块: | 库存管理 |
产品: | 供应链 |
问题名称: | 库存出入库跟踪年转余额不对 |
最后更新: | 2012-01-14 18:59:21 |