fix: Default year start and end dates in reports
diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js
index 320e1ca..e7b0ca5 100644
--- a/erpnext/accounts/doctype/account/account.js
+++ b/erpnext/accounts/doctype/account/account.js
@@ -79,8 +79,8 @@
frm.add_custom_button(__('General Ledger'), function () {
frappe.route_options = {
"account": frm.doc.name,
- "from_date": frappe.sys_defaults.year_start_date,
- "to_date": frappe.sys_defaults.year_end_date,
+ "from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
"company": frm.doc.company
};
frappe.set_route("query-report", "General Ledger");
diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js
index d537adf..0d74b12 100644
--- a/erpnext/accounts/doctype/account/account_tree.js
+++ b/erpnext/accounts/doctype/account/account_tree.js
@@ -194,8 +194,8 @@
click: function(node, btn) {
frappe.route_options = {
"account": node.label,
- "from_date": frappe.sys_defaults.year_start_date,
- "to_date": frappe.sys_defaults.year_end_date,
+ "from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
"company": frappe.treeview_settings['Account'].treeview.page.fields_dict.company.get_value()
};
frappe.set_route("query-report", "General Ledger");
diff --git a/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js b/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js
index 1da35cd..0bcdd53 100644
--- a/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js
+++ b/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js
@@ -15,14 +15,14 @@
"fieldname":"from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
"reqd": 1
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_end_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
"reqd": 1
},
{
diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
index f0b6c6b..081b9b0 100644
--- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
+++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
@@ -7,7 +7,7 @@
"fieldname":"from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
"width": "80"
},
{
diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
index 5955c2e..15aa265 100644
--- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
+++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
@@ -8,7 +8,7 @@
label: __("From Fiscal Year"),
fieldtype: "Link",
options: "Fiscal Year",
- default: frappe.sys_defaults.fiscal_year,
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
reqd: 1
},
{
@@ -16,7 +16,7 @@
label: __("To Fiscal Year"),
fieldtype: "Link",
options: "Fiscal Year",
- default: frappe.sys_defaults.fiscal_year,
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
reqd: 1
},
{
diff --git a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js
index 9d416db..a7c38ff 100644
--- a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js
+++ b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js
@@ -38,14 +38,14 @@
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
"reqd": 1
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_end_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
"reqd": 1
},
{
diff --git a/erpnext/accounts/report/gross_profit/gross_profit.js b/erpnext/accounts/report/gross_profit/gross_profit.js
index 53921dc..0bd84eb 100644
--- a/erpnext/accounts/report/gross_profit/gross_profit.js
+++ b/erpnext/accounts/report/gross_profit/gross_profit.js
@@ -15,14 +15,14 @@
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
"reqd": 1
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_end_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
"reqd": 1
},
{
diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
index 2343eaa..a762ec8 100644
--- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
+++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
@@ -15,7 +15,7 @@
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_start_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
fieldname:"to_date",
diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
index 6caebd3..3630324 100644
--- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
+++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
@@ -45,13 +45,13 @@
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_end_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
},
{
"fieldname": "show_zero_values",
diff --git a/erpnext/accounts/report/trial_balance/trial_balance.js b/erpnext/accounts/report/trial_balance/trial_balance.js
index e45c3ad..6b78ba2 100644
--- a/erpnext/accounts/report/trial_balance/trial_balance.js
+++ b/erpnext/accounts/report/trial_balance/trial_balance.js
@@ -37,13 +37,13 @@
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_end_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
},
{
"fieldname": "cost_center",
diff --git a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js
index 0f7578c..c51c1bd 100644
--- a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js
+++ b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js
@@ -36,13 +36,13 @@
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_end_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
},
{
"fieldname":"party_type",
diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.js b/erpnext/buying/report/procurement_tracker/procurement_tracker.js
index 283d56c..36f3baa 100644
--- a/erpnext/buying/report/procurement_tracker/procurement_tracker.js
+++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.js
@@ -27,13 +27,13 @@
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_start_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
fieldname:"to_date",
label: __("To Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_end_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
},
]
}
diff --git a/erpnext/buying/report/purchase_analytics/purchase_analytics.js b/erpnext/buying/report/purchase_analytics/purchase_analytics.js
index a884f06..258a4a8 100644
--- a/erpnext/buying/report/purchase_analytics/purchase_analytics.js
+++ b/erpnext/buying/report/purchase_analytics/purchase_analytics.js
@@ -35,14 +35,14 @@
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_start_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
reqd: 1
},
{
fieldname:"to_date",
label: __("To Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_end_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
reqd: 1
},
{
diff --git a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js
index f29c2c6..44e8089 100644
--- a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js
+++ b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js
@@ -6,13 +6,13 @@
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_end_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
}
]
};
diff --git a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js
index bbfd6ac..f0eff6b 100644
--- a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js
+++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js
@@ -6,12 +6,12 @@
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_end_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
}
]};
diff --git a/erpnext/manufacturing/report/job_card_summary/job_card_summary.js b/erpnext/manufacturing/report/job_card_summary/job_card_summary.js
index a874f22..52be328 100644
--- a/erpnext/manufacturing/report/job_card_summary/job_card_summary.js
+++ b/erpnext/manufacturing/report/job_card_summary/job_card_summary.js
@@ -37,14 +37,14 @@
label: __("From Posting Date"),
fieldname:"from_date",
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_start_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
reqd: 1
},
{
label: __("To Posting Date"),
fieldname:"to_date",
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_end_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
reqd: 1,
},
{
diff --git a/erpnext/manufacturing/report/production_analytics/production_analytics.js b/erpnext/manufacturing/report/production_analytics/production_analytics.js
index 99f9b12..d64dca4 100644
--- a/erpnext/manufacturing/report/production_analytics/production_analytics.js
+++ b/erpnext/manufacturing/report/production_analytics/production_analytics.js
@@ -16,14 +16,14 @@
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_start_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
reqd: 1
},
{
fieldname:"to_date",
label: __("To Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_end_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
reqd: 1
},
{
diff --git a/erpnext/public/js/purchase_trends_filters.js b/erpnext/public/js/purchase_trends_filters.js
index c786a86..77f1d2b 100644
--- a/erpnext/public/js/purchase_trends_filters.js
+++ b/erpnext/public/js/purchase_trends_filters.js
@@ -28,7 +28,7 @@
"label": __("Fiscal Year"),
"fieldtype": "Link",
"options":'Fiscal Year',
- "default": frappe.sys_defaults.fiscal_year
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today())
},
{
"fieldname":"period_based_on",
diff --git a/erpnext/public/js/sales_trends_filters.js b/erpnext/public/js/sales_trends_filters.js
index b9c4dca..b73747a 100644
--- a/erpnext/public/js/sales_trends_filters.js
+++ b/erpnext/public/js/sales_trends_filters.js
@@ -48,7 +48,7 @@
"label": __("Fiscal Year"),
"fieldtype": "Link",
"options":'Fiscal Year',
- "default": frappe.sys_defaults.fiscal_year
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
},
{
"fieldname":"company",
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index cc03eca..d4f1991 100755
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -400,7 +400,7 @@
});
},
- get_fiscal_year: function(date) {
+ get_fiscal_year: function(date, with_dates) {
if(!date) {
date = frappe.datetime.get_today();
}
@@ -414,7 +414,10 @@
async: false,
callback: function(r) {
if (r.message) {
- fiscal_year = r.message[0];
+ if (with_dates)
+ fiscal_year = r.message;
+ else
+ fiscal_year = r.message[0];
}
}
});
diff --git a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js
index 1b931e1..b81d415 100644
--- a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js
+++ b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js
@@ -23,14 +23,14 @@
"fieldname":"from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_start_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
"reqd": 1
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": frappe.defaults.get_user_default("year_end_date"),
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
"reqd": 1
}
],
diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.js b/erpnext/selling/report/sales_analytics/sales_analytics.js
index 87dd02f..daf812f 100644
--- a/erpnext/selling/report/sales_analytics/sales_analytics.js
+++ b/erpnext/selling/report/sales_analytics/sales_analytics.js
@@ -35,14 +35,14 @@
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_start_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
reqd: 1
},
{
fieldname:"to_date",
label: __("To Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_end_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
reqd: 1
},
{
diff --git a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js
index adae47b..0ec3b87 100644
--- a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js
+++ b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js
@@ -16,7 +16,7 @@
label: __("Fiscal Year"),
fieldtype: "Link",
options: "Fiscal Year",
- default: frappe.sys_defaults.fiscal_year
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today())
},
{
fieldname: "doctype",
diff --git a/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js
index ba6ee78..1b4d925 100644
--- a/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js
+++ b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js
@@ -22,7 +22,7 @@
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_start_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
fieldname:"to_date",
diff --git a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js
index 2b84436..4db97f5 100644
--- a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js
+++ b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js
@@ -16,7 +16,7 @@
label: __("Fiscal Year"),
fieldtype: "Link",
options: "Fiscal Year",
- default: frappe.sys_defaults.fiscal_year
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
},
{
fieldname: "doctype",
diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
index e269f02..beb853e 100644
--- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
+++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
@@ -20,7 +20,7 @@
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
- default: frappe.defaults.get_user_default("year_start_date"),
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
fieldname:"to_date",
diff --git a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js
index 9f3d255..ad4564b 100644
--- a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js
+++ b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js
@@ -16,7 +16,7 @@
label: __("Fiscal Year"),
fieldtype: "Link",
options: "Fiscal Year",
- default: frappe.sys_defaults.fiscal_year
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today())
},
{
fieldname: "doctype",
diff --git a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js
index 48a72a2..e21ab0d 100644
--- a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js
+++ b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js
@@ -8,7 +8,7 @@
"label": __("From Date"),
"fieldtype": "Date",
"width": "80",
- "default": frappe.sys_defaults.year_start_date,
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
"reqd": 1,
},
{
diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js
index 74b5a5a..f793477 100644
--- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js
+++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js
@@ -16,7 +16,7 @@
"label": __("From Date"),
"fieldtype": "Date",
"width": "80",
- "default": frappe.sys_defaults.year_start_date,
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
"reqd": 1
},
{
diff --git a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js
index c62d480..3293fdd 100644
--- a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js
+++ b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js
@@ -22,14 +22,14 @@
fieldtype: 'Date',
fieldname: 'from_date',
reqd: 1,
- default: frappe.defaults.get_user_default("year_start_date")
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
label: __('To Date'),
fieldtype: 'Date',
fieldname: 'to_date',
reqd: 1,
- default: frappe.defaults.get_user_default("year_end_date")
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
}
]
};
diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js
index 173aad6..889ab5c 100644
--- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js
+++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js
@@ -7,7 +7,7 @@
"fieldname":"from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": frappe.sys_defaults.year_start_date
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
},
{
"fieldname":"to_date",