Fix in Requests + in Report part

This commit is contained in:
2024-11-14 19:19:48 +03:00
parent 7d939ef1e4
commit 19d5ce088e
18 changed files with 222 additions and 54 deletions

View File

@@ -0,0 +1,4 @@
SELECT EXISTS (
SELECT 1 FROM reports
WHERE month = $month AND year = $year
) AS exist;

View File

@@ -1,11 +0,0 @@
SELECT sellers.name AS 'Поставщик',
w.date_of_delivery AS 'Дата поставки',
SUM(wl.count) AS 'Общее количество заготовок',
SUM(wl.price) AS 'Общая стоимость поставленных заготовок'
FROM waybill w
JOIN waybill_lines wl USING(waybill_id)
JOIN workpiece USING(work_id)
JOIN sellers USING(sel_id)
WHERE workpiece.material = '${material}'
AND (w.date_of_delivery BETWEEN '${date_from}' AND '${date_to}')
GROUP BY sellers.name, w.date_of_delivery;

View File

@@ -0,0 +1,5 @@
SELECT name_of_product AS 'Наименование',
count_of_bought AS 'Количество',
sum AS 'Общая стоимость'
FROM reports
WHERE month = '$month' AND year = '$year';