From d69af741c8507c0b75e1f0b1ce8027a981fe5e83 Mon Sep 17 00:00:00 2001 From: Corentin Flr <10946971+cogk@users.noreply.github.com> Date: Tue, 25 Jul 2023 21:12:14 +0200 Subject: [PATCH] fix(taxes_and_totals.js): Fix initialize_taxes incorrect refactor Following changes from PR #36147, `cur_frm.cscript.validate_taxes_and_charges` is not a method anymore and should be replaced with the `erpnext.accounts.taxes.validate_taxes_and_charges` function. --- erpnext/public/js/controllers/taxes_and_totals.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index 6f4e602abb..eeb09cb8b0 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -172,9 +172,9 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments { $.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0; }); - if (!this.discount_amount_applied && cur_frm) { - cur_frm.cscript.validate_taxes_and_charges(tax.doctype, tax.name); - me.validate_inclusive_tax(tax); + if (!this.discount_amount_applied) { + erpnext.accounts.taxes.validate_taxes_and_charges(tax.doctype, tax.name); + erpnext.accounts.taxes.validate_inclusive_tax(tax); } frappe.model.round_floats_in(tax); });