diff --git a/App/Report/sql/sellers_report.sql b/App/Report/sql/sellers_report.sql index 49855a7..18b4e32 100644 --- a/App/Report/sql/sellers_report.sql +++ b/App/Report/sql/sellers_report.sql @@ -1,6 +1,6 @@ SELECT s.name AS Поставщик, - reports.sum AS 'Сумма в рублях', + reports.sum AS 'Сумма (в ₽)', reports.count AS 'Количество поставок' FROM reports JOIN sellers s ON reports.item_id = s.sel_id diff --git a/App/Report/sql/workpiece_report.sql b/App/Report/sql/workpiece_report.sql index 6abe547..ac9c8e2 100644 --- a/App/Report/sql/workpiece_report.sql +++ b/App/Report/sql/workpiece_report.sql @@ -1,6 +1,6 @@ SELECT w.name AS Наименование, - reports.sum AS 'Сумма в рублях', - reports.count AS 'Количество поставленных заготовок' + reports.sum AS 'Сумма (в ₽)', + reports.count AS 'Количество поставленных заготовок (в шт.)' from reports JOIN workpiece w ON reports.item_id = w.work_id WHERE report_category_id = '$id' AND (month = '$month' AND year = '$year') diff --git a/App/Requests/sql/ship_seller.sql b/App/Requests/sql/ship_seller.sql index f97bfb8..bcfce65 100644 --- a/App/Requests/sql/ship_seller.sql +++ b/App/Requests/sql/ship_seller.sql @@ -1,7 +1,7 @@ SELECT DATE_FORMAT(w.waybill_date, '%Y-%m-%d') AS 'Дата поставки', TIME_FORMAT(w.waybill_date, '%H:%i') AS 'Время поставки', - SUM(w.total) AS 'Общая сумма (в рублях)', - SUM(wl.amount) as 'Общее количество заготовок' + SUM(w.total) AS 'Общая сумма (в ₽)', + SUM(wl.amount) as 'Общее количество заготовок (в шт.)' FROM waybill w JOIN (SELECT waybill_id, SUM(amount) AS amount FROM waybill_lines wl GROUP BY waybill_id)wl USING (waybill_id) diff --git a/App/Requests/sql/sklad_workpiece.sql b/App/Requests/sql/sklad_workpiece.sql index 14f8729..d925e29 100644 --- a/App/Requests/sql/sklad_workpiece.sql +++ b/App/Requests/sql/sklad_workpiece.sql @@ -2,7 +2,7 @@ SELECT DATE_FORMAT(w.waybill_date, '%Y-%m-%d') AS 'Дата поставки', TIME_FORMAT(w.waybill_date, '%H:%i') AS 'Время поставки', s.name AS 'Поставщик', - wl.amount AS 'Количество' + wl.amount AS 'Количество (в шт.)' FROM waybill w JOIN (SELECT waybill_id, work_id, amount FROM waybill_lines) wl USING(waybill_id) diff --git a/App/Waybill/model.py b/App/Waybill/model.py index 4335e07..b13b035 100644 --- a/App/Waybill/model.py +++ b/App/Waybill/model.py @@ -74,12 +74,12 @@ def button_click(request): session["total"] = str(int(session["total"]) + price) session.modified = True else: - print("NEW WORKPIECE") + # print("NEW WORKPIECE") pr_id = product["work_id"] price = product["price"] session["waybill"][str(pr_id)] = "1" session["total"] = str(int(session["total"]) + price) - print(session["waybill"]) + # print(session["waybill"]) session.modified = True elif request.form.get("product_display_minus"): @@ -121,7 +121,7 @@ def transaction_order_model(user_id: int, current_date: date) -> InfoRespronse: ), ) cursor.execute(_sql) - result = tuple([order_id]) + result = tuple([order_id]) if result is None: return InfoRespronse((), error_message="Заказ не был создан", status=False) clear() diff --git a/App/Waybill/templates/waybill.html b/App/Waybill/templates/waybill.html index 4698e25..43c6eb3 100644 --- a/App/Waybill/templates/waybill.html +++ b/App/Waybill/templates/waybill.html @@ -39,22 +39,34 @@

Накладная

{% if waybill %} - {% for item in waybill %} - {{ card.render_item(item, show_form = False, show_amount = True) }} - {% endfor %} -
-
Итого: {{ session.get('total', '0') }} ₽
+
+
+
+ {% for item in waybill %} +
+ {{ card.render_item(item, show_form = False, show_amount = True) }} +
+ {% endfor %} +
+
+
+
Итого: {{ session.get('total', '0') }} ₽
+ +
- {% else %} - Ваша накладная пуста - +
+
+ Ваша накладная пуста +
+ +
{% endif %}
diff --git a/App/app.py b/App/app.py index 97f561d..34ca2a7 100644 --- a/App/app.py +++ b/App/app.py @@ -2,7 +2,7 @@ import json import os from Auth import auth_bp -from flask import Flask, render_template, session +from flask import Flask, redirect, render_template, session from Report import report_bp from Requests import requests_bp from Waybill import waybill_bp @@ -45,7 +45,7 @@ def index(): @app.route("/logout") def logout(): session.clear() - return render_template("main_menu.html", ses=session) + return redirect("/") if __name__ == "__main__": diff --git a/App/cache/wrapper.py b/App/cache/wrapper.py index e4a0bba..50f65b0 100644 --- a/App/cache/wrapper.py +++ b/App/cache/wrapper.py @@ -17,7 +17,7 @@ def fetch_from_cache(cache_name: str, cache_config: dict): @wraps(f) def wrapper(*args, **kwargs): cached_value = cache_conn.get_value(cache_name) - print("cached_value=", cached_value) + # print("cached_value=", cached_value) if cached_value: return cached_value response = f(*args, **kwargs) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..974ef27 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Use the official Python image as a base +FROM python:3.9.20-alpine3.19 + +# Set the working directory inside the container +WORKDIR /app + +# Copy the contents of the 'App' folder to the working directory +COPY App/ /app + +# Copy the requirements file to the working directory +COPY requirements.txt /app + +# Install the dependencies from the requirements file +RUN pip install --no-cache-dir -r requirements.txt + +EXPOSE 5001 +# Command to run the application +CMD ["gunicorn", "--bind", "0.0.0.0:5001", "app:app"] diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..418d6d2 --- /dev/null +++ b/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker build -t tsettaro/kursovaya-ris:latest . +docker push tsettaro/kursovaya-ris:latest \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 4e407bf..fc9471b 100644 Binary files a/requirements.txt and b/requirements.txt differ