Dentolize · Expense & Salary Date Permissions Walkthrough
On this pageBusiness viewTechnical view

Salary adjustment dates

Business view

Salary adjustments (bonuses and deductions in the Salary Hub) work under the same rule as expenses, with their own independent permission — a group can have one without the other.

  • Adding a new salary adjustment — without the **Salary Hub: Change

Creation Date** permission, the adjustment is filed under today. With it, the user can pick any date.

  • Editing an existing salary adjustment — without the permission, the

date field is disabled and the record keeps whatever date it already had. With it, the date can be moved.

Why it matters here specifically: salary adjustments feed payroll reporting, so a bonus dated into the wrong pay period can throw off a salary report for a month that's already been closed out. Restricting who can move that date protects the reports without preventing HR staff from doing everyday adjustments (add, edit amount, change type) — only the date is gated.

Technical view

The permission

SALARY_ADJUSTMENT_CREATED_AT — see Granting the permission for how it's assigned.

addNewSalaryAdjustment

/work/repo/packages/server/src/resolvers/mutations/actions/addNewSalaryAdjustment.js:12-14:

date: getPermittedDate(args, request, 'SALARY_ADJUSTMENT_CREATED_AT') || dayjs().toDate(),

Same pattern as addNewExpense: no permission → today.

editSalaryAdjustment

/work/repo/packages/server/src/resolvers/mutations/actions/editSalaryAdjustment.js:23-25:

date: getPermittedDate(args, request, 'SALARY_ADJUSTMENT_CREATED_AT'),

Same pattern as editExpense: no permission → undefined → Prisma leaves the existing date untouched.

Both resolvers use the same getPermittedDate helper documented in Expenses/work/repo/packages/server/src/utils/helpers.js:2560.

Web form (clinic-web)

SalaryAdjustmentForm.js/work/repo/packages/clinic-web/src/components/dashboard/logs/SalaryAdjustments/SalaryAdjustmentForm.js:243-258: the date Form.Item is wrapped in an antd Tooltip, and the MomentDatePicker gets disabled={!user.permissions.salaryAdjustmentCreatedAt}.

Mobile form (clinic-mobile)

NewSalaryAdjustmentScreen.js/work/repo/packages/clinic-mobile/src/components/dashboard/finances/salaryAdjustments/NewSalaryAdjustmentScreen.js:209-220: passes disabled={!user.permissions.salaryAdjustmentCreatedAt} and the permission-denied help text to the shared DateField.

Front-end permission flag

/work/repo/packages/clinic-mobile/src/shared/utils/getUserPermissions.js:335:

salaryAdjustmentCreatedAt: hasFrontendPermission(['SALARY_ADJUSTMENT_CREATED_AT'], user),

What's unchanged

Viewing, adding, editing (non-date fields), and deleting salary adjustments still go through the existing VIEW_SALARY_ADJUSTMENT / ADD_SALARY_ADJUSTMENT / EDIT_SALARY_ADJUSTMENT / DELETE_SALARY_ADJUSTMENT permissions, untouched by this PR. SALARY_ADJUSTMENT_CREATED_AT only ever narrows the date field specifically.