diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js index a228c43c7e9..3ab522e4982 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -53,5 +53,11 @@ frappe.query_reports["Accounts Payable"] = { "default": "90", "reqd": 1 } - ] + ], + onload: function(report) { + report.page.add_inner_button(__("Accounts Payable Summary"), function() { + var filters = report.get_values(); + frappe.set_route('query-report', 'Accounts Payable Summary', {company: filters.company}); + }); + } } 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 b01c8bcdc4a..0a1734ae22c 100644 --- a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js +++ b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js @@ -53,5 +53,12 @@ frappe.query_reports["Accounts Payable Summary"] = { "default": "90", "reqd": 1 } - ] + ], + + onload: function(report) { + report.page.add_inner_button(__("Accounts Payable"), function() { + var filters = report.get_values(); + frappe.set_route('query-report', 'Accounts Payable', {company: filters.company}); + }); + } } diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index 3816c6f6504..9bc5c2f2c18 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -53,5 +53,12 @@ frappe.query_reports["Accounts Receivable"] = { "default": "90", "reqd": 1 } - ] + ], + + onload: function(report) { + report.page.add_inner_button(__("Accounts Receivable Summary"), function() { + var filters = report.get_values(); + frappe.set_route('query-report', 'Accounts Receivable Summary', {company: filters.company}); + }); + } } 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 0fe6bc686a0..5cc05667174 100644 --- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js +++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js @@ -53,5 +53,12 @@ frappe.query_reports["Accounts Receivable Summary"] = { "default": "90", "reqd": 1 } - ] + ], + + onload: function(report) { + report.page.add_inner_button(__("Accounts Receivable"), function() { + var filters = report.get_values(); + frappe.set_route('query-report', 'Accounts Receivable', {company: filters.company}); + }); + } }