[bug] Leave application ui issues fixed (#13740)
* validate to_date in leave application if to_date is less than from_date show message to user reset to_date value to '' * var declaration and semicolon missed * Updated popup message
This commit is contained in:
parent
70330e8379
commit
02c93a3d05
@ -110,6 +110,15 @@ frappe.ui.form.on("Leave Application", {
|
|||||||
|
|
||||||
calculate_total_days: function(frm) {
|
calculate_total_days: function(frm) {
|
||||||
if(frm.doc.from_date && frm.doc.to_date && frm.doc.employee && frm.doc.leave_type) {
|
if(frm.doc.from_date && frm.doc.to_date && frm.doc.employee && frm.doc.leave_type) {
|
||||||
|
|
||||||
|
var from_date = Date.parse(frm.doc.from_date);
|
||||||
|
var to_date = Date.parse(frm.doc.to_date);
|
||||||
|
|
||||||
|
if(to_date < from_date){
|
||||||
|
frappe.msgprint(__("To Date cannot be less than From Date"));
|
||||||
|
frm.set_value('to_date', '');
|
||||||
|
return;
|
||||||
|
}
|
||||||
// server call is done to include holidays in leave days calculations
|
// server call is done to include holidays in leave days calculations
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
method: 'erpnext.hr.doctype.leave_application.leave_application.get_number_of_leave_days',
|
method: 'erpnext.hr.doctype.leave_application.leave_application.get_number_of_leave_days',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user