FIX
This commit is contained in:
@@ -46,8 +46,4 @@ def make_report(input_data: dict, proc_name: str) -> InfoRespronse:
|
|||||||
return InfoRespronse((),
|
return InfoRespronse((),
|
||||||
error_message = 'Ошибка в подключении к базе данных. Свяжитесь с администратором',
|
error_message = 'Ошибка в подключении к базе данных. Свяжитесь с администратором',
|
||||||
status=False)
|
status=False)
|
||||||
# elif result['message'] != 'OK':
|
|
||||||
# return InfoRespronse((),
|
|
||||||
# error_message = 'Невозможно создать отчет (нет продаж за выбранный период)',
|
|
||||||
# status=False)
|
|
||||||
return InfoRespronse((), error_message='', status=True)
|
return InfoRespronse((), error_message='', status=True)
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<h1>{{ title }}</h1>
|
<h1>{{ title }}</h1>
|
||||||
<div class="form">
|
<div class="form">
|
||||||
<form action="" method="post" onsubmit="return check_month({{ date_today.month }})">
|
<form action="" method="post" onsubmit="return check_month({{ date_today.month }}, {{ date_today.year }})">
|
||||||
<label for="category">Выберите предмет формирования отчета</label>
|
<label for="category">Выберите предмет формирования отчета</label>
|
||||||
<select name="category" id="category" required>
|
<select name="category" id="category" required>
|
||||||
{% for item in items.keys() %}
|
{% for item in items.keys() %}
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<option value="11">Ноябрь</option>
|
<option value="11">Ноябрь</option>
|
||||||
<option value="12">Декабрь</option>
|
<option value="12">Декабрь</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="number" name="year" value={{ date_today.year }} min="2000" max={{ date_today.year }} required>
|
<input type="number" id= "year" name="year" value={{ date_today.year }} min="2000" max={{ date_today.year }} required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if is_write %}
|
{% if is_write %}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
function check_month(now_month) {
|
function check_month(now_month, now_year) {
|
||||||
let selected_month = document.getElementById('month').value;
|
let selected_month = document.getElementById('month').value;
|
||||||
if (selected_month > now_month) {
|
let selected_year = document.getElementById('year').value;
|
||||||
|
if (selected_month > now_month && selected_year == now_year) {
|
||||||
alert('Невозможно сформировать отчет за будущий период!');
|
alert('Невозможно сформировать отчет за будущий период!');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user