SELECT w.date_of_delivery AS 'Дата поставки',
       SUM(w.sum) AS 'Общая сумма',
       SUM(wl.cnt) as 'Количество' 
FROM waybill w
JOIN (SELECT waybill_id, SUM(count) AS cnt FROM waybill_lines wl GROUP BY waybill_id)wl USING (waybill_id)
JOIN sellers USING(sel_id)
WHERE sellers.name = '${seller}'
GROUP BY date_of_delivery