Отчёт о поставках
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
SELECT EXISTS (
|
||||
SELECT 1 FROM reports
|
||||
WHERE month = $month AND year = $year
|
||||
WHERE report_category_id = '$id' AND (month = '$month' AND year = '$year')
|
||||
) AS exist;
|
||||
8
App/Report/sql/sellers_report.sql
Normal file
8
App/Report/sql/sellers_report.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
SELECT
|
||||
s.name AS Поставщик,
|
||||
SUM(reports.count) AS 'Количество поставок',
|
||||
SUM(reports.sum) AS Сумма
|
||||
FROM reports
|
||||
JOIN sellers s ON reports.item_id = s.sel_id
|
||||
WHERE report_category_id = '$id' AND (month = '$month' AND year = '$year')
|
||||
GROUP BY s.name;
|
||||
Reference in New Issue
Block a user