Skip to content

feat(hr): Oman leave types and TSI Salary Slip print format - #3

Merged
sayanthns merged 1 commit into
developfrom
feat/oman-leave-types-payslip
Nov 9, 2026
Merged

sayanthns merged 1 commit into
developfrom
feat/oman-leave-types-payslip

Conversation

@sayanthns

Copy link
Copy Markdown
Contributor

Why

TSI Oman asked for leave types matching their policy and a payslip that shows how salary is calculated: earnings on one side; attendance, leave and deductions on the other; a clear net salary summary.

What

Oman leave types (oman_leave.py, Royal Decree 53/2023)

  • Annual 30 days (after 6 months, carry-forward capped at 30)
  • Sick leave as four tiers (21 / 14 / 35 / 112 days at 100 / 75 / 50 / 35% pay = 182 days)
  • Maternity 98, paternity 7, marriage 3, bereavement 10 / 3 / 2, iddah 130 / 14, hajj 15, patient companion 15, exam 15, unpaid childcare
  • Seeded by patch create_oman_leave_types and after_install. Create-only: an existing Leave Type is never touched, so a migrate cannot overwrite what HR changes on the live site. Not shipped as fixtures for that reason.

TSI Salary Slip print format (tsi/print_format/tsi_salary_slip/)

  • Left: earnings, full month vs this month
  • Right: attendance (working, absent, unpaid, paid days), leave taken by type with pay note, deductions
  • Bottom: full salary → unpaid-day adjustment → gross → deductions → net
  • Leave taken comes from payslip.get_leave_taken (Jinja method): approved Leave Applications clipped to the slip period, so leave spanning two months is split correctly.

Testing

  • bench --site tsi.local run-tests --module tsi_custom.tests.test_payslip: 7 passed
  • Demo slip on tsi.local (Oct 2026, 21 working days, 1 LWP + 2 days sick at 75%): paid days 19.5, gross 928.57, net 834.00 OMR. Rendered and checked as PDF.

Not covered / for review

  • HR picks the sick-pay tier per application; not automatic.
  • Omani-only, once-in-service and gender conditions are not enforced.
  • Annual leave excludes holidays; client to confirm.
  • Entitlements taken from decree.om and Khaleej Times summaries, not the decree text.

Deploy

bench --site <site> migrate (runs the patch, syncs the print format). Then set "TSI Salary Slip" as default print format for Salary Slip if wanted.

🤖 Generated with Claude Code

Leave types (Royal Decree 53/2023): annual, four sick-pay tiers
(100/75/50/35%, 182 days), maternity, paternity, marriage, bereavement,
iddah, hajj, patient companion, exam, unpaid childcare. Seeded by a
patch and after_install, create-only, so HR edits on the live site are
never overwritten by a migrate.

TSI Salary Slip print format: earnings (full month vs this month) on
the left; attendance, leave taken by type and deductions on the right;
summary showing how net pay is reached. Leave taken is rebuilt from
approved Leave Applications clipped to the slip period, exposed to
Jinja as get_leave_taken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sayanthns
sayanthns merged commit 40046c9 into develop Nov 9, 2026
1 of 3 checks 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.

1 participant