fix(setup wizard): Validate FY dates (#15473)

This commit is contained in:
Faris Ansari 2018-09-25 18:34:33 +05:30 committed by Nabin Hait
parent 056ecdca6a
commit 7a8c5b0c2c

View File

@ -138,10 +138,15 @@ erpnext.setup.slides_settings = [
validate: function () { validate: function () {
// validate fiscal year start and end dates // 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")); frappe.msgprint(__("Please enter valid Financial Year Start and End Dates"));
return false; return false;
} }
return true; return true;
}, },