From 5505d4bb2a448c4e54475adc0530c5a8026f3feb Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Wed, 11 Dec 2024 23:42:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B3=D0=BE=D0=BD=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=D0=B4=20=D0=A0=D0=9F=D0=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Report/sql/sellers_report.sql | 7 ++++--- App/Report/sql/workpiece_report.sql | 8 ++++---- App/Requests/README.md | 1 - App/Requests/sql/ship_seller.sql | 3 ++- App/Requests/templates/zagotovki.html | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 App/Requests/README.md 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 @@