Merge pull request #51170 from frappe/mergify/bp/version-15-hotfix/pr-51169

fix(payment entry): set row id for 'On Previous Row Amount' or 'On Previous Row Total' charge type on tax table (backport #51169)
This commit is contained in:
Diptanil Saha
2025-12-17 15:32:05 +05:30
committed by GitHub

View File

@@ -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'" "Can refer row only if the charge type is 'On Previous Row Amount' or 'Previous Row Total'"
); );
d.row_id = ""; d.row_id = "";
} else if ( } else if (d.charge_type == "On Previous Row Amount" || d.charge_type == "On Previous Row Total") {
(d.charge_type == "On Previous Row Amount" || d.charge_type == "On Previous Row Total") &&
d.row_id
) {
if (d.idx == 1) { if (d.idx == 1) {
msg = __( msg = __(
"Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row" "Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"
); );
d.charge_type = ""; d.charge_type = "";
} else if (!d.row_id) { } 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.idx - 1;
d.row_id = "";
} else if (d.row_id && d.row_id >= d.idx) { } else if (d.row_id && d.row_id >= d.idx) {
msg = __( msg = __(
"Cannot refer row number greater than or equal to current row number for this Charge type" "Cannot refer row number greater than or equal to current row number for this Charge type"