mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
Merge pull request #54840 from Hemil-Sangani/fix/budget-variance-report-filter
fix: add company filter to Budget Against dimension options
This commit is contained in:
@@ -38,6 +38,14 @@ function get_filters() {
|
||||
let budget_against_options = get_dimensions();
|
||||
|
||||
let filters = [
|
||||
{
|
||||
fieldname: "company",
|
||||
label: __("Company"),
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
default: frappe.defaults.get_user_default("Company"),
|
||||
reqd: 1,
|
||||
},
|
||||
{
|
||||
fieldname: "from_fiscal_year",
|
||||
label: __("From Fiscal Year"),
|
||||
@@ -67,14 +75,6 @@ function get_filters() {
|
||||
default: "Yearly",
|
||||
reqd: 1,
|
||||
},
|
||||
{
|
||||
fieldname: "company",
|
||||
label: __("Company"),
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
default: frappe.defaults.get_user_default("Company"),
|
||||
reqd: 1,
|
||||
},
|
||||
{
|
||||
fieldname: "budget_against",
|
||||
label: __("Budget Against"),
|
||||
@@ -96,9 +96,12 @@ function get_filters() {
|
||||
if (!frappe.query_report.filters) return;
|
||||
|
||||
let budget_against = frappe.query_report.get_filter_value("budget_against");
|
||||
let company = frappe.query_report.get_filter_value("company");
|
||||
if (!budget_against) return;
|
||||
|
||||
return frappe.db.get_link_options(budget_against, txt);
|
||||
const filters = budget_against !== "Branch" && company ? { company: company } : {};
|
||||
|
||||
return frappe.db.get_link_options(budget_against, txt, filters);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user