用友T6出库跟踪入库型存货处理通用脚本
2019-4-23 8:0:0 wondial用友t6出库跟踪入库型存货处理通用脚本
用友t6出库跟踪入库型存货处理通用脚本存货2102080在仓库01有现存量,录出库单时也可选择批次,但在出库单表体对应入库单号的参照界面中却没有记录。2102080存货的不能参照入库单的原因是:存货对应入库单的累计出库数量错误以及出入库跟踪表记录错误。以下是通用的脚本,可直接修改出库跟踪入库型存货的入库单子表累计出库数量与对应出入库跟踪表出空标识,脚本如下:–查询出库跟踪入库型存货的入库单“累计出库数量”不等于对应出库单“实际出库数量”(不包含辅助计量单位、存货自由项)
select rds.autoid,rd.cwhcode,rds.cinvcode,(case when bRdFlag=1 then rds.iQuantity else -rds.iQuantity end) as iinQuantity,rds.isoutquantity,a.ifoutquantity
from rdrecord rd inner join RdRecords rds on rd.ID=rds.id right join (select cvouchcode,cwhcode,cinvcode,sum(iquantity) as ifoutquantity from rdrecord rd left join RdRecords rds on rd.ID=rds.id where cwhcode=’01′ and cinvcode=’2102080′ and brdflag=0 and cvouchcode is not null group by cvouchcode,cwhcode,cinvcode) a on a.cvouchcode=rds.autoid and a.cwhcode=rd.cwhcode and a.cInvCode=rds.cInvCode
where (brdflag=1 or(brdflag=0 and rds.cVouchCode is null)) and rds.isoutquantity<>a.ifoutquantity and (case when bRdFlag=1 then rds.iQuantity else -rds.iQuantity end)>a.ifoutquantity –最后rds.isoutquantity>a.ifoutquantity考虑到有可能实际出库数量大于入库单据累计入库数量
–查询出入库跟踪表“是否出空”记录(不包含辅助计量单位、存货自由项)
select MainBatch.rdid,MainBatch.cwhcode,MainBatch.cinvcode,MainBatch.bisnull,a.iinQuantity,a.isoutquantity
from MainBatch right join (select rds.autoid,rd.cwhcode,rds.cinvcode,(case when bRdFlag=1 then rds.iQuantity else -rds.iQuantity end) as iinQuantity,rds.isoutquantity from rdrecord rd left join RdRecords rds on rd.ID=rds.id where (brdflag=1 or(brdflag=0 and cVouchCode is null))) a on a.AutoID=MainBatch.RdID and a.cWhCode=MainBatch.cWhCode and a.cInvCode=MainBatch.cInvCode
where MainBatch.cwhcode=’01′ and MainBatch.cInvCode =’2102080′ and a.iinQuantity<>a.iSOutQuantity and MainBatch.bisnull<>0
如确定上述问题,修改脚本如下:
–修改出库跟踪入库型存货的入库单“累计出库数量”不等于对应出库单“实际出库数量”(不包含辅助计量单位、存货自由项)
update RdRecords set iSOutQuantity=a.ifoutquantity
from rdrecord rd inner join RdRecords rds on rd.ID=rds.id right join (select cvouchcode,cwhcode,cinvcode,sum(iquantity) as ifoutquantity from rdrecord rd left join RdRecords rds on rd.ID=rds.id where cwhcode=’01′ and cinvcode=’2102080′ and brdflag=0 and cvouchcode is not null group by cvouchcode,cwhcode,cinvcode) a on a.cvouchcode=rds.autoid and a.cwhcode=rd.cwhcode and a.cInvCode=rds.cInvCode
where (brdflag=1 or(brdflag=0 and rds.cVouchCode is null)) and rds.isoutquantity<>a.ifoutquantity and (case when bRdFlag=1 then rds.iQuantity else -rds.iQuantity end)>a.ifoutquantity –最后rds.isoutquantity>a.ifoutquantity考虑到有可能实际出库数量大于入库单据累计入库数量
–修改出入库跟踪表“是否出空”记录(不包含辅助计量单位、存货自由项)
update MainBatch set bIsNull=0
from MainBatch right join (select rds.autoid,rd.cwhcode,rds.cinvcode,(case when bRdFlag=1 then rds.iQuantity else -rds.iQuantity end) as iinQuantity,rds.isoutquantity from rdrecord rd left join RdRecords rds on rd.ID=rds.id where (brdflag=1 or(brdflag=0 and cVouchCode is null))) a on a.AutoID=MainBatch.RdID and a.cWhCode=MainBatch.cWhCode and a.cInvCode=MainBatch.cInvCode
where MainBatch.cwhcode=’01′ and MainBatch.cInvCode =’2102080′ and a.iinQuantity<>a.iSOutQuantity and MainBatch.bisnull<>0
如有用友t6其它问题,请在下面回复疑问,我们将第一时间与您联系,帮助您解决问题。同时您也可以联系用友畅捷通专业服务商-用友天龙瑞德。用友天龙瑞德专业销售用友软件,用友财务软件,寻找用友t6服务商,咨询用友t6价格,用友t6多少钱,用友t6报价,联系电话:010-59798025。网址:http://www.kuaiji66.com
如果您的问题还没有解决,可以到 T+搜索>>上找一下答案
相关阅读
- 用友T3用友通系统重装后,没有账套备份,如何恢复账套2019-4-29 8:0:0
- 明细账权限设置时提示“没有操作员”?2019-4-29 8:0:0
- 用友T3-用友通如何进行凭证的赤字控制2019-4-23 8:0:0
- 用友T3-用友通如何调整工资发放签名表工资项目显示顺序2019-4-23 8:0:0
- 用友T3-用友通如何设置财务报表中的年月日2019-4-23 8:0:0
- 用友T3-用友通如何设置未记账凭证的报表公式_02019-4-23 8:0:0
- 用友T3-用友通如何设置未记账凭证的报表公式2019-4-23 8:0:0
- 用友T3-用友通如何设置对客户的信用进行控制2019-4-23 8:0:0
- 用友T3-用友通如何补录现金流量?2019-4-23 8:0:0
- 用友T3-用友通如何核销银行账2019-4-23 8:0:0