[FIX] attendances: check if has sign in and out
This commit is contained in:
parent
edcdb4855a
commit
bf9e55ca0a
|
|
@ -139,12 +139,12 @@ class HrAttendanceTransactions(models.Model):
|
|||
if adjusted_sign_in and item.has_sign_out:
|
||||
item.official_hours = adjusted_sign_out - adjusted_sign_in
|
||||
|
||||
# Check absence due to missing sign_out
|
||||
if adjusted_sign_in and not item.has_sign_out:
|
||||
current_time = fields.Datetime.now().hour
|
||||
if calendar.end_sign_in > 0 and (current_time - adjusted_sign_in < calendar.end_sign_in):
|
||||
item.is_absent = True
|
||||
item.total_absent_hours = working_hours - (current_time - adjusted_sign_in)
|
||||
# # Check absence due to missing sign_out
|
||||
# if adjusted_sign_in and not item.has_sign_out:
|
||||
# current_time = fields.Datetime.now().hour
|
||||
# if calendar.end_sign_in > 0 and (current_time - adjusted_sign_in < calendar.end_sign_in):
|
||||
# item.is_absent = True
|
||||
# item.total_absent_hours = working_hours - (current_time - adjusted_sign_in)
|
||||
|
||||
# Handle absence due to insufficient working hours
|
||||
if item.has_sign_out and adjusted_sign_out - adjusted_sign_in < working_hours:
|
||||
|
|
|
|||
Loading…
Reference in New Issue