From 7a8c5b0c2c019063c5c98e4c1323ec6d0a4575a3 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 25 Sep 2018 18:34:33 +0530 Subject: [PATCH] fix(setup wizard): Validate FY dates (#15473) --- 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 6fa710d982a..484d81decc8 100644 --- a/erpnext/public/js/setup_wizard.js +++ b/erpnext/public/js/setup_wizard.js @@ -138,10 +138,15 @@ erpnext.setup.slides_settings = [ validate: function () { // validate fiscal year start and end dates - if (this.values.fy_start_date == 'Invalid date' || this.values.fy_end_date == 'Invalid date') { + const invalid = this.values.fy_start_date == 'Invalid date' || + this.values.fy_end_date == 'Invalid date'; + const start_greater_than_end = this.values.fy_start_date > this.values.fy_end_date; + + if (invalid || start_greater_than_end) { frappe.msgprint(__("Please enter valid Financial Year Start and End Dates")); return false; } + return true; },