mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-29 06:38:24 +00:00
@@ -961,6 +961,7 @@ class AccountsController(TransactionBase):
|
||||
"account_head": account_head,
|
||||
"rate": 0,
|
||||
"description": account_head,
|
||||
"set_by_item_tax_template": 1,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -3176,10 +3177,11 @@ def set_child_tax_template_and_map(item, child_item, parent_doc):
|
||||
)
|
||||
|
||||
child_item.item_tax_template = _get_item_tax_template(ctx, item.taxes)
|
||||
if child_item.get("item_tax_template"):
|
||||
child_item.item_tax_rate = get_item_tax_map(
|
||||
parent_doc.get("company"), child_item.item_tax_template, as_json=True
|
||||
)
|
||||
child_item.item_tax_rate = get_item_tax_map(
|
||||
doc=parent_doc,
|
||||
tax_template=child_item.item_tax_template,
|
||||
as_json=True,
|
||||
)
|
||||
|
||||
|
||||
def add_taxes_from_tax_template(child_item, parent_doc, db_insert=True):
|
||||
@@ -3202,6 +3204,7 @@ def add_taxes_from_tax_template(child_item, parent_doc, db_insert=True):
|
||||
"charge_type": "On Net Total",
|
||||
"account_head": tax_type,
|
||||
"rate": tax_rate,
|
||||
"set_by_item_tax_template": 1,
|
||||
}
|
||||
)
|
||||
if parent_doc.doctype == "Purchase Order":
|
||||
|
||||
@@ -501,9 +501,7 @@ class calculate_taxes_and_totals:
|
||||
)
|
||||
|
||||
elif tax.charge_type == "On Net Total":
|
||||
if not item_tax_map:
|
||||
current_net_amount = item.net_amount
|
||||
elif tax.account_head in item_tax_map:
|
||||
if tax.account_head in item_tax_map:
|
||||
current_net_amount = item.net_amount
|
||||
current_tax_amount = (tax_rate / 100.0) * item.net_amount
|
||||
elif tax.charge_type == "On Previous Row Amount":
|
||||
|
||||
@@ -79,7 +79,7 @@ class TestTaxesAndTotals(FrappeTestCase):
|
||||
"rate": 50,
|
||||
},
|
||||
)
|
||||
|
||||
self.doc.set_missing_item_details()
|
||||
calculate_taxes_and_totals(self.doc)
|
||||
|
||||
expected_values = {
|
||||
|
||||
Reference in New Issue
Block a user