Files
SupplierSystem/migrations/20261105_picking_settlement_mode.sql
Ubuntu c36054a39e
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s
feat(分拣): 显式结算方式与主系统计划同步状态
分拣支持按重量/按数量结算(数量模式要求订单单位=库存单位);出库按结算方式取量;订单详情展示主系统计划同步状态并支持重试。
2026-11-03 10:42:51 +08:00

15 lines
897 B
SQL
Raw Permalink 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.
-- 2026-11-02:分拣行显式结算方式。
-- auto:沿用现有口径(库存单位是重量则优先实称重,否则数量)
-- weight:按库存单位的实际称重结算
-- count:按订单数量结算(仅允许订单单位=库存单位;库存按斤不能直接按个扣)
DO $$
DECLARE sch text;
BEGIN
FOR sch IN SELECT nspname FROM pg_namespace WHERE nspname='tenant_template' OR nspname LIKE 'tenant\_%' LOOP
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=sch AND table_name='picking_items') THEN
EXECUTE format('ALTER TABLE %I.picking_items ADD COLUMN IF NOT EXISTS settlement_mode VARCHAR(10) NOT NULL DEFAULT ''auto''', sch);
EXECUTE format($c$COMMENT ON COLUMN %I.picking_items.settlement_mode IS '分拣结算方式:auto/weight/count;count 仅当订单单位与库存单位一致'$c$, sch);
END IF;
END LOOP;
END $$;