From 6af7dd4e1b98118c876decc42fb4d414b7117805 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 17 Feb 2017 14:47:25 +0530 Subject: [PATCH] Set fiscal year start and end date based on country --- erpnext/public/js/setup_wizard.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js index 30323ecd6b..c2a15950d8 100644 --- a/erpnext/public/js/setup_wizard.js +++ b/erpnext/public/js/setup_wizard.js @@ -100,7 +100,12 @@ function load_erpnext_slides() { fy = ["01-01", "12-31"]; next_year = current_year; } - + + var year_start_date = current_year + "-" + fy[0]; + if(year_start_date > get_today()) { + next_year = current_year + current_year -= 1; + } slide.get_field("fy_start_date").set_input(current_year + "-" + fy[0]); slide.get_field("fy_end_date").set_input(next_year + "-" + fy[1]); }