Commit 10712f84 by wutong

计算缺货数考虑占用库存

parent 06ff54f8
......@@ -577,7 +577,7 @@
SELECT
t1.bailun_sku,
t1.warehouse_code,
t1.bailun_sku_quantity_ordered - t1.bailun_sku_quantity_picked - t2.usable_stock,
t1.bailun_sku_quantity_ordered - t1.bailun_sku_quantity_picked - t2.usable_stock - t2.occupy_stock,
CURRENT_TIMESTAMP
FROM
(
......@@ -598,7 +598,7 @@
bailun_sku,
warehouse_code
) t1 INNER JOIN dc_base_stock t2 ON t1.bailun_sku=t2.bailun_sku and t1.warehouse_code=t2.warehouse_code
WHERE (t1.bailun_sku_quantity_ordered - t1.bailun_sku_quantity_picked - t2.usable_stock) >= 0
WHERE (t1.bailun_sku_quantity_ordered - t1.bailun_sku_quantity_picked - t2.usable_stock - t2.occupy_stock) >= 0
ON DUPLICATE KEY UPDATE quantity_out_stock = VALUES(quantity_out_stock),gmt_out_stock_modified = VALUES(gmt_out_stock_modified)
</insert>
<update id="updateOldOutStockToZero">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment