From 248f6987c8bd996f290816c3fe97113eb9c2009e Mon Sep 17 00:00:00 2001 From: ackFromRedmi Date: Thu, 23 Apr 2026 00:04:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=B7=D0=B0=D0=BA=D1=80=D1=8B=D1=82=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=BE=D0=B7=D0=B8=D1=86=D0=B8=D0=B8=20=D1=81?= =?UTF-8?q?=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2?= =?UTF-8?q?=20=D1=84=D0=B0=D0=BA=D1=82.=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=BE=20=D0=B4=D0=BB=D1=8F=20=D0=BA=D1=80?= =?UTF-8?q?=D0=B0=D1=81=D0=B8=D0=B2=D0=BE=D1=81=D1=82=D0=B8=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B3=D1=80=D0=B5=D1=81=D0=B1=D0=B0=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shiftflow/services/assembly_closing.py | 3 ++- shiftflow/services/closing.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/shiftflow/services/assembly_closing.py b/shiftflow/services/assembly_closing.py index cf6e9e8..28bd6c5 100644 --- a/shiftflow/services/assembly_closing.py +++ b/shiftflow/services/assembly_closing.py @@ -185,9 +185,10 @@ def apply_assembly_closing(workitem_id: int, fact_qty: int, user_id: int) -> boo # Двигаем техпроцесс workitem.quantity_done = (workitem.quantity_done or 0) + fact_qty + workitem.quantity_reported = max(int(workitem.quantity_reported or 0), int(workitem.quantity_done or 0)) if workitem.quantity_done >= workitem.quantity_plan: workitem.status = 'done' - workitem.save(update_fields=['quantity_done', 'status']) + workitem.save(update_fields=['quantity_done', 'quantity_reported', 'status']) logger.info( 'assembly_closing:done workitem_id=%s qty=%s deal_id=%s location_id=%s user_id=%s report_id=%s', diff --git a/shiftflow/services/closing.py b/shiftflow/services/closing.py index 629d24a..c27fa6d 100644 --- a/shiftflow/services/closing.py +++ b/shiftflow/services/closing.py @@ -198,13 +198,14 @@ def apply_closing_workitems( created_shift += 1 wi.quantity_done = done_total + fact + wi.quantity_reported = max(int(wi.quantity_reported or 0), int(wi.quantity_done or 0)) if wi.quantity_done >= plan_total: wi.status = 'done' elif wi.quantity_done > 0: wi.status = 'leftover' else: wi.status = 'planned' - wi.save(update_fields=['quantity_done', 'status']) + wi.save(update_fields=['quantity_done', 'quantity_reported', 'status']) for stock_item_id, qty in consumptions.items(): if qty and float(qty) > 0: