From 99680a080cb4bb7a99b034d88d661efcbe691510 Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Sun, 4 Jan 2026 14:17:03 +0330 Subject: [PATCH] fix - improve excel reapopnse on transaction --- apps/warehouse/services/excel/excel_processing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/warehouse/services/excel/excel_processing.py b/apps/warehouse/services/excel/excel_processing.py index f84e338..8778726 100644 --- a/apps/warehouse/services/excel/excel_processing.py +++ b/apps/warehouse/services/excel/excel_processing.py @@ -452,7 +452,7 @@ class WareHouseExcelViewSet(viewsets.ViewSet): ).values( 'transaction_id', 'name', - 'price' + 'unit_price' ) # Aggregate share totals per transaction @@ -518,13 +518,13 @@ class WareHouseExcelViewSet(viewsets.ViewSet): # جمع share totals هر تراکنش share_values = [] for share_name in share_names: - share_total = sum(i['price'] for i in t_items if i['name'] == share_name) + share_total = sum(i['unit_price'] for i in t_items if i['name'] == share_name) share_values.append(share_total) share_column_totals[share_name] += share_total # جمع کل total_price += t['price_paid'] or 0 - total_weight += sum(i['price'] or 0 for i in t_items) # یا وزن واقعی اگر موجود باشه + total_weight += sum(i['unit_price'] or 0 for i in t_items) # یا وزن واقعی اگر موجود باشه all_weight += total_weight list1 = [