Repository navigation
apply half day configuration at leave application - #289
Merged
sonalimandarnarkar merged 5 commits intoOct 9, 2026
Merged
sonalimandarnarkar merged 5 commits into
sonalimandarnarkar merged 5 commits into
Conversation
alibaig4u
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parent : https://git.phamos.eu/suncycle/suncycle/-/work_items/2156
Issue : https://git.phamos.eu/suncycle/suncycle/-/work_items/2745
Description :
Leave Application now applies the Half Day Holidays list from HR Addon Settings. HRMS still counts the range, full holidays, and one half day. The addon adds the remaining half-day holidays.
Day count
get_half_day_holiday_dates()reads HR Addon Settings > Half Day Holidays for the leave range. A date already on the employee holiday list is skipped when the leave type does not include holidays.HrAddonLeaveApplication.validate()setshalf_dayandhalf_day_dateto the earliest of those dates, then calls HRMS validation. HRMS counts that one date as 0.5 and removes full holidays.reduce_leave_days_for_half_day_holidays()then subtracts 0.5 for every other half-day holiday, and that value is stored intotal_leave_days. The leave ledger deducts this saved total.For 24.12–31.12, with 25.12–27.12 on the holiday list and 24.12 and 31.12 as half-day holidays, the total is 4. Half Day Date stays 24.12.
Form
On refresh and when From Date or To Date changes,
leave_application.jscallsget_first_half_day_holidayand fills Half Day and Half Day Date. It then callsget_total_leave_days, which runs the HRMS count and the same 0.5 reduction, and sets Total Leave Days.get_half_day_holiday_in_leaveis the same lookup, kept so an already open form does not fail.Tests and CI
hr_addon/tests/test_custom_leave_application.pycovers two half-day holidays reducing 5 days to 4, no second reduction for the date already marked half day, no change when the range has none, and the earliest date as Half Day Date..github/workflows/workday-tests.ymlruns that module after the Workday tests, including pull requests intosuncycle_version_15_1.