From 830290c859cc8dae0a2e33a6ae9d97b8505d08a0 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Thu, 22 Feb 2024 18:39:17 +0100 Subject: [PATCH] feat: clear payment terms and schedule --- erpnext/public/js/controllers/transaction.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 1f22c7c64e2..8e90853ad06 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1060,11 +1060,16 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe to_clear.push("Payment Schedule Table"); } - frappe.msgprint( + frappe.confirm( __( - "Please clear the {0}", + "Do you want to clear the selected {0}?", [frappe.utils.comma_and(to_clear.map(dt => __(dt)))] - ) + ), + () => { + this.frm.set_value("payment_terms_template", ""); + this.frm.clear_table("payment_schedule"); + this.frm.refresh_field("payment_schedule"); + } ); } }