Merge branch 'Requests'
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
@@ -3,8 +3,9 @@ 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}'
|
||||
AND (w.date_of_delivery BETWEEN '${date_from}' AND '${date_to}')
|
||||
GROUP BY sellers.name, w.date_of_delivery;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Заготовки на складе</title>
|
||||
<title>Материалы заготовок</title>
|
||||
<link href="/static/css/main.css" type="text/css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
@@ -10,7 +10,8 @@
|
||||
<a href="{{ url_for('logout') }}"><button>Выход</button></a>
|
||||
</div>
|
||||
<!-- Input -->
|
||||
<h1>Выберите материал</h1>
|
||||
<h1>Материалы заготовок</h1>
|
||||
<p>Выберите материал<p>
|
||||
<form action="" method="post">
|
||||
<select name="material">
|
||||
{% for item in materials %}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Заготовки на складе</title>
|
||||
<title>Поставки заготовок</title>
|
||||
<link href="/static/css/main.css" type="text/css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
@@ -10,13 +10,17 @@
|
||||
<a href="{{ url_for('logout') }}"><button>Выход</button></a>
|
||||
</div>
|
||||
<!-- Input -->
|
||||
<h1>Выберите материал</h1>
|
||||
<h1>Поставки заготовок</h1>
|
||||
<p>Выберите материал</p>
|
||||
<form action="" method="post">
|
||||
<select name="material">
|
||||
{% for item in materials %}
|
||||
<option value="{{ item['material'] }}">{{ item['material'] }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<p>Выберите даты:</p>
|
||||
<p>с <input type="date" name="date_from" required min="2000-01-01" max="2024-12-31" id="date_from"></p>
|
||||
<p>по <input type="date" name="date_to" required min="2000-01-01" max="2024-12-31" id="date_to"></p>
|
||||
<input type="submit" value="Отправить">
|
||||
</form>
|
||||
<div class="return">
|
||||
|
||||
Reference in New Issue
Block a user