From d7c50cfa7c68209d87643cfcbec59cb86531c4a9 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Wed, 17 Dec 2025 15:12:45 +0530 Subject: [PATCH] fix(payment entry): set row id for 'On Previous Row Amount' or 'On Previous Row Total' charge type on tax table (cherry picked from commit 848f8d6b1ff7624e917b7914ffaa53630c2892e2) --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 31f0235d147..4146b4aebb2 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -1520,18 +1520,14 @@ frappe.ui.form.on("Payment Entry", { "Can refer row only if the charge type is 'On Previous Row Amount' or 'Previous Row Total'" ); d.row_id = ""; - } else if ( - (d.charge_type == "On Previous Row Amount" || d.charge_type == "On Previous Row Total") && - d.row_id - ) { + } else if (d.charge_type == "On Previous Row Amount" || d.charge_type == "On Previous Row Total") { if (d.idx == 1) { msg = __( "Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row" ); d.charge_type = ""; } else if (!d.row_id) { - msg = __("Please specify a valid Row ID for row {0} in table {1}", [d.idx, __(d.doctype)]); - d.row_id = ""; + d.row_id = d.idx - 1; } else if (d.row_id && d.row_id >= d.idx) { msg = __( "Cannot refer row number greater than or equal to current row number for this Charge type"