From b28deaae2c0e3784c7cbe585ded11d5354d65c9c Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 7 Dec 2023 19:39:24 +0530 Subject: [PATCH] fix: format only if searched text contain link value text (cherry picked from commit 08ed3cd31394eb1108dc29a7a5b3f6ded85e3656) --- erpnext/public/js/financial_statements.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js index 907a775bfa53..5e1974299ee1 100644 --- a/erpnext/public/js/financial_statements.js +++ b/erpnext/public/js/financial_statements.js @@ -2,10 +2,16 @@ frappe.provide("erpnext.financial_statements"); erpnext.financial_statements = { "filters": get_filters(), - "formatter": function(value, row, column, data, default_formatter) { + "formatter": function(value, row, column, data, default_formatter, filter) { if (data && column.fieldname=="account") { value = data.account_name || value; + if (filter && filter?.text && filter?.type == "contains") { + if (!value.toLowerCase().includes(filter.text)) { + return value; + } + } + if (data.account) { column.link_onclick = "erpnext.financial_statements.open_general_ledger(" + JSON.stringify(data) + ")";