Commit 26571614 by 泽锋 李

修复回货推送

parent 40b57004
......@@ -950,12 +950,21 @@ left join (
) as tnc2 on t1.bailun_sku = tnc2.bailun_sku and t_db.area_id = tnc2.area_id
where t1.platform=@platform and t1.has_return_goods=0
and (case
when ifnull(tc2.sum_unshipped_quantity,0) < ifnull(tc1.sum_usable_stock,0) then 1
when ifnull(tnc2.quantity_unshipped,0) < ifnull(tnc1.usable_stock,0) then 1
else 0
end
) = 1
and
(
case
when t2.buyer_name in ('张莹霞','张莹霞1') and t_db.hq_type not in ( '国内仓' ) and t1.platform='ebay' then ifnull(tnc1.usable_stock,0) - ifnull(tnc2.quantity_unshipped,0) >=2
else
(
case
when ifnull(tc2.sum_unshipped_quantity,0) < ifnull(tc1.sum_usable_stock,0) then 1
when ifnull(tnc2.quantity_unshipped,0) < ifnull(tnc1.usable_stock,0) then 1
else 0
end
) = 1
end
)
";
shortage_list.AddRange(conn.Query<dc_return_goods_push>(sql,new { platform= platform }, 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