9 小时以前 0beb4e197c13ccce94a943e158993c503700f4da
1
2
3
4
5
6
7
8
9
-- shipping_info 新增"本次发货数量"字段,支持部分发货
ALTER TABLE shipping_info
    ADD COLUMN quantity DECIMAL(18, 2) NULL COMMENT '本次发货数量' AFTER sales_ledger_product_id;
 
-- 历史数据回填:存量发货单按对应产品行数量回填
UPDATE shipping_info si
    LEFT JOIN sales_ledger_product slp ON si.sales_ledger_product_id = slp.id
SET si.quantity = slp.quantity
WHERE si.quantity IS NULL;