【问题描述】

旗舰版采购订单序时簿的“未入库数”、销售订单序时簿的“未出库数”不正确

【原因分析】

旗舰版综合补丁PT160293新增了支持序时簿查看采购订单的“未入库数”、销售订单的“未出库数”功能,可通过以下语句修复历史数据。

【解决方案】

可参考以下脚本执行处理:

–采购订单“未入库数”历史数据处理

update e set FAuxStockAwaitQty = case when FAuxQty – FAuxStockQty > 0 then FAuxQty – FAuxStockQty else 0 end

from POOrderEntry e where FAuxStockAwaitQty <> case when FAuxQty – FAuxStockQty > 0 then FAuxQty – FAuxStockQty else 0 end

go

update e set FSecStockAwaitQty = case when FSecQty – FSecStockQty > 0 then FSecQty – FSecStockQty else 0 end

from POOrderEntry e where FSecStockAwaitQty <> case when FSecQty – FSecStockQty > 0 then FSecQty – FSecStockQty else 0 end

go

–销售订单“未出库数”历史数据处理

update e set FAuxStockAwaitQty = case when FAuxQty – FAuxStockQty > 0 then FAuxQty – FAuxStockQty else 0 end

from SEOrderEntry e where FAuxStockAwaitQty <> case when FAuxQty – FAuxStockQty > 0 then FAuxQty – FAuxStockQty else 0 end

go

update e set FSecStockAwaitQty = case when FSecQty – FSecStockQty > 0 then FSecQty – FSecStockQty else 0 end

from SEOrderEntry e where FSecStockAwaitQty <> case when FSecQty – FSecStockQty > 0 then FSecQty – FSecStockQty else 0 end

go

【注意事项】

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