From 48f2011a38bd7ddb605b7effa7300e0654546483 Mon Sep 17 00:00:00 2001 From: DXC Date: Fri, 24 Apr 2026 13:32:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=9B=98=E7=82=B9=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E5=B7=B2=E7=9B=98=E6=95=B0=E9=87=8F=E7=BB=9F=E8=AE=A1=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E5=AD=97=E6=AE=B5=E5=90=8D=20quantity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-backend/app/api/v1/inbound/stock.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inventory-backend/app/api/v1/inbound/stock.py b/inventory-backend/app/api/v1/inbound/stock.py index 2efe39c..89fa1b7 100644 --- a/inventory-backend/app/api/v1/inbound/stock.py +++ b/inventory-backend/app/api/v1/inbound/stock.py @@ -329,7 +329,8 @@ def get_drafts(): # 计算真实的去重"已盘数量" counted_items_set = set() for draft_item in items: - if draft_item.get('qty_actual') is not None: + # 兼容判断 quantity 或 qty_actual + if draft_item.get('quantity') is not None or draft_item.get('qty_actual') is not None: unique_key = f"{draft_item.get('source_table', '')}_{draft_item.get('stock_id', '')}" counted_items_set.add(unique_key) total_scanned_unique = len(counted_items_set)