fix - improve excel reapopnse on transaction
This commit is contained in:
@@ -452,7 +452,7 @@ class WareHouseExcelViewSet(viewsets.ViewSet):
|
|||||||
).values(
|
).values(
|
||||||
'transaction_id',
|
'transaction_id',
|
||||||
'name',
|
'name',
|
||||||
'price'
|
'unit_price'
|
||||||
)
|
)
|
||||||
|
|
||||||
# Aggregate share totals per transaction
|
# Aggregate share totals per transaction
|
||||||
@@ -518,13 +518,13 @@ class WareHouseExcelViewSet(viewsets.ViewSet):
|
|||||||
# جمع share totals هر تراکنش
|
# جمع share totals هر تراکنش
|
||||||
share_values = []
|
share_values = []
|
||||||
for share_name in share_names:
|
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_values.append(share_total)
|
||||||
share_column_totals[share_name] += share_total
|
share_column_totals[share_name] += share_total
|
||||||
|
|
||||||
# جمع کل
|
# جمع کل
|
||||||
total_price += t['price_paid'] or 0
|
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
|
all_weight += total_weight
|
||||||
|
|
||||||
list1 = [
|
list1 = [
|
||||||
|
|||||||
Reference in New Issue
Block a user