- 问题描述:调整其他入库单据和其他出库单据时,单据中的保质期信息置灰的无法输入,也无法在失效日期中进行维护;
- 问题分析:客户存货之前没有启用保质期管理,后来通过数据库语句启用了保质期管理,导致历史单据保质期信息缺失;
- 解决方法:通过存货信息,查询对应的出入库流水账,找到对应的出入库单据,更新对应出入库单据的数据表,并更新存货货位记录表、存货货位存量表、现存量汇总表、库存月度账表;
- 操作样例:如下方代码块;
--rdrecords08 其他入库单子表
--cInvCode 存货编码
--dMadeDate 生产日期
--iExpiratDateCalcu 有效期推算方式
--cMassUnit 保质期单位
--cExpirationdate 有效期至
--iMassDate 保质期天数
--dVDate 失效日期
select * from rdrecords08 where cBatch = '3412762076'
update rdrecords08 set dMadeDate = '2021-07-19',iExpiratDateCalcu = '2',cMassUnit = '3',cExpirationdate = '2022-07-19',iMassDate = '365' , dVDate = '2022-07-19'where cBatch = '3412762076' and cInvCode = 'B13174797'
--rdrecords09 其他出库单子表
--cInvCode 存货编码
--dMadeDate 生产日期
--iExpiratDateCalcu 有效期推算方式
--cMassUnit 保质期单位
--cExpirationdate 有效期至
--iMassDate 保质期天数
--dVDate 失效日期
select * from rdrecords09 where cBatch = '3412762076'
update rdrecords09 set dMadeDate = '2021-07-19',iExpiratDateCalcu = '2',cMassUnit = '3',cExpirationdate = '2022-07-19',iMassDate = '365' , dVDate = '2022-07-19'where cBatch = '3412762076' and cInvCode = 'B13174797'
--InvPosition 存货货位记录表
--iExpiratDateCalcu 有效期推算方式
--dExpirationdate 有效期计算项
--cExpirationdate 有效期至
--dVDate 失效日期
--dMadeDate 生产日期
--iMassDate 保质期天数
--cMassUnit 保质期单位
select * from InvPosition where cBatch = '3412762076' and cInvCode = 'B13174797'
update InvPosition set iExpiratDateCalcu = '2',dExpirationdate = '2021-07-19',cExpirationdate = '2022-07-19',dVDate = '2022-07-19',dMadeDate = '2021-07-19',iMassDate = '365', cMassUnit = '3' where cBatch = '3412762076' and cInvCode = 'B13174797'
--InvPositionSum 存货货位存量表
--iExpiratDateCalcu 有效期推算方式
--dExpirationdate 有效期计算项
--cExpirationdate 有效期至
--dVDate 失效日期
--dMadeDate 生产日期
--iMassDate 保质期天数
--cMassUnit 保质期单位
update InvPositionSum set iExpiratDateCalcu = '2',dExpirationdate = '2021-07-19',cExpirationdate = '2022-07-19',dVDate = '2022-07-19',dMadeDate = '2021-07-19',iMassDate = '365', cMassUnit = '3' where cBatch = '3412762076' and cInvCode = 'B13174797'
--CurrentStock 现存量汇总表
--iExpiratDateCalcu 有效期推算方式
--dExpirationdate 有效期计算项
--cExpirationdate 有效期至
--dVDate 失效日期
--dMdate 生产日期
--iMassDate 保质期天数
--cMassUnit 保质期单位
select * from CurrentStock where cBatch = '3412762076' and cInvCode = 'B13174797'
update CurrentStock set iExpiratDateCalcu = '2',dExpirationdate = '2021-07-19',cExpirationdate = '2022-07-19',dVDate = '2022-07-19',dMdate = '2021-07-19',iMassDate = '365', cMassUnit = '3' where cBatch = '3412762076' and cInvCode = 'B13174797'
/*
库存月度帐表查询无数据
--ST_MonthAccount 库存月度帐表
--iExpiratDateCalcu 有效期推算方式
--dExpirationdate 有效期计算项
--cExpirationdate 有效期至
--dVDate 失效日期
--dMdate 生产日期
--iMassDate 保质期天数
--cMassUnit 保质期单位
select * from ST_MonthAccount where cBatch = '3412762076' and cInvCode = 'B13174797'
update ST_MonthAccount set iExpiratDateCalcu = '2',dExpirationdate = '2021-07-19',cExpirationdate = '2022-07-19',dVDate = '2022-07-19',dMdate = '2021-07-19',iMassDate = '365', cMassUnit = '3' where cBatch = '3412762076' and cInvCode = 'B13174797'
*/