diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index e8917514eb..76f43118fc 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -15,7 +15,22 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { this.filters = { timespan: "Last Week", timegrain: "Daily", + account: "Cash - GTPL", } + + this.account_select = this.page.add_field({ + fieldname: "account", + label: __("Account"), + fieldtype: "Link", + options: "Account", + get_query: { + doctype: "Account", + filters: { + company: "Gadget Technologies Pvt. Ltd.", + } + } + }).$wrapper.find("input") + this.timespan_select = this.page.add_select(__("Time Span"), this.timespans.map(d => { return {"label": __(d), value: d } @@ -27,6 +42,10 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { return {"label": __(d), value: d } }) ) + this.account_select.on("change", function() { + me.filters.account = this.value + me.create_chart() + }); this.timespan_select.on("change", function() { me.filters.timespan = this.value