Commit 86d04be6 by lizefeng

服装缺货的sku 8点计算的时候,缺货取实时缺货

parent e7c2affb
...@@ -169,7 +169,7 @@ where t1.bailun_sku = t2.bailun_sku and quantity_final_advise=1 and quantity_ini ...@@ -169,7 +169,7 @@ where t1.bailun_sku = t2.bailun_sku and quantity_final_advise=1 and quantity_ini
t1.bailun_sku, t1.bailun_sku,
'GZBLWH' as 'warehouse_code', 'GZBLWH' as 'warehouse_code',
sum(t1.quantity_init_advise) as 'quantity_init_advise', -- 原始采购建议数量 new sum(t1.quantity_init_advise) as 'quantity_init_advise', -- 原始采购建议数量 new
( sum(t1.quantity_out_stock) - ( sum((case when t1.quantity_out_stock>0 then 0 else t1.quantity_inventory end )) + sum(t1.quantity_transfer) + sum(t1.quantity_purchase) ) ) as 'quantity_final_advise', -- 计算moq之后的数量 new ( sum(t7.quantity_out_stock) - ( sum((case when t7.quantity_out_stock>0 then 0 else t1.quantity_inventory end )) + sum(t1.quantity_transfer) + sum(t1.quantity_purchase) ) ) as 'quantity_final_advise', -- 计算moq之后的数量 new
t6.product_inner_code as 'product_inner_code', -- 内部商品编码 new t6.product_inner_code as 'product_inner_code', -- 内部商品编码 new
0 as 'goods_quantity_init_advise', -- 商品本次的建议下单数量 new 0 as 'goods_quantity_init_advise', -- 商品本次的建议下单数量 new
0 as 'goods_moq', -- 商品的moq new 0 as 'goods_moq', -- 商品的moq new
...@@ -192,10 +192,11 @@ where t1.bailun_sku = t2.bailun_sku and quantity_final_advise=1 and quantity_ini ...@@ -192,10 +192,11 @@ where t1.bailun_sku = t2.bailun_sku and quantity_final_advise=1 and quantity_ini
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
where t6.buyer_name in ('赵美聪') and ( t5.`status`=0 or t5.`status` is null ) where t6.buyer_name in ('赵美聪') and ( t5.`status`=0 or t5.`status` is null )
and t1.warehouse_code in ('GZBLWH','GZBLYS') and t1.warehouse_code in ('GZBLWH','GZBLYS')
GROUP BY t1.bailun_sku GROUP BY t1.bailun_sku
HAVING ( sum((case when t1.quantity_out_stock>0 then 0 else t1.quantity_inventory end )) + sum(t1.quantity_transfer) + sum(t1.quantity_purchase) < sum(t1.quantity_out_stock) ) HAVING ( sum((case when t7.quantity_out_stock>0 then 0 else t1.quantity_inventory end )) + sum(t1.quantity_transfer) + sum(t1.quantity_purchase) < sum(t7.quantity_out_stock) )
) ", new { main_id = mainID }, commandTimeout: 0); ) ", new { main_id = mainID }, commandTimeout: 0);
......
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