From fed5af86384c7f9988cc041b47f9f79d36d99a38 Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Fri, 22 Nov 2024 17:15:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B0=D0=BD=D0=BD=D0=B0=D1=8F=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5?= =?UTF-8?q?=D0=B4=D1=83=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=B2=D1=89=D0=B8=D0=BA=D0=BE=D0=B2=20+=20js?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BC=D0=B5=D1=81=D1=8F=D1=86=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Report/__init__.py | 7 +++++-- App/Report/access/2.json | 2 +- App/Report/templates/report_basic.html | 6 ++++-- App/static/js/check.js | 7 +++++++ 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 App/static/js/check.js diff --git a/App/Report/__init__.py b/App/Report/__init__.py index 73ce20b..a824f02 100644 --- a/App/Report/__init__.py +++ b/App/Report/__init__.py @@ -1,6 +1,7 @@ from flask import request, Blueprint, render_template, session, url_for from checker import check_auth from os import path +from datetime import date from .report_model import view_report, make_report import json @@ -22,7 +23,8 @@ def create(): return render_template('report_basic.html', is_write=True, title='Создание отчетов', - items=report_list) + items=report_list, + date_today=date.today()) else: data = dict(id=request.form.get('category'), month=request.form.get('month'), @@ -48,7 +50,8 @@ def view(): return render_template('report_basic.html', is_write=False, title='Просмотр отчетов', - items=report_list) + items=report_list, + date_today=date.today()) else: data = dict(id=request.form.get('category'), month=request.form.get('month'), diff --git a/App/Report/access/2.json b/App/Report/access/2.json index d7a7537..270aaf5 100644 --- a/App/Report/access/2.json +++ b/App/Report/access/2.json @@ -3,5 +3,5 @@ "write" : ["Бухгалтер"], "read" : ["Управляющий"], "view" : "sellers_report", - "procedure" : "report_sellers" + "procedure" : "report_sellers_2" } \ No newline at end of file diff --git a/App/Report/templates/report_basic.html b/App/Report/templates/report_basic.html index ab2de71..1cf4630 100644 --- a/App/Report/templates/report_basic.html +++ b/App/Report/templates/report_basic.html @@ -5,6 +5,7 @@ {{ title }} +
@@ -12,7 +13,7 @@

{{ title }}

-
+ - +
{% if is_write %} @@ -51,3 +52,4 @@ + diff --git a/App/static/js/check.js b/App/static/js/check.js new file mode 100644 index 0000000..e4546b0 --- /dev/null +++ b/App/static/js/check.js @@ -0,0 +1,7 @@ +function check_month(now_month) { + let selected_month = document.getElementById('month').value; + if (selected_month > now_month) { + alert('Невозможно сформировать отчет за будущий период!'); + return false; + } +} \ No newline at end of file