From 1ad16c368e552f8a39ca19eec31c8847dbc10b2c Mon Sep 17 00:00:00 2001 From: l0gesh29 Date: Wed, 29 Jan 2025 15:37:38 +0530 Subject: [PATCH] fix: remove tds account in taxes table on change of Tax Withholding Category (cherry picked from commit 79b5a3e1dd52e8451a00c25844aca7f6a986b53d) --- .../doctype/purchase_invoice/purchase_invoice.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index dd8758e68a3..a2d02981d64 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -368,6 +368,18 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. } } + tax_withholding_category(frm) { + var me = this; + let filtered_taxes = (me.frm.doc.taxes || []).filter((row) => !row.is_tax_withholding_account); + me.frm.clear_table("taxes"); + + filtered_taxes.forEach((row) => { + me.frm.add_child("taxes", row); + }); + + me.frm.refresh_field("taxes"); + } + credit_to() { var me = this; if (this.frm.doc.credit_to) {