新闻资讯  > 知识学习

公司资讯 行业资讯 知识学习
2024优惠活动:迷你版1880元,KIS软件5折,金蝶云6折起!

金蝶商贸版报错:t_CC_Stock_BatchNo 同批号辅助属性保质期生产日期或有效期不同

发布时间:2022-9-21浏览:1111次

商贸版报错内容里含t_CC_Stock_BatchNo 字符 以及出入库的时候提示“同批号辅助属性保质期生产日期或有效期不同” 完整标题是这个,论坛标题限制在20个字


下面脚本检测是否使用保质期管理以及单据里的保质期信息与物料的该属性是否相符。下面的查询有行即为异常。


select FISKFPeriod, *from T_CC_StockBillEntry  e inner join  t_icItem  t on t.FItemID =e.FItemID  where FISKFPeriod=0/*未启用保质期管理*/

and (FKFDate is not null  or e.FKFPeriod <>0 or FPeriodDate is not null /*出入库单据信息里有保质期信息,这是单据有异常*/)


select *from T_CC_StockBillEntry  e inner join  t_icItem  t on t.FItemID =e.FItemID  where FISKFPeriod=1/*启用保质期管理*/

and (FKFDate is  null  or e.FKFPeriod =0 or FPeriodDate is  null /*出入库单据信息里无保质期信息,这是单据有异常  这里条件使用OR可能存在异常,需要用数据检测修复。这种错误无法直接给修复脚本除非商量给保质期等信息一个确定的值*/)


select FISKFPeriod, *from t_cc_stock_BatchNo  e inner join  t_icItem  t on t.FItemID =e.FItemID  where FISKFPeriod=0/*未启用保质期管理*/

and (FKFDate <>'1900-01-01 00:00:00.000'  or e.FKFPeriod <>0 or FPeriodDate <>'1900-01-01 00:00:00.000' /*出入库单据信息里有保质期信息,这是单据有异常*/)


select *from t_cc_stock_BatchNo  e inner join  t_icItem  t on t.FItemID =e.FItemID  where FISKFPeriod=1/*启用保质期管理*/

and (FKFDate ='1900-01-01 00:00:00.000'   or e.FKFPeriod =0 or FPeriodDate ='1900-01-01 00:00:00.000'  /*出入库单据信息里无保质期信息,这是单据有异常  这里条件使用OR可能存在异常,需要用数据检测修复。这种错误无法直接给修复脚本除非商量给保质期等信息一个确定的值*/)


下面是修复脚本

update e set FKFDate='1900-01-01 00:00:00.000' , FKFPeriod=0,FPeriodDate='1900-01-01 00:00:00.000'  from t_cc_stock_BatchNo  e inner join  t_icItem  t on t.FItemID =e.FItemID  where FISKFPeriod=0/*未启用按保质期管理*/

and (FKFDate <>'1900-01-01 00:00:00.000'  or e.FKFPeriod <>0 or FPeriodDate <>'1900-01-01 00:00:00.000' )


update e set FKFDate=NULl , FKFPeriod=0,FPeriodDate=NUll  from T_CC_StockBillEntry  e inner join  t_icItem  t on t.FItemID =e.FItemID  where FISKFPeriod=0/*未启用按保质期管理*/

and (FKFDate is not null  or e.FKFPeriod <>0 or FPeriodDate is not null )

exec sp_UpdateInventory


X青岛金蝶软件公司_金蝶软件技术服务公司

截屏,微信识别二维码

客服QQ:1250556403

(点击QQ号复制,添加好友)

微信号已复制,请打开微信添加咨询详情!