From e09fb8759751942e2eb2b1c927f2a18cb8bea566 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 31 Dec 2024 16:57:16 +0530 Subject: [PATCH] refactor: use existing method parameters --- .../accounts/doctype/sales_invoice/test_sales_invoice.py | 8 ++++---- erpnext/controllers/taxes_and_totals.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 763fea7a260..439fc5639e5 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -2875,8 +2875,8 @@ class TestSalesInvoice(FrappeTestCase): sales_invoice = create_sales_invoice(item="T Shirt", rate=700, do_not_submit=True) item_tax_map = get_item_tax_map( - doc=sales_invoice, - tax_template=sales_invoice.items[0].item_tax_template, + company=sales_invoice.company, + item_tax_template=sales_invoice.items[0].item_tax_template, ) self.assertEqual(sales_invoice.items[0].item_tax_template, "_Test Account Excise Duty @ 12 - _TC") @@ -2888,8 +2888,8 @@ class TestSalesInvoice(FrappeTestCase): sales_invoice.save() item_tax_map = get_item_tax_map( - doc=sales_invoice, - tax_template=sales_invoice.items[0].item_tax_template, + company=sales_invoice.company, + item_tax_template=sales_invoice.items[0].item_tax_template, ) self.assertEqual(sales_invoice.items[0].item_tax_template, "_Test Account Excise Duty @ 10 - _TC") diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 53d0ce0ee2f..8fecb177295 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -138,8 +138,8 @@ class calculate_taxes_and_totals: def update_item_tax_map(self): for item in self.doc.items: item.item_tax_rate = get_item_tax_map( - doc=self.doc, - tax_template=item.item_tax_template, + company=self.doc.get("company"), + item_tax_template=item.item_tax_template, as_json=True, )