1.7 KiB
1.7 KiB
Hide Payroll Frequency from UI
Problem Context
The user requested to hide or remove the "Payroll Frequency" dropdown from the /hr/payroll-runs interface. Since different employees have different pay types (e.g., Daily, Monthly, Semi-Monthly) in the same run, having a single frequency field on the Payroll Run level is confusing and implies a conflict.
Goal
Remove the payroll_frequency selection from the user interface and handle it automatically on the backend to prevent user confusion.
Proposed Changes
Frontend (React/Inertia)
[MODIFY] resources/js/Pages/hr/payroll-runs/index.tsx
- Action: Remove the
payroll_frequencySelectfield from the Create Payroll Run modal. - Action: Remove the
payroll_frequencySelectfield from the Edit Payroll Run modal. - Action: Remove the "Payroll Frequency" column from the main data table view (if it exists).
Backend (Laravel)
[MODIFY] app/Http/Controllers/PayrollRunController.php
- Action: Update the
storeandupdatemethods. - Action: Remove
payroll_frequencyfrom the$request->validate()rules. - Action: Dynamically inject a default
payroll_frequency = 'semi-monthly'into the payload before creating or updating thePayrollRunmodel. Alternatively, dynamically calculate the frequency based on the days difference betweenpay_period_startandpay_period_end. - Action: Remove
payroll_frequencyfrom theexportCSV mapping andfileImportmapping to ensure consistency.
Verification
- Generate a new payroll run via the UI and confirm the frequency dropdown is completely gone.
- Verify that validation still passes and the database record is created successfully with the default/calculated frequency.