Исправление запроса для просмотра отчёта по заготовкам + fix шаблона для ввода/просмотра отчёта
This commit is contained in:
@@ -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;
|
||||
GROUP BY w.material, w.name;
|
||||
@@ -12,11 +12,11 @@
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
<form action="" method="post">
|
||||
{% for item in items %}
|
||||
<select name="category" required>
|
||||
<select name="category" required>
|
||||
{% for item in items %}
|
||||
<option value="{{ item['id'] }}">{{ item['name'] }}</option>
|
||||
</select>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<select name="month" required>
|
||||
<option value="1">Январь</option>
|
||||
<option value="2">Февраль</option>
|
||||
|
||||
Reference in New Issue
Block a user