Skip to content

skip holiday ole creation - #281

Merged
sonalimandarnarkar merged 1 commit into
suncycle-version-15from
suncycle/suncycle#2409_v15_suncycle
Jun 25, 2026
Merged

sonalimandarnarkar merged 1 commit into
suncycle-version-15from
suncycle/suncycle#2409_v15_suncycle

Conversation

@sonalimandarnarkar

@sonalimandarnarkar sonalimandarnarkar commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Parent : https://git.phamos.eu/suncycle/suncycle/-/issues/2409
Issue : https://git.phamos.eu/suncycle/suncycle/-/work_items/2415

Description :

This pull request introduces logic to correctly handle "On Leave" status for employees on holidays or non-working days, ensuring that leave records and attendance are managed consistently and preventing the creation of inappropriate overtime ledger entries. It also adds comprehensive unit tests for these scenarios.

Workday status and leave/holiday handling:

  • Added logic in Workday.update_status to revert the status from "On Leave" or "Half Day" to "Not Workday" if the leave does not include holidays and the day is a non-working day, with supporting methods for determining non-working days and updating/cancelling related attendance records. [1] [2]
  • Introduced helper methods: _active_leave_includes_holiday, _should_revert_leave_to_not_workday, _apply_holiday_not_workday_fields, and _cancel_leave_attendance_on_non_working_day to encapsulate and clarify the logic for handling holidays, leave, and attendance. [1] [2] [3]

Testing improvements:

  • Added a new test class TestWorkdayHolidayLeaveOverride to verify that the status reverts to "Not Workday" and that attendance creation is skipped for non-working days, including appropriate use of mocks and patching.
  • Updated imports in test_workday.py to include the Workday class for direct testing.

These changes ensure that leave and attendance logic respects holidays and non-working days, preventing incorrect overtime ledger entries and maintaining data integrity.

@sonalimandarnarkar
sonalimandarnarkar merged commit 11b156b into suncycle-version-15 Jun 25, 2026
1 check passed
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.

2 participants