fix: set taxes before calculating taxes and totals
(cherry picked from commit 0fd0695bbb)
This commit is contained in:
@@ -194,6 +194,14 @@ class AccountsController(TransactionBase):
|
|||||||
self.set_incoming_rate()
|
self.set_incoming_rate()
|
||||||
self.init_internal_values()
|
self.init_internal_values()
|
||||||
|
|
||||||
|
# Need to set taxes based on taxes_and_charges template
|
||||||
|
# before calculating taxes and totals
|
||||||
|
if self.meta.get_field("taxes_and_charges"):
|
||||||
|
self.validate_enabled_taxes_and_charges()
|
||||||
|
self.validate_tax_account_company()
|
||||||
|
|
||||||
|
self.set_taxes_and_charges()
|
||||||
|
|
||||||
if self.meta.get_field("currency"):
|
if self.meta.get_field("currency"):
|
||||||
self.calculate_taxes_and_totals()
|
self.calculate_taxes_and_totals()
|
||||||
|
|
||||||
@@ -204,10 +212,6 @@ class AccountsController(TransactionBase):
|
|||||||
|
|
||||||
self.validate_all_documents_schedule()
|
self.validate_all_documents_schedule()
|
||||||
|
|
||||||
if self.meta.get_field("taxes_and_charges"):
|
|
||||||
self.validate_enabled_taxes_and_charges()
|
|
||||||
self.validate_tax_account_company()
|
|
||||||
|
|
||||||
self.validate_party()
|
self.validate_party()
|
||||||
self.validate_currency()
|
self.validate_currency()
|
||||||
self.validate_party_account_currency()
|
self.validate_party_account_currency()
|
||||||
@@ -252,8 +256,6 @@ class AccountsController(TransactionBase):
|
|||||||
self.validate_deferred_income_expense_account()
|
self.validate_deferred_income_expense_account()
|
||||||
self.set_inter_company_account()
|
self.set_inter_company_account()
|
||||||
|
|
||||||
self.set_taxes_and_charges()
|
|
||||||
|
|
||||||
if self.doctype == "Purchase Invoice":
|
if self.doctype == "Purchase Invoice":
|
||||||
self.calculate_paid_amount()
|
self.calculate_paid_amount()
|
||||||
# apply tax withholding only if checked and applicable
|
# apply tax withholding only if checked and applicable
|
||||||
|
|||||||
Reference in New Issue
Block a user