fix(accounts): correct base grand total and rounded total mismatch (backport #51739) (#52101)

Co-authored-by: Dharanidharan S <dharanidharans1328@gmail.com>
fix(accounts): correct base grand total and rounded total mismatch (#51739)
This commit is contained in:
mergify[bot]
2026-01-27 14:23:10 +05:30
committed by GitHub
parent 53b73757ed
commit 6115f8fb9a

View File

@@ -637,6 +637,12 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
tax_count ? this.frm.doc["taxes"][tax_count - 1].total + grand_total_diff : this.frm.doc.net_total tax_count ? this.frm.doc["taxes"][tax_count - 1].total + grand_total_diff : this.frm.doc.net_total
); );
// total taxes and charges is calculated before adjusting base grand total
this.frm.doc.total_taxes_and_charges = flt(
this.frm.doc.grand_total - this.frm.doc.net_total - grand_total_diff,
precision("total_taxes_and_charges")
);
if ( if (
["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "POS Invoice"].includes( ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "POS Invoice"].includes(
this.frm.doc.doctype this.frm.doc.doctype
@@ -679,11 +685,6 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
]); ]);
} }
this.frm.doc.total_taxes_and_charges = flt(
this.frm.doc.grand_total - this.frm.doc.net_total - grand_total_diff,
precision("total_taxes_and_charges")
);
this.set_in_company_currency(this.frm.doc, ["total_taxes_and_charges"]); this.set_in_company_currency(this.frm.doc, ["total_taxes_and_charges"]);
// Round grand total as per precision // Round grand total as per precision