mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 04:04:52 +00:00
Merge pull request #53223 from Shllokkk/dashboard-chart-fix
Bank balance chart fix for payments dashboard
This commit is contained in:
@@ -17,6 +17,15 @@ frappe.dashboards.chart_sources["Account Balance Timeline"] = {
|
||||
fieldtype: "Link",
|
||||
options: "Account",
|
||||
reqd: 1,
|
||||
default: locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"],
|
||||
get_query: () => {
|
||||
return {
|
||||
filters: {
|
||||
account_type: "Bank",
|
||||
is_group: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -37,21 +37,14 @@ def get(
|
||||
filters = frappe.parse_json(filters) or frappe.parse_json(chart.filters_json)
|
||||
|
||||
account = filters.get("account")
|
||||
filters.get("company")
|
||||
company = filters.get("company")
|
||||
|
||||
if not account and chart_name:
|
||||
frappe.throw(
|
||||
_("Account is not set for the dashboard chart {0}").format(
|
||||
get_link_to_form("Dashboard Chart", chart_name)
|
||||
)
|
||||
)
|
||||
|
||||
if not frappe.db.exists("Account", account) and chart_name:
|
||||
frappe.throw(
|
||||
_("Account {0} does not exists in the dashboard chart {1}").format(
|
||||
account, get_link_to_form("Dashboard Chart", chart_name)
|
||||
)
|
||||
)
|
||||
if not company and not account:
|
||||
frappe.throw(_("Company and account filters not set!"))
|
||||
if not company:
|
||||
frappe.throw(_("Company filter not set!"))
|
||||
if not account:
|
||||
frappe.throw(_("Account filter not set!"))
|
||||
|
||||
if not to_date:
|
||||
to_date = nowdate()
|
||||
|
||||
Reference in New Issue
Block a user