From 78adbfd3cebf086b22a0eab2e997526d0c1be373 Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Sun, 4 Jan 2026 16:35:16 +0330 Subject: [PATCH] fix - some improves on new excel transactions --- apps/warehouse/services/excel/excel_processing.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/warehouse/services/excel/excel_processing.py b/apps/warehouse/services/excel/excel_processing.py index 9ed3dfa..52ccaf8 100644 --- a/apps/warehouse/services/excel/excel_processing.py +++ b/apps/warehouse/services/excel/excel_processing.py @@ -636,19 +636,16 @@ class WareHouseExcelViewSet(viewsets.ModelViewSet, ExcelDynamicSearchMixin): t_items = transaction_shares_map.get(t['id'], []) products_str = '، '.join([i['name'] for i in t_items]) if t_items else '-' - # جمع share totals هر تراکنش share_values = [] for share_name in share_names: - # print(t_items, '\n', share_name) for i in t_items: share_total = sum( share['price'] for share in i['item_share'] if share['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['unit_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 = [ @@ -661,9 +658,9 @@ class WareHouseExcelViewSet(viewsets.ModelViewSet, ExcelDynamicSearchMixin): str(shamsi_date(t['transaction_date'], in_value=True)) if t.get('transaction_date') else '', products_str, t.get('transaction_id', '-'), - '-', # شماره کارت اگر موجود باشه + '-', # card t.get('price_paid', 0), - f'{total_weight}کیلوگرم', # ماهیت وزن + f'{total_weight}کیلوگرم', TRANSACTION_STATUS_MAP.get(t.get('transaction_status'), '-'), ] list1.extend(share_values)