mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 05:09:11 +00:00
Merge pull request #55565 from frappe/mergify/bp/version-16-hotfix/pr-54840
fix: add company filter to Budget Against dimension options (backport #54840)
This commit is contained in:
@@ -38,6 +38,14 @@ function get_filters() {
|
|||||||
let budget_against_options = get_dimensions();
|
let budget_against_options = get_dimensions();
|
||||||
|
|
||||||
let filters = [
|
let filters = [
|
||||||
|
{
|
||||||
|
fieldname: "company",
|
||||||
|
label: __("Company"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Company",
|
||||||
|
default: frappe.defaults.get_user_default("Company"),
|
||||||
|
reqd: 1,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldname: "from_fiscal_year",
|
fieldname: "from_fiscal_year",
|
||||||
label: __("From Fiscal Year"),
|
label: __("From Fiscal Year"),
|
||||||
@@ -67,14 +75,6 @@ function get_filters() {
|
|||||||
default: "Yearly",
|
default: "Yearly",
|
||||||
reqd: 1,
|
reqd: 1,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
fieldname: "company",
|
|
||||||
label: __("Company"),
|
|
||||||
fieldtype: "Link",
|
|
||||||
options: "Company",
|
|
||||||
default: frappe.defaults.get_user_default("Company"),
|
|
||||||
reqd: 1,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
fieldname: "budget_against",
|
fieldname: "budget_against",
|
||||||
label: __("Budget Against"),
|
label: __("Budget Against"),
|
||||||
@@ -96,9 +96,12 @@ function get_filters() {
|
|||||||
if (!frappe.query_report.filters) return;
|
if (!frappe.query_report.filters) return;
|
||||||
|
|
||||||
let budget_against = frappe.query_report.get_filter_value("budget_against");
|
let budget_against = frappe.query_report.get_filter_value("budget_against");
|
||||||
|
let company = frappe.query_report.get_filter_value("company");
|
||||||
if (!budget_against) return;
|
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