fix: Shipping rule application fixes

This commit is contained in:
Deepesh Garg
2022-03-10 20:56:36 +05:30
parent 64905188c4
commit d596e0e4df
4 changed files with 30 additions and 4 deletions

View File

@@ -37,6 +37,8 @@ class calculate_taxes_and_totals(object):
self.set_discount_amount()
self.apply_discount_amount()
self.calculate_shipping_charges()
if self.doc.doctype in ["Sales Invoice", "Purchase Invoice"]:
self.calculate_total_advance()
@@ -50,7 +52,6 @@ class calculate_taxes_and_totals(object):
self.initialize_taxes()
self.determine_exclusive_rate()
self.calculate_net_total()
self.calculate_shipping_charges()
self.calculate_taxes()
self.manipulate_grand_total_for_inclusive_tax()
self.calculate_totals()
@@ -276,6 +277,8 @@ class calculate_taxes_and_totals(object):
shipping_rule = frappe.get_doc("Shipping Rule", self.doc.shipping_rule)
shipping_rule.apply(self.doc)
self._calculate()
def calculate_taxes(self):
rounding_adjustment_computed = self.doc.get('is_consolidated') and self.doc.get('rounding_adjustment')
if not rounding_adjustment_computed: