diff --git a/App/Report/sql/workpiece_report.sql b/App/Report/sql/workpiece_report.sql index ee3a641..e35c331 100644 --- a/App/Report/sql/workpiece_report.sql +++ b/App/Report/sql/workpiece_report.sql @@ -1,7 +1,8 @@ -SELECT w.material AS Наименование, +SELECT w.name AS Наименование, + w.material AS Материал, sum(sum) AS Сумма, sum(reports.count) AS Количество from reports JOIN workpiece w ON reports.item_id = w.work_id WHERE report_category_id = '$id' AND (month = '$month' AND year = '$year') -GROUP BY material; \ No newline at end of file +GROUP BY w.material, w.name; \ No newline at end of file diff --git a/App/Report/templates/report_basic.html b/App/Report/templates/report_basic.html index 9faef9f..c2200e0 100644 --- a/App/Report/templates/report_basic.html +++ b/App/Report/templates/report_basic.html @@ -12,11 +12,11 @@

{{ title }}

- {% for item in items %} - + {% for item in items %} - - {% endfor %} + {% endfor %} +