refactor!: store item wise tax details as a more flexible dict

This commit is contained in:
David
2024-11-07 22:07:12 +01:00
parent 5af88a7fb1
commit 3732dd1b1f
12 changed files with 162 additions and 90 deletions

View File

@@ -109,3 +109,19 @@ def deprecation_warning(marked: str, graduation: str, msg: str):
### Party starts here
@deprecated(
"erpnext.controllers.taxes_and_totals.get_itemised_taxable_amount",
"2024-11-07",
"v17",
"The field item_wise_tax_detail now already contains the net_amount per tax.",
)
def taxes_and_totals_get_itemised_taxable_amount(items):
import frappe
itemised_taxable_amount = frappe._dict()
for item in items:
item_code = item.item_code or item.item_name
itemised_taxable_amount.setdefault(item_code, 0)
itemised_taxable_amount[item_code] += item.net_amount
return itemised_taxable_amount