Skip to content

Commit

Permalink
fix: wrong round off and rounded total
Browse files Browse the repository at this point in the history
(cherry picked from commit 3a487bd)
  • Loading branch information
rtdany10 authored and mergify[bot] committed Nov 19, 2023
1 parent 5033f18 commit 296433a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions erpnext/controllers/taxes_and_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def calculate(self):
if self.doc.apply_discount_on == "Grand Total" and self.doc.get("is_cash_or_non_trade_discount"):
self.doc.grand_total -= self.doc.discount_amount
self.doc.base_grand_total -= self.doc.base_discount_amount
self.doc.rounding_adjustment = self.doc.base_rounding_adjustment = 0.0
self.set_rounded_total()

self.calculate_shipping_charges()
Expand Down
3 changes: 3 additions & 0 deletions erpnext/public/js/controllers/taxes_and_totals.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
if (this.frm.doc.apply_discount_on == "Grand Total" && this.frm.doc.is_cash_or_non_trade_discount) {
this.frm.doc.grand_total -= this.frm.doc.discount_amount;
this.frm.doc.base_grand_total -= this.frm.doc.base_discount_amount;
this.frm.doc.rounding_adjustment = 0;
this.frm.doc.base_rounding_adjustment = 0;
this.set_rounded_total();
}

await this.calculate_shipping_charges();
Expand Down

0 comments on commit 296433a

Please sign in to comment.