Payroll / Timesheet — Data & read/write tables
Database view + external concepts that Payroll/Timesheet reads/writes. Convention: 📖 READ, ✏️ WRITE (insert/update).
Read/write data
| Area | Data |
|---|---|
| Payroll settings | BusinessUnitSetting.DefaultPaidHoursOptionId 📖 READ on form load; ✏️ WRITE when saving (route /api/BusinessUnitSetting/Payroll, SettingFinance permission). |
| Staff Attendance shift creation | OrgEmployee ✏️ WRITE when an active link is missing (auto-fix); 📖 READ to resolve/reuse. |
| Link on shift | Shift.OrgEmployeeId ✏️ WRITE, assigned to the ensured OrgEmployee. |
| Shift row status | Shift.TimesheetStatusId, Shift.Exported ✏️ WRITE (approve/un-approve/export/un-export). |
| Leave-only row status | EmployeeAbsence.TimesheetStatusId, EmployeeAbsence.Exported ✏️ WRITE — a leave-only row uses the status on the absence itself. |
| Leave-only source | EmployeeAbsence 📖 READ — Date, TimeStart/TimeEnd, tracking code, approved lifecycle. |
| Leave overlap | EmployeeAbsence 📖 READ, interval-intersected with Shift to compute Leave Hours + leave Tracking Code. |
| Tracking code | TrackingCode / ShiftTrackingCode 📖 READ — Tracking Code (shift) and (leave) columns in export. |
| Export dataset | Shift + EmployeeAbsence 📖 READ re-queried by id under BU/org scope. |
Other data sources
| Source | Role |
|---|---|
| jsReport Reporting Server | Renders the template per ReportCode → CSV stream; the backend builds the dataset + pre-formats first. |
| SettingFinance permission | Boundary for writing payroll settings; DefaultPaidHoursOptionId is not writable through a route lacking permission. |
| STAFF_ROSTER | Gates display/protection of the Payroll tab in Finance Settings. |
Data from other domains
| Domain | What Payroll/Timesheet reads it for |
|---|---|
| Staff | Shift, EmployeeAbsence, tracking code, time tracking (ShiftClock) — timesheet row sources. |
| Master Data | Employee / OrgEmployee — staff–site link for Shift.OrgEmployeeId; auto-links staff on creation. |
| Finance | Settings → Finance — where the Payroll tab is attached (after Subsidy Settings). |
Related
- Architecture & data — server-side export flow, column contract, guardrails.
- Staff — roster, leave, and tracking code.