Files
wq-wms-java/sql/20261116_material_document_quality.sql
2026-11-16 20:02:21 +08:00

16 lines
879 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- SAP物料凭证:质检物料保存但只做展示
-- 1) 明细新增质检标识,101+库存类型X 的行打标为质检
-- 2) 主表状态新增 QUALITY(质检):整单明细均为质检时使用
ALTER TABLE `material_document_item`
ADD COLUMN `qc_flag` VARCHAR(1) DEFAULT '0'
COMMENT '质检标识:1-质检行(101+库存类型X),只展示不参与收货与SAP回传' AFTER `insmk`;
-- 存量数据按库存类型回填质检标记(历史数据中质检行原本整单被过滤,理论上没有,此处兜底)
UPDATE `material_document_item`
SET `qc_flag` = '1'
WHERE `bwart` = '101' AND `insmk` = 'X';
ALTER TABLE `material_document`
MODIFY COLUMN `status` VARCHAR(20) DEFAULT 'CREATED'
COMMENT '状态:CREATED-已创建,POSTED-已过账,CANCELED-已取消,COMPLETED-已完成,QUALITY-质检,REVERSED-已冲销';