i have a query how can i deduct lates of an employee based on given below condition
Lates:
Late Days > 03 : 01 Day Salary Deduction
Late Days > 05 : 02 Days Deduction
Late Days > 06 : 02 Day Salary Deduction
Late Days > 10 : 04 Days Deduction
i have a query how can i deduct lates of an employee based on given below condition
Lates:
Late Days > 03 : 01 Day Salary Deduction
Late Days > 05 : 02 Days Deduction
Late Days > 06 : 02 Day Salary Deduction
Late Days > 10 : 04 Days Deduction
you need to customized at server script
can you guide me on that or provide server scripts for that
Same scenario i implemented in my case
Lates:
Late Days = 2 : No Salary Deduction
Late Days = 3 : Half Day Salary Deduction
Late Days = 5 : Half Days Deduction
Late Days = 6 : 1 Day Salary Deduction
so i my case it is multiple of three days will get deducted half day.
is you condtions are corrent like if employee have 4 late mark then one day salary will deduct and if employee have 6 late mark then 2 day salary will deduct and employee have 7 or 8 or 9 late mark then 2 day salary deduct and from 11 onwards 4 days salary deduct , it is correct, as per you conditions?
Yes how to acheive this functionality
in your scenerio there is no pattern as in my scenerio there is a pattern like on 3 late 0.5 days will deducted on 6 late entries 1 days will deducted and so on.
Can you explain is there is a pattern in your scenerio? then i can help?
firstly:
When do we say an employee is late?
Then :
If an employee is late, there must be a custom field like (Is Late) or use existing field like(Late Entry) in the attendance doctype indicating his lateness and make it checked.
And Can you provide me with examples about Lates scenarios?
So that I can help you properly
If the Shift time is 09:00 AM and employee check in at 09:01 then it will be marked as late so there is no grace time for employees and employee will marked late after shift in type
@rucha_mahabal i think frappe hrms does not have any way around on late days deduction does late days deduction are not standard in firms so why till now frappe give solution of that also there is no resource on forum.
Hello @Mohtashim_Shoaib,
The feature for deducting days when someone is late isn’t in Frappe HRMS right now, but they plan to add it later. Until then, you can make your own changes to the software to do this. This is one of the cool things about open-source software - if it doesn’t do something you need, you can either change it yourself or help make it better for everyone. Plus, by sharing your changes or ideas on forums, you might help make this feature come to life sooner.
There’s no real barrier to customization. With open-source software like Frappe HRMS, you’re free to modify it to fit your needs. If it doesn’t have a feature you need, like automatically deducting days for being late, you can customize the software to include it or even handle it manually. Open-source means you have the tools and permission to make these changes yourself or with the community’s help.
Hello @Rehan_Ansari ,
That’s true infact i have a script which do this functionality which will work on salary slip only for that you have to create 2 fields in salary slips number of lates day which will be in int format and the other field is no. of lates days button both fields will be in salary slip and this below given script as client script in salary slip : frappe.ui.form.on(‘Salary Slip’, {
refresh: function(frm) {
frm.toggle_display(‘get_number_of_late_days’, !frm.is_new());
},
employee: function(frm) {
frm.trigger(‘update_number_of_late_days’);
},
start_date: function(frm) {
frm.trigger(‘update_number_of_late_days’);
},
end_date: function(frm) {
frm.trigger(‘update_number_of_late_days’);
},
get_number_of_late_days: function(frm) {
frm.trigger(‘sync_number_of_late_days’);
},
update_number_of_late_days: function(frm) {
if (!frm.is_new() && !frm.is_dirty()) return;
frm.trigger(‘sync_number_of_late_days’);
},
sync_number_of_late_days: function(frm) {
if (!frm.doc.employee || !frm.doc.start_date || !frm.doc.end_date) return;
frappe.db.get_list(‘Attendance’, {
fields: [‘name’],
filters: {
employee: frm.doc.employee,
late_entry: 1,
attendance_date: [‘between’, [frm.doc.start_date, frm.doc.end_date]]
}
}).then(ret => {
let count = ret.length, late_days = cint(frm.doc.number_of_late_days);
if (count === late_days) return;
frm.set_value(‘number_of_late_days’, count);
if (!frm.is_new()) {
frm.dirty();
// frm.save();
}
});
}
});
frappe.ui.form.on(‘Salary Slip’, {
employee: function(frm) {
if (!frm.is_new() && !frm.is_dirty()) return;
if (!frm.doc.employee || !frm.doc.start_date || !frm.doc.end_date) return;
frappe.db.get_list(‘Attendance’, {
fields: [‘name’],
filters: {
employee: frm.doc.employee,
late_entry: 1,
attendance_date: [‘between’, [frm.doc.start_date, frm.doc.end_date]]
}
}).then(ret => {
let count = ret.length, late_days = cint(frm.doc.number_of_late_days);
if (count === late_days) return;
frm.set_value(‘number_of_late_days’, count);
if (!frm.is_new()) {
frm.dirty();
frm.save();
}
});
}
});
frappe.ui.form.on(‘Salary Slip’, {
refresh: function(frm) {
if (cint(frm.doc.number_of_late_days) === 0) frm.trigger(‘sync_number_of_late_days’);
frm.toggle_display(‘get_number_of_late_days’, !frm.is_new());
},
employee: function(frm) {
frm.trigger(‘update_number_of_late_days’);
},
start_date: function(frm) {
frm.trigger(‘update_number_of_late_days’);
},
end_date: function(frm) {
frm.trigger(‘update_number_of_late_days’);
},
get_number_of_late_days: function(frm) {
frm.trigger(‘sync_number_of_late_days’);
},
update_number_of_late_days: function(frm) {
if (!frm.is_new() && !frm.is_dirty()) return;
frm.trigger(‘sync_number_of_late_days’);
},
sync_number_of_late_days: function(frm) {
if (!frm.doc.employee || !frm.doc.start_date || !frm.doc.end_date) return;
frappe.db.get_list(‘Attendance’, {
fields: [‘name’],
filters: {
employee: frm.doc.employee,
late_entry: 1,
attendance_date: [‘between’, [frm.doc.start_date, frm.doc.end_date]]
}
}).then(ret => {
let count = ret.length, late_days = cint(frm.doc.number_of_late_days);
if (count === late_days) return;
frm.set_value(‘number_of_late_days’, count);
if (!frm.is_new()) {
frm.dirty();
frm.save();
}
});
}
});
also assign salary structure, condition, and formula for calculating late.
Thanks but this script does not work with payroll entry so i am finding a solution for that. If any one interested for participate in this please connect with me.