mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-02 04:58:29 +00:00
fix: use key consistently
This commit is contained in:
@@ -48,8 +48,9 @@ def group_by_party_and_category(data, filters):
|
|||||||
party_category_wise_map = {}
|
party_category_wise_map = {}
|
||||||
|
|
||||||
for row in data:
|
for row in data:
|
||||||
|
key = (row.get("party_type"), row.get("party"), row.get("tax_withholding_category"))
|
||||||
party_category_wise_map.setdefault(
|
party_category_wise_map.setdefault(
|
||||||
(row.get("party_type"), row.get("party"), row.get("tax_withholding_category")),
|
key,
|
||||||
{
|
{
|
||||||
"pan": row.get("pan"),
|
"pan": row.get("pan"),
|
||||||
"tax_id": row.get("tax_id"),
|
"tax_id": row.get("tax_id"),
|
||||||
@@ -64,13 +65,8 @@ def group_by_party_and_category(data, filters):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
party_category_wise_map.get((row.get("party"), row.get("tax_withholding_category")))[
|
party_category_wise_map.get(key)["total_amount"] += row.get("total_amount", 0.0)
|
||||||
"total_amount"
|
party_category_wise_map.get(key)["tax_amount"] += row.get("tax_amount", 0.0)
|
||||||
] += 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)
|
|
||||||
|
|
||||||
final_result = get_final_result(party_category_wise_map)
|
final_result = get_final_result(party_category_wise_map)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user