From 832d7e7d7bdf8569c4ae0d35d929f7a0a440954f Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Tue, 26 Sep 2023 15:08:40 +0530 Subject: [PATCH 1/3] fix: set AR filters after rename --- .../process_statement_of_accounts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py index 9a5ad35bcf1..ee1c9cd208a 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py @@ -145,7 +145,8 @@ def get_gl_filters(doc, entry, tax_id, presentation_currency): def get_ar_filters(doc, entry): return { "report_date": doc.posting_date if doc.posting_date else None, - "customer": entry.customer, + "party_type": "Customer", + "party": entry.customer, "customer_name": entry.customer_name if entry.customer_name else None, "payment_terms_template": doc.payment_terms_template if doc.payment_terms_template else None, "sales_partner": doc.sales_partner if doc.sales_partner else None, From 7d96044d8eb74ad1cb78548183350b7512cc091b Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Tue, 26 Sep 2023 15:10:16 +0530 Subject: [PATCH 2/3] fix: change filters for AR summary --- .../accounts_receivable.js | 2 -- .../accounts_receivable_summary.js | 24 ++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index bb00d616dbc..67a14e7880a 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -52,9 +52,7 @@ frappe.query_reports["Accounts Receivable"] = { }, on_change: () => { frappe.query_report.set_filter_value('party', ""); - let party_type = frappe.query_report.get_filter_value('party_type'); frappe.query_report.toggle_filter_display('customer_group', frappe.query_report.get_filter_value('party_type') !== "Customer"); - } }, { diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js index 715cd6476e8..a78fbeb0308 100644 --- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js +++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js @@ -72,10 +72,28 @@ frappe.query_reports["Accounts Receivable Summary"] = { } }, { - "fieldname":"customer", - "label": __("Customer"), + "fieldname": "party_type", + "label": __("Party Type"), "fieldtype": "Link", - "options": "Customer" + "options": "Party Type", + "Default": "Customer", + get_query: () => { + return { + filters: { + 'account_type': 'Receivable' + } + }; + }, + on_change: () => { + frappe.query_report.set_filter_value('party', ""); + frappe.query_report.toggle_filter_display('customer_group', frappe.query_report.get_filter_value('party_type') !== "Customer"); + } + }, + { + "fieldname":"party", + "label": __("Party"), + "fieldtype": "Dynamic Link", + "options": "party_type", }, { "fieldname":"customer_group", From 76a5d94f37054a8c24f84fecf7d55fd9b0d01e81 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Tue, 26 Sep 2023 15:11:54 +0530 Subject: [PATCH 3/3] fix: set new AP summary filters --- .../accounts_payable/accounts_payable.js | 3 --- .../accounts_payable_summary.js | 23 ++++++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js index 27a85701edd..484ff7fa2b3 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -108,11 +108,8 @@ frappe.query_reports["Accounts Payable"] = { }, on_change: () => { frappe.query_report.set_filter_value('party', ""); - let party_type = frappe.query_report.get_filter_value('party_type'); frappe.query_report.toggle_filter_display('supplier_group', frappe.query_report.get_filter_value('party_type') !== "Supplier"); - } - }, { "fieldname":"party", diff --git a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js index ea200720dff..8a1725c0485 100644 --- a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js +++ b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js @@ -72,10 +72,27 @@ frappe.query_reports["Accounts Payable Summary"] = { } }, { - "fieldname":"supplier", - "label": __("Supplier"), + "fieldname": "party_type", + "label": __("Party Type"), "fieldtype": "Link", - "options": "Supplier" + "options": "Party Type", + get_query: () => { + return { + filters: { + 'account_type': 'Payable' + } + }; + }, + on_change: () => { + frappe.query_report.set_filter_value('party', ""); + frappe.query_report.toggle_filter_display('supplier_group', frappe.query_report.get_filter_value('party_type') !== "Supplier"); + } + }, + { + "fieldname":"party", + "label": __("Party"), + "fieldtype": "Dynamic Link", + "options": "party_type", }, { "fieldname":"payment_terms_template",