fix: remove unused params

This commit is contained in:
DaizyModi 2023-07-24 18:02:42 +05:30
parent 653117c2a9
commit 6f376cf103

View File

@ -957,7 +957,7 @@ def get_itemised_tax_breakup_html(doc):
# get tax breakup data # get tax breakup data
itemised_tax_data = get_itemised_tax_breakup_data(doc) itemised_tax_data = get_itemised_tax_breakup_data(doc)
get_rounded_tax_amount(itemised_tax_data, doc.precision("tax_amount", "taxes"), tax_accounts) get_rounded_tax_amount(itemised_tax_data, doc.precision("tax_amount", "taxes"))
update_itemised_tax_data(doc) update_itemised_tax_data(doc)
frappe.flags.company = None frappe.flags.company = None
@ -1000,21 +1000,17 @@ def get_itemised_tax_breakup_header(item_doctype, tax_accounts):
@erpnext.allow_regional @erpnext.allow_regional
def get_itemised_tax_breakup_data(doc): def get_itemised_tax_breakup_data(doc):
return _get_itemised_tax_breakup_data(doc) itemised_tax = get_itemised_tax(doc.taxes)
def _get_itemised_tax_breakup_data(doc, with_tax_account=False):
itemised_tax = get_itemised_tax(doc.taxes, with_tax_account=with_tax_account)
itemised_taxable_amount = get_itemised_taxable_amount(doc.items) itemised_taxable_amount = get_itemised_taxable_amount(doc.items)
itemised_tax_data = [] itemised_tax_data = []
for item_code, taxes in itemised_tax.items(): for item_code, taxes in itemised_tax.items():
for _item_code, taxable_amount in itemised_taxable_amount.items(): itemised_tax_data.append(
if item_code == _item_code: frappe._dict(
itemised_tax_data.append( {"item": item_code, "taxable_amount": itemised_taxable_amount.get(item_code), **taxes}
frappe._dict({"item": item_code, "taxable_amount": taxable_amount, **taxes}) )
) )
return itemised_tax_data return itemised_tax_data
@ -1059,12 +1055,12 @@ def get_itemised_taxable_amount(items):
return itemised_taxable_amount return itemised_taxable_amount
def get_rounded_tax_amount(itemised_tax, precision, tax_accounts): def get_rounded_tax_amount(itemised_tax, precision):
# Rounding based on tax_amount precision # Rounding based on tax_amount precision
for _itemised_tax in itemised_tax: for taxes in itemised_tax:
for key, value in _itemised_tax.items(): for row in taxes.values():
if key in tax_accounts: if isinstance(row, dict) and isinstance(row["tax_amount"], float):
value["tax_amount"] = flt(value["tax_amount"], precision) row["tax_amount"] = flt(row["tax_amount"], precision)
class init_landed_taxes_and_totals(object): class init_landed_taxes_and_totals(object):