Merge pull request #3501 from expsa/calc_missing_punch
fix calc nissing punch
This commit is contained in:
commit
35fae92dc6
|
|
@ -126,11 +126,15 @@ class HrAttendanceReport(models.Model):
|
|||
working_hours = office_hours + permission_hours + mission_hours + mission_by_days_hours + leave_hours
|
||||
missed_hours = planed_hours - working_hours
|
||||
|
||||
|
||||
missing_punch_transactions = transactions.filtered(
|
||||
lambda t: (
|
||||
(t.sign_in and not t.sign_out) or
|
||||
(not t.sign_in and t.sign_out) or
|
||||
(not t.sign_in and not t.sign_out and t.office_hours > 0)
|
||||
not t.public_holiday and
|
||||
not t.normal_leave and
|
||||
(
|
||||
(t.sign_in and not t.sign_out) or
|
||||
(not t.sign_in and t.sign_out)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
@ -286,9 +290,20 @@ class HrAttendanceReport(models.Model):
|
|||
hours += attendance.official_hours
|
||||
extra_break_duration += attendance.break_duration
|
||||
additional_hours += attendance.additional_hours
|
||||
if (attendance.sign_in and not attendance.sign_out) or (
|
||||
not attendance.sign_in and attendance.sign_out):
|
||||
missing_punch_hours = attendance.plan_hours - attendance.official_hours
|
||||
|
||||
if (
|
||||
not attendance.public_holiday and
|
||||
not attendance.normal_leave and
|
||||
(
|
||||
(attendance.sign_in and not attendance.sign_out) or
|
||||
(not attendance.sign_in and attendance.sign_out)
|
||||
)
|
||||
):
|
||||
missing_punch_hours = (
|
||||
attendance.plan_hours - attendance.official_hours
|
||||
if attendance.plan_hours > attendance.official_hours
|
||||
else 0.0
|
||||
)
|
||||
|
||||
if attendance.is_absent:
|
||||
actual_absent_hours +=attendance.plan_hours
|
||||
|
|
|
|||
Loading…
Reference in New Issue