# Separate salary and variable periods

- `period_start` / `period_end` remain the salary period and payroll identity (including waivers, exports and approval).
- `variables_start` / `variables_end` record the inclusive attendance-variable cycle. Both dates are required in the creation form; the end cannot exceed the salary-period end.
- Salary, fixed allowances, insurance proration and advance installments use the salary period. Attendance shortage, absence, leave, permissions, deputation, overtime and violations use the variable cycle.
- Each employee's variable cycle starts no earlier than their employment start date. An employee joining after cutoff can receive prorated salary without variable deductions in that payroll.
- Salary uses the existing configured daily denominator (default 30). Payable days are inclusive calendar days within the selected salary period after employment begins, capped at that denominator. No automatic change of the selected ending date is made. Selecting October 1–30 and joining October 18 therefore gives 13/30; selecting October 1–31 gives 14/30.
- The days column now means salary-entitlement days, before attendance deductions. Variable absence days are separate and must not be subtracted from salary-entitlement days again.
- Overlapping variable cycles across different payslips are allowed. Each payroll independently calculates its selected cycle; there is no cross-payroll event deduplication. Regenerating the same salary period updates its existing draft; approved/locked periods remain protected.
- Old payslips fall back to their original salary dates as the variable cycle. They are not automatically recalculated or migrated into a different salary period.

## Deployment

Deploy the additive migration `2026_11_02_000001_add_variables_period_to_payslips` before using the updated page. Run migrations through the normal deployment process, never through the read-only analysis connection.

Review existing drafts before creating a replacement monthly payroll. Changing the period selection does not recalculate saved payrolls until Generate is explicitly invoked. Overlapping cycles can include the same event in more than one payroll.

For October's example choose salary October 1–30 and variables September 26–October 25. For November choose the November salary period and variables October 26–November 25. Events after October 25 stay outside October's calculation and enter November when its cycle is generated; no attendance records are moved or duplicated.

Time data remains literal 24-hour time: `02:00–05:00` is not automatically converted to `14:00–17:00`. This feature does not repair incorrectly entered permission times.
