Untitled
unknown
plain_text
a year ago
971 B
4
Indexable
SELECT c.flag_depo_devision, c.sku_parrent, d.`name` as sku_parrent_name,
sum(a.qty_order) as total_qty_order, sum(a.qty_order * a.factor_kg) as total_tonnage,
COUNT(DISTINCT(b.client_no)) as count_client,
COUNT(a.sku) as count_label,
e.is_priority,
a.printed_at,
g.name as printed_by,
b.fulfill_date
from sales_b2c_detail a
left join sales_b2c b on b.no = a.sales_no
left join master_item c on c.sku = a.sku
left join master_item d on d.sku = c.sku_parrent
left join master_client e on e.no = b.client_no
left join master_item_client f on f.client_no = b.client_no and f.sku = a.sku
left join users g on g.id = a.printed_by
where
a.qty_order <> 0
and b.status = 3
AND b.channel_id IN ($channel_id)
and b.fulfill_date = '$fulfill_date'
and a.depo_id in ($depo_id)
$whereConditions
GROUP BY 1,2,3Editor is loading...
Leave a Comment