Fix in Requests + in Report part
This commit is contained in:
4
App/Report/sql/check_report.sql
Normal file
4
App/Report/sql/check_report.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
SELECT EXISTS (
|
||||
SELECT 1 FROM reports
|
||||
WHERE month = $month AND year = $year
|
||||
) AS exist;
|
||||
@@ -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;
|
||||
5
App/Report/sql/view_report.sql
Normal file
5
App/Report/sql/view_report.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
SELECT name_of_product AS 'Наименование',
|
||||
count_of_bought AS 'Количество',
|
||||
sum AS 'Общая стоимость'
|
||||
FROM reports
|
||||
WHERE month = '$month' AND year = '$year';
|
||||
Reference in New Issue
Block a user