标题摘要内容
SQL语句取消物料保质期管理
作者:凡城科技 | 作者:佚名 | 发布时间: 1064天前 | 325 次浏览 | 分享到:

物料已启用保质期管理,现需要取消启用。

处理步骤如下:

1、需要取消保质期管理的物料,找出该物料最早发生业务的库存单据期间;

2、存货核算反结账到该期间;

3、执行以下语句后,再结账回来校对即时库存。

update t_ICItemMaterial set FISKFPeriod=0,FKFPeriod=0  where fnumber='物料代码' 

--单引号中填上需要取消保质期管理的物料代码

go

update b set FKFDate=NULL,FKFPeriod=0,FPeriodDate=NULL 

from t_ICItem a,ICStockBillEntry b

where a.FItemID=b.FItemID and a.FISKFPeriod =0

and (b.FKFDate is not NULL or b.FKFPeriod<>0 or b.FPeriodDate is not NULL )

and a.fnumber='物料代码' 

--单引号中填上需要取消保质期管理的物料代码


【注意事项】

正式账套执行脚本前请先做好备份,建议待在测试账套中核实无误后再在正式账套中执行。