(cherry picked from commit ac816f4fed)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
@@ -4,15 +4,32 @@
|
|||||||
frappe.ui.form.on('Shift Type', {
|
frappe.ui.form.on('Shift Type', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frm.add_custom_button(
|
frm.add_custom_button(
|
||||||
'Mark Attendance',
|
__('Mark Attendance'),
|
||||||
() => frm.call({
|
() => {
|
||||||
doc: frm.doc,
|
if (!frm.doc.enable_auto_attendance) {
|
||||||
method: 'process_auto_attendance',
|
frm.scroll_to_field('enable_auto_attendance');
|
||||||
freeze: true,
|
frappe.throw(__('Please Enable Auto Attendance and complete the setup first.'));
|
||||||
callback: () => {
|
|
||||||
frappe.msgprint(__("Attendance has been marked as per employee check-ins"));
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
if (!frm.doc.process_attendance_after) {
|
||||||
|
frm.scroll_to_field('process_attendance_after');
|
||||||
|
frappe.throw(__('Please set {0}.', [__('Process Attendance After').bold()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!frm.doc.last_sync_of_checkin) {
|
||||||
|
frm.scroll_to_field('last_sync_of_checkin');
|
||||||
|
frappe.throw(__('Please set {0}.', [__('Last Sync of Checkin').bold()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
frm.call({
|
||||||
|
doc: frm.doc,
|
||||||
|
method: 'process_auto_attendance',
|
||||||
|
freeze: true,
|
||||||
|
callback: () => {
|
||||||
|
frappe.msgprint(__('Attendance has been marked as per employee check-ins'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user