diff --git a/App/Report/sql/sellers_report.sql b/App/Report/sql/sellers_report.sql index b02253a..49855a7 100644 --- a/App/Report/sql/sellers_report.sql +++ b/App/Report/sql/sellers_report.sql @@ -1,8 +1,9 @@ SELECT s.name AS Поставщик, - SUM(reports.count) AS 'Количество поставок', - SUM(reports.sum) AS Сумма + reports.sum AS 'Сумма в рублях', + reports.count 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; \ No newline at end of file +GROUP BY s.name +ORDER BY s.name; \ No newline at end of file diff --git a/App/Report/sql/workpiece_report.sql b/App/Report/sql/workpiece_report.sql index e35c331..6abe547 100644 --- a/App/Report/sql/workpiece_report.sql +++ b/App/Report/sql/workpiece_report.sql @@ -1,8 +1,8 @@ SELECT w.name AS Наименование, - w.material AS Материал, - sum(sum) AS Сумма, - sum(reports.count) AS Количество + reports.sum AS 'Сумма в рублях', + 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 w.material, w.name; \ No newline at end of file +GROUP BY w.material, w.name +ORDER BY w.name; \ No newline at end of file diff --git a/App/Requests/README.md b/App/Requests/README.md deleted file mode 100644 index 2c8cf55..0000000 --- a/App/Requests/README.md +++ /dev/null @@ -1 +0,0 @@ -# Переделать первый запрос (поставки конкретной заготовки формата "кем - когда - количество") \ No newline at end of file diff --git a/App/Requests/sql/ship_seller.sql b/App/Requests/sql/ship_seller.sql index db16924..f97bfb8 100644 --- a/App/Requests/sql/ship_seller.sql +++ b/App/Requests/sql/ship_seller.sql @@ -1,4 +1,5 @@ -SELECT w.waybill_date AS 'Дата поставки', +SELECT DATE_FORMAT(w.waybill_date, '%Y-%m-%d') AS 'Дата поставки', + TIME_FORMAT(w.waybill_date, '%H:%i') AS 'Время поставки', SUM(w.total) AS 'Общая сумма (в рублях)', SUM(wl.amount) as 'Общее количество заготовок' FROM waybill w diff --git a/App/Requests/templates/zagotovki.html b/App/Requests/templates/zagotovki.html index b6034d4..56f1c6f 100644 --- a/App/Requests/templates/zagotovki.html +++ b/App/Requests/templates/zagotovki.html @@ -35,7 +35,7 @@