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 %} +

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

+

с

+

по