fix: Route condition set with proper filter (#31556)

* fix: Redirect to report with proper filter

* Update member.js

* fix: Route condition set with proper filter

* fix: Route condition set with proper filter

* fix: Route condition set with proper filter

Co-authored-by: Marica <maricadsouza221197@gmail.com>
This commit is contained in:
Nihantra C. Patel
2022-07-21 18:29:06 +05:30
committed by GitHub
parent 95e1021caf
commit 5cdc267aee

View File

@@ -21,13 +21,18 @@ frappe.ui.form.on('Member', {
// custom buttons
frm.add_custom_button(__('Accounting Ledger'), function() {
frappe.set_route('query-report', 'General Ledger',
{party_type:'Member', party:frm.doc.name});
});
frm.add_custom_button(__('Accounts Receivable'), function() {
frappe.set_route('query-report', 'Accounts Receivable', {member:frm.doc.name});
if (frm.doc.customer) {
frappe.set_route('query-report', 'General Ledger', {party_type: 'Customer', party: frm.doc.customer});
} else {
frappe.set_route('query-report', 'General Ledger', {party_type: 'Member', party: frm.doc.name});
}
});
if (frm.doc.customer) {
frm.add_custom_button(__('Accounts Receivable'), function() {
frappe.set_route('query-report', 'Accounts Receivable', {customer: frm.doc.customer});
});
}
if (!frm.doc.customer) {
frm.add_custom_button(__('Create Customer'), () => {