From 339fd3809e59bd18050c3b08740f6d50fccb6281 Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Thu, 24 Oct 2024 15:08:29 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=BE=D0=B5=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=BE=D0=B3=D0=BE=20sql=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Requests/sql/zapros2.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App/Requests/sql/zapros2.sql b/App/Requests/sql/zapros2.sql index d234619..e70e1e9 100644 --- a/App/Requests/sql/zapros2.sql +++ b/App/Requests/sql/zapros2.sql @@ -3,7 +3,7 @@ SELECT sellers.name AS 'Поставщик', SUM(wl.count) AS 'Общее количество заготовок', SUM(wl.price) AS 'Общая стоимость поставленных заготовок' FROM waybill w -JOIN waybill_lines wl ON w.waybill_id = wl.waybill_id +JOIN waybill_lines wl USING(waybill_id) JOIN workpiece USING(work_id) JOIN sellers USING(sel_id) WHERE workpiece.material = '${material}' From e1d051066997d642d9450f62159ad81c83d56efb Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Thu, 24 Oct 2024 16:31:44 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=9F=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B7=D0=B0=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=BE=D0=BA?= =?UTF-8?q?=20=D0=B7=D0=B0=20=D0=BF=D1=80=D0=BE=D0=BC=D0=B5=D0=B6=D1=83?= =?UTF-8?q?=D1=82=D0=BE=D0=BA=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Requests/requests.py | 2 +- App/Requests/requests_route.py | 2 +- App/Requests/sql/zapros2.sql | 1 + App/Requests/templates/sklad_zapros.html | 5 +++-- App/Requests/templates/zagotovki_ship.html | 8 ++++++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/App/Requests/requests.py b/App/Requests/requests.py index c92f813..3370991 100644 --- a/App/Requests/requests.py +++ b/App/Requests/requests.py @@ -48,8 +48,8 @@ def zagotovki_ship(): return zagotovki.error_message else: material = dict(request.form) + print(material) zagotovki = route(session['db_config'], material, sql_provider, 'zapros2.sql') - print(zagotovki) if zagotovki.status: header = f'Поставленные заготовки из материала \'{material["material"]}\'' return render_template('output.html', items=zagotovki.result, object=header) diff --git a/App/Requests/requests_route.py b/App/Requests/requests_route.py index 961753b..513474b 100644 --- a/App/Requests/requests_route.py +++ b/App/Requests/requests_route.py @@ -11,5 +11,5 @@ def route(db_config, input_data, sql_provider, name) -> InfoRespronse: print("sql = ", _sql) result = select_list(db_config, _sql) if result is None: - return InfoRespronse(result, error_message = 'Ошибка в подключении к базе данных', status=False) + return InfoRespronse(result, error_message = 'Ошибка в подключении к базе данных. Свяжитесь с администратором', status=False) return InfoRespronse(result, error_message='', status=True) \ No newline at end of file diff --git a/App/Requests/sql/zapros2.sql b/App/Requests/sql/zapros2.sql index e70e1e9..bac1519 100644 --- a/App/Requests/sql/zapros2.sql +++ b/App/Requests/sql/zapros2.sql @@ -7,4 +7,5 @@ JOIN waybill_lines wl USING(waybill_id) JOIN workpiece USING(work_id) JOIN sellers USING(sel_id) WHERE workpiece.material = '${material}' +AND (w.date_of_delivery BETWEEN '${date_from}' AND '${date_to}') GROUP BY sellers.name, w.date_of_delivery; diff --git a/App/Requests/templates/sklad_zapros.html b/App/Requests/templates/sklad_zapros.html index 124b2c7..edc9640 100644 --- a/App/Requests/templates/sklad_zapros.html +++ b/App/Requests/templates/sklad_zapros.html @@ -2,7 +2,7 @@ - Заготовки на складе + Материалы заготовок @@ -10,7 +10,8 @@ -

Выберите материал

+

Материалы заготовок

+

Выберите материал

{% for item in materials %} {% endfor %} +

Выберите даты:

+

с

+

по