) as t6 on t1.bailun_sku = t6.bailun_sku and t_db.area_id = t6.area_id
) as t6 on t1.bailun_sku = t6.bailun_sku and t_db.area_id = t6.area_id
where t1.warehouse_code in @warehouse_codes
where t1.warehouse_code in @warehouse_codes
-- and t1.bailun_sku_warehouse_code not in ( select bailun_sku_warehouse_code from dc_auto_shortage_push_ignore )
-- and t1.bailun_sku_warehouse_code not in ( select bailun_sku_warehouse_code from dc_auto_shortage_push_ignore )
and ifnull(t6.usable_stock,0)<2 -- (case when t2.buyer_name in ('张莹霞','张莹霞1') and @platform='ebay' then 2 else 0 end )
and ifnull(t6.usable_stock,0)<=0 -- (case when t2.buyer_name in ('张莹霞','张莹霞1') and @platform='ebay' then 2 else 0 end )
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
";
";
if(!is_all)
if(!is_all)
...
@@ -982,7 +982,7 @@ and t1.platform=@platform and t1.has_return_goods=0
...
@@ -982,7 +982,7 @@ and t1.platform=@platform and t1.has_return_goods=0
and
and
(
(
case
case
when t_db.hq_type not in ( '国内仓' ) then ifnull(tnc1.usable_stock,0) - ifnull(tnc2.quantity_unshipped,0) >= 2
when t_db.hq_type not in ( '国内仓' ) then ifnull(tnc1.usable_stock,0) - ifnull(tnc2.quantity_unshipped,0) > 0