t_CC_Stock_BatchNo 同批号辅助属性保质期生产日期或有效期不同

栏目:kis知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

t_CC_Stock_BatchNo 同批号辅助属性保质期生产日期或有效期不同

商贸版报错内容里含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



好帖!

t_CC_Stock_BatchNo 同批号辅助属性保质期生产日期或有效期不同

商贸版报错内容里含t_CC_Stock_BatchNo 字符 以及出入库的时候提示“同批号辅助属性保质期生产日期或有效期不同” 完整标题是这个,论坛...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息