feat(dashbard): Set account from filters
This commit is contained in:
parent
4f247a0ed5
commit
94c4740729
1 changed files with 19 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue