Repository navigation
Conversation
|
Hi @appstogrow, @nimarosa, |
|
Please squash the lint fixes. In these cases it is better to amend the commit than adding a new one. |
644e1d6 to
0f81b8a
Compare
|
The code is hard to read, and does not make the intent clear. Also, this was probably assisted by AI, so mind the "Assisted-by:" required trailer line on the commit. |
Intersect payslip dates with the effective employment version before computing work and leave. Use calendar-local midnight endpoints so the last paid date and daylight-saving transitions remain included correctly. Keep an explicit zero WORK100 row when the version does not overlap. Separate this interval policy into a named, documented helper, as requested in review. Existing partial-month, end-date, version, night-calendar and DST cases continue to pass in the 35-test native payroll suite. Assisted-by: OpenAI Codex
0f81b8a to
b97a098
Compare
|
Addressed the clarity review: the date/version intersection and calendar-local exclusive endpoints now have a named helper with the intent documented. The explicit zero WORK100 explains why a non-overlapping version must not fall back to full pay. All 35 native payroll tests still pass, including partial employment, version boundaries, night calendars and DST; Ruff check/format also pass. The single commit now includes the required Assisted-by trailer. |
Generated WORK100 and leave lines currently stop only at the effective start date. For a version ending on 15 March 2027, a fixed Mon–Fri 8 h calendar produces 184 hours for March instead of 88. Country salary rules prorating the monthly wage from these lines consequently overstate the basic wage.
Clamp both boundaries using the effective hr.version dates, including the next version boundary. Resolve calendar dates in the resource calendar timezone, and emit an explicit zero WORK100 when the intervals do not overlap. Reuse the existing worked-time and leave helpers and retain normal record/field access checks.
Validation: clean native payroll suite: 35 tests, 0 failures/errors. Coverage includes hire/end in the same month, open employment, no overlap, calendar-local midnight and a DST month, payroll-officer access, refusal for an unrelated internal user, successive versions, and approved leave after employment ends. An independent Slovak integration also verifies partial monthly wage amounts and balanced native accounting entries for day/night calendars.
The scope is generated per-version worked time. Consolidating salary and statutory bases across multiple wage/insurance versions is a separate consumer workflow.
The README fragment is updated; the OCA README generator is unavailable in this environment, so generated README output has not been claimed as validated.