From 1695d4867b63f2de8bb41b4d7e2f35344f5364ff Mon Sep 17 00:00:00 2001 From: sergei kasianenko Date: Fri, 22 Mar 2024 09:01:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BF=D1=80=D0=BE=D0=BC=D0=B5=D0=B6=D1=83=D1=82?= =?UTF-8?q?=D0=BE=D1=87=D0=BD=D1=8B=D0=B5=20=D1=81=D1=82=D1=80=D0=BE=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/dashboards/views.py | 17 ++++++++++------- integration_framework/employees/views.py | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/api/dashboards/views.py b/api/dashboards/views.py index e0cab38404..9f01a4303b 100644 --- a/api/dashboards/views.py +++ b/api/dashboards/views.py @@ -114,13 +114,16 @@ def cash_register(request): for qr in query_result: if not data.get(qr.department_id): data[qr.department_id] = {"office": qr.depart_name, **{f"{i}.{date_start_month}.{date_start_year}": "" for i in date_per_month}} - tmp_office = data.get(qr.department_id, {}) - tmp_office[qr.char_day] = ( - f"Наличные: {qr.received_cash} \n Терминал: {qr.received_terminal} \n" - f"Возврат нал: {qr.return_cash} \n Возврат терм: {qr.return_terminal} \n" - f"Всего: {qr.received_cash + qr.received_terminal - qr.return_cash - qr.return_terminal}" - ) - data[qr.department_id] = tmp_office.copy() + data[f"Наличные {qr.department_id}"] = {"office": "Наличные", **{f"{i}.{date_start_month}.{date_start_year}": "" for i in date_per_month}} + data[f"Терминал {qr.department_id}"] = {"office": "Терминал", **{f"{i}.{date_start_month}.{date_start_year}": "" for i in date_per_month}} + data[f"Возврат нал {qr.department_id}"] = {"office": "Возврат нал ", **{f"{i}.{date_start_month}.{date_start_year}": "" for i in date_per_month}} + data[f"Возврат терм {qr.department_id}"] = {"office": "Возврат терм ", **{f"{i}.{date_start_month}.{date_start_year}": "" for i in date_per_month}} + data[f"Итого {qr.department_id}"] = {"office": "Итого", **{f"{i}.{date_start_month}.{date_start_year}": "" for i in date_per_month}} + data[f"Наличные {qr.department_id}"][qr.char_day] = qr.received_cash + data[f"Терминал {qr.department_id}"][qr.char_day] = qr.received_terminal + data[f"Возврат нал {qr.department_id}"][qr.char_day] = qr.return_cash + data[f"Возврат терм {qr.department_id}"][qr.char_day] = qr.return_terminal + data[f"Итого {qr.department_id}"][qr.char_day] = qr.received_cash + qr.received_terminal - qr.return_cash - qr.return_terminal table_data = [v for v in data.values()] return JsonResponse({"columns": columns, "tableData": table_data}) diff --git a/integration_framework/employees/views.py b/integration_framework/employees/views.py index d0284b8fc7..e517a24733 100644 --- a/integration_framework/employees/views.py +++ b/integration_framework/employees/views.py @@ -13,6 +13,7 @@ def cash_register(request): body = json.loads(request.body) register_date = body.get("cashRegisterDate") + print(register_date) data = body.get("data") hospital = Hospitals.get_default_hospital() for i in data: From 0f4fa5e9c3d6d113a0488cb5f0dbb0ec279ffa4e Mon Sep 17 00:00:00 2001 From: sergei kasianenko Date: Fri, 22 Mar 2024 09:04:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BF=D1=80=D0=BE=D0=BC=D0=B5=D0=B6=D1=83=D1=82?= =?UTF-8?q?=D0=BE=D1=87=D0=BD=D1=8B=D0=B5=20=D1=81=D1=82=D1=80=D0=BE=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- integration_framework/employees/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/integration_framework/employees/views.py b/integration_framework/employees/views.py index e517a24733..d0284b8fc7 100644 --- a/integration_framework/employees/views.py +++ b/integration_framework/employees/views.py @@ -13,7 +13,6 @@ def cash_register(request): body = json.loads(request.body) register_date = body.get("cashRegisterDate") - print(register_date) data = body.get("data") hospital = Hospitals.get_default_hospital() for i in data: