fix: avoid duplicate taxes and charges rows in payment entry (backport #52178) (#52318)

Co-authored-by: Dharanidharan S <dharanidharans1328@gmail.com>
fix: avoid duplicate taxes and charges rows in payment entry (#52178)
This commit is contained in:
mergify[bot]
2026-02-23 10:15:00 +00:00
committed by GitHub
parent dada7c4aa8
commit 946c3554b1

View File

@@ -1465,16 +1465,15 @@ frappe.ui.form.on("Payment Entry", {
callback: function (r) { callback: function (r) {
if (!r.exc && r.message) { if (!r.exc && r.message) {
// set taxes table // set taxes table
if (r.message) { let taxes = r.message;
for (let tax of r.message) { taxes.forEach((tax) => {
if (tax.charge_type === "On Net Total") { if (tax.charge_type === "On Net Total") {
tax.charge_type = "On Paid Amount"; tax.charge_type = "On Paid Amount";
}
frm.add_child("taxes", tax);
} }
frm.events.apply_taxes(frm); });
frm.events.set_unallocated_amount(frm); frm.set_value("taxes", taxes);
} frm.events.apply_taxes(frm);
frm.events.set_unallocated_amount(frm);
} }
}, },
}); });