fix: full day leaves not tagged as half day in attendance (#20487)
* fix: full day leaves not tagged as half day in attendance * chore: code cleanup for half day date value set
This commit is contained in:
parent
f639e363d6
commit
830b316543
@ -104,11 +104,16 @@ frappe.ui.form.on("Leave Application", {
|
||||
},
|
||||
|
||||
half_day: function(frm) {
|
||||
if (frm.doc.from_date == frm.doc.to_date) {
|
||||
frm.set_value("half_day_date", frm.doc.from_date);
|
||||
if (frm.doc.half_day) {
|
||||
if (frm.doc.from_date == frm.doc.to_date) {
|
||||
frm.set_value("half_day_date", frm.doc.from_date);
|
||||
}
|
||||
else {
|
||||
frm.trigger("half_day_datepicker");
|
||||
}
|
||||
}
|
||||
else {
|
||||
frm.trigger("half_day_datepicker");
|
||||
frm.set_value("half_day_date", "");
|
||||
}
|
||||
frm.trigger("calculate_total_days");
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user