mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-24 17:18:30 +00:00
@@ -52,8 +52,9 @@ def group_by_party_and_category(data, filters):
|
||||
party_category_wise_map = {}
|
||||
|
||||
for row in data:
|
||||
key = (row.get("party_type"), row.get("party"), row.get("tax_withholding_category"))
|
||||
party_category_wise_map.setdefault(
|
||||
(row.get("party_type"), row.get("party"), row.get("tax_withholding_category")),
|
||||
key,
|
||||
{
|
||||
"pan": row.get("pan"),
|
||||
"tax_id": row.get("tax_id"),
|
||||
@@ -68,13 +69,8 @@ def group_by_party_and_category(data, filters):
|
||||
},
|
||||
)
|
||||
|
||||
party_category_wise_map.get((row.get("party"), row.get("tax_withholding_category")))[
|
||||
"total_amount"
|
||||
] += row.get("total_amount", 0.0)
|
||||
|
||||
party_category_wise_map.get((row.get("party"), row.get("tax_withholding_category")))[
|
||||
"tax_amount"
|
||||
] += row.get("tax_amount", 0.0)
|
||||
party_category_wise_map.get(key)["total_amount"] += row.get("total_amount", 0.0)
|
||||
party_category_wise_map.get(key)["tax_amount"] += row.get("tax_amount", 0.0)
|
||||
|
||||
final_result = get_final_result(party_category_wise_map)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user