diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 874ea5082a..8232020dfe 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -341,15 +341,7 @@ class calculate_taxes_and_totals(object): self.doc.rounding_adjustment += flt(self.doc.rounded_total - self.doc.grand_total, self.doc.precision("rounding_adjustment")) - if self.doc.meta.get_field("base_rounded_total"): - company_currency = erpnext.get_company_currency(self.doc.company) - - self.doc.base_rounded_total = \ - round_based_on_smallest_currency_fraction(self.doc.base_grand_total, - company_currency, self.doc.precision("base_rounded_total")) - - self.doc.base_rounding_adjustment += flt(self.doc.base_rounded_total - self.doc.base_grand_total, - self.doc.precision("base_rounding_adjustment")) + self._set_in_company_currency(self.doc, ["rounding_adjustment", "rounded_total"]) def _cleanup(self): for tax in self.doc.get("taxes"): diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index afdc87392a..c7abed8305 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -443,16 +443,8 @@ erpnext.taxes_and_totals = erpnext.payments.extend({ this.frm.doc.currency, precision("rounded_total")); this.frm.doc.rounding_adjustment += flt(this.frm.doc.rounded_total - this.frm.doc.grand_total, precision("rounding_adjustment")); - } - if(frappe.meta.get_docfield(this.frm.doc.doctype, "base_rounded_total", this.frm.doc.name)) { - var company_currency = this.get_company_currency(); - this.frm.doc.base_rounded_total = - round_based_on_smallest_currency_fraction(this.frm.doc.base_grand_total, - company_currency, precision("base_rounded_total")); - - this.frm.doc.base_rounding_adjustment += flt(this.frm.doc.base_rounded_total - - this.frm.doc.base_grand_total, precision("rounding_adjustment")); + this.set_in_company_currency(this.frm.doc, ["rounding_adjustment", "rounded_total"]); } },