Commit 6f6c655f by lizefeng

修复计算国内仓总库存时,忽略了占用库存的bug

parent 05deeb43
......@@ -780,7 +780,7 @@ INSERT into china_warehouse_stock_temp(`bailun_sku`,`sum_usable_stock`,`warehous
SELECT
`t1`.`bailun_sku` AS `bailun_sku`,
sum( `t1`.`usable_stock` + t1.occupy_stock ) AS `sum_usable_stock`,
group_concat( ( CASE WHEN ( `t1`.`usable_stock` > 0 ) THEN `t1`.`warehouse_code` ELSE '' END ) SEPARATOR ' | ' ) AS `warehouse_codes`
group_concat( ( CASE WHEN ( `t1`.`usable_stock` + t1.occupy_stock > 0 ) THEN `t1`.`warehouse_code` ELSE '' END ) SEPARATOR ' | ' ) AS `warehouse_codes`
FROM
( `dc_base_stock` `t1` LEFT JOIN `dc_base_warehouse` `t2` ON ( ( `t1`.`warehouse_code` = `t2`.`warehouse_code` ) ) )
WHERE
......
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