SELECT b.suuid AS order_uuid, b.docm2_prechecked AS order_prechecked, b.docm2_guestcount AS order_guestcount, b.docm2_sortfield AS order_sortfield, b.docm2_maxguestcount AS order_maxguestcount, f.name AS halltable_name, a.uuid AS itemrow_uuid, c.name AS dish_name, a.docm2tabl1_confirmed AS dish_confirmed, a.docm2tabl1_cooked AS dish_cooked, a.docm2tabl1_supplied AS dish_supplied, Sum(a.docm2tabl1_quantity) AS quantity FROM docm2_orders AS b LEFT JOIN docm2tabl1_items AS a ON b.suuid = a.owner LEFT JOIN ctlg15_dishes AS c ON a.docm2tabl1_ctlg15_uuid__dish = c.suuid LEFT JOIN ctlg13_halltables AS f ON b.docm2_ctlg13_uuid__halltable = f.suuid WHERE b.docm2_ctlg11_uuid__restaurant = '81a2a15d-687e-4f09-b6b4-cfb678cd450b' AND b.docm2_ctlg14_uuid__shift = '91748063-e2b5-186d-2671-9a6bacd75845' AND b.docm2_ctlg5_uuid__garcon = '52f28cd4-d53c-44f1-935e-1e86cd6a7915' AND b.docm2_closed IS FALSE GROUP BY b.suuid, b.docm2_prechecked, b.docm2_guestcount, b.docm2_sortfield, b.docm2_maxguestcount, f.name, a.uuid, c.name, a.docm2tabl1_confirmed, a.docm2tabl1_cooked, a.docm2tabl1_supplied
Обсуждают сегодня