Skip to content

Commit

Permalink
test: fix test case for itemised tax breakup
Browse files Browse the repository at this point in the history
  • Loading branch information
DaizyModi committed Jul 21, 2023
1 parent b84deec commit c91a940
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1900,16 +1900,14 @@ def test_item_wise_tax_breakup(self):

si = self.create_si_to_test_tax_breakup()

itemised_tax, itemised_taxable_amount = get_itemised_tax_breakup_data(si)
itemised_tax_data = get_itemised_tax_breakup_data(si)

expected_itemised_tax = {
"_Test Item": {"Service Tax": {"tax_rate": 10.0, "tax_amount": 1000.0}},
"_Test Item 2": {"Service Tax": {"tax_rate": 10.0, "tax_amount": 500.0}},
}
expected_itemised_taxable_amount = {"_Test Item": 10000.0, "_Test Item 2": 5000.0}
expected_itemised_tax = [
{"item": "_Test Item", "taxable_amount": 10000.0, "Service Tax": {"tax_rate": 10.0, "tax_amount": 1000.0}},
{"item": "_Test Item 2", "taxable_amount": 5000.0, "Service Tax": {"tax_rate": 10.0, "tax_amount": 500.0}},
]

self.assertEqual(itemised_tax, expected_itemised_tax)
self.assertEqual(itemised_taxable_amount, expected_itemised_taxable_amount)
self.assertEqual(itemised_tax_data, expected_itemised_tax)

frappe.flags.country = None

Expand Down
4 changes: 2 additions & 2 deletions erpnext/controllers/taxes_and_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,8 @@ def get_itemised_tax_breakup_header(item_doctype, tax_accounts):


@erpnext.allow_regional
def get_itemised_tax_breakup_data(doc, with_tax_account=False):
return _get_itemised_tax_breakup_data(doc, with_tax_account=False)
def get_itemised_tax_breakup_data(doc):
return _get_itemised_tax_breakup_data(doc)


def _get_itemised_tax_breakup_data(doc, with_tax_account=False):
Expand Down

0 comments on commit c91a940

Please sign in to comment.