Skip to content

[FIX] ATTENDANCE: Monthly summary leaves out employees without a shift who never attended - #1431

Open
adamsthws wants to merge 1 commit into
horilla:dev/v2.0from
LBS-Sheet-Metal:fix/summary-skip-no-shift-employees
Open

adamsthws wants to merge 1 commit into
horilla:dev/v2.0from
LBS-Sheet-Metal:fix/summary-skip-no-shift-employees

Conversation

@adamsthws

Copy link
Copy Markdown
Contributor

Problem

Employees with no shift (typically salaried staff who never clock in) are listed on every view of the Monthly Attendance Summary (list, day-wise grid and summary dashboard) and in its XLSX export, absent on every working day. On a company with a few such people, the absences, attendance percentages and "low attendance" findings are dominated by people who were never expected in.

Fix

The summary now lists the same people the dashboards expect in, using expected_employee_ids from #1280: employees with a shift, plus anyone without one who has attendance in the chosen range (so someone without a shift who does clock in still appears, with their real days).

  • Applied to the table view (all three views) and the export.
  • Someone picked by name (the Employee filter, or rows selected for export) is still listed whatever their shift.

Tests

  • attendance/tests/test_summary_no_shift_employees.py (3 tests): someone without a shift who never attended is left out of the list, day-wise view and export; one who attended is listed; one picked by name is listed. They fail on the current code and pass with the fix.
  • The fixtures in test_daily_view.py and test_summary_group_by.py now give their employee a shift: those tests render an employee with no attendance and expect to see them.

Checklist

  • This PR targets dev/v2.0, not 2.0.
  • I've followed the coding conventions in CONTRIBUTING.md (Black + isort via the repo's pre-commit)
  • CI (Docker CI + Quality) passes
  • I've linked any related issues

Related issues

Follows #1280 (the same rule on the dashboards).

…t who never attended

Employees with no shift (typically salaried managers who don't clock in) were
listed on every view of the monthly summary and its export as absent on every
working day. The summary now lists the same people the dashboards expect in
(expected_employee_ids, horilla#1280): employees with a shift, plus anyone without one
who has attendance in the range. Someone picked by name is still listed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant