fix: Default year start and end date in reports
diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js
index e7b0ca5..f033b54 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": 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],
+ "from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+ "to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 0d74b12..f240aa6 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": 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],
+ "from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+ "to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 0bcdd53..5f78b77 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
"reqd": 1
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 081b9b0..8a7d071 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
"width": "80"
},
{
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 06f84af..79e5a09 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
"reqd": 1
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 0bd84eb..7520548 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
"reqd": 1
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 a762ec8..5ec2c98 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: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 da3eafc..c9accef 100644
--- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
+++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
@@ -66,13 +66,13 @@
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 6b78ba2..ee6b4fe 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 c51c1bd..33c644a 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 3bcc219..7e4822c 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: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
fieldname:"to_date",
label: __("To Date"),
fieldtype: "Date",
- default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
},
]
}
diff --git a/erpnext/buying/report/purchase_analytics/purchase_analytics.js b/erpnext/buying/report/purchase_analytics/purchase_analytics.js
index 80ed987..250b334 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: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
reqd: 1
},
{
fieldname:"to_date",
label: __("To Date"),
fieldtype: "Date",
- default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 44e8089..0c4e7f2 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 f0eff6b..6fc52a1 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 650721f..4b3f86f 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: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
reqd: 1
},
{
label: __("To Posting Date"),
fieldname:"to_date",
fieldtype: "Date",
- default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 586297b..77529a5 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: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
reqd: 1
},
{
fieldname:"to_date",
label: __("To Date"),
fieldtype: "Date",
- default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
reqd: 1
},
{
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 10e8431..f456e5e 100755
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -400,7 +400,7 @@
});
},
- get_fiscal_year: function(date, with_dates) {
+ get_fiscal_year: function(date, with_dates=false) {
if(!date) {
date = frappe.datetime.get_today();
}
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 b81d415..744b5d9 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
"reqd": 1
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
- "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 8bc4030..abe4f01 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: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
reqd: 1
},
{
fieldname:"to_date",
label: __("To Date"),
fieldtype: "Date",
- default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
reqd: 1
},
{
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 931d66d..9ed0b00 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: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
fieldname:"to_date",
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 beb853e..80c7b5f 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: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
fieldname:"to_date",
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 e21ab0d..5ead48d 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 f793477..2a65e38 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 4c327d8..a061d04 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: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
label: __('To Date'),
fieldtype: 'Date',
fieldname: 'to_date',
reqd: 1,
- default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
+ default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), 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 889ab5c..3f8d90d 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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1],
+ "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
},
{
"fieldname":"to_date",