Skip to content

Add hourly rate display for hourly employees in personnel report #248

@rmartinsen-ucd

Description

@rmartinsen-ucd

Spun out of #224 — deferred from PR #247 because the SQL changes were not landing cleanly.

Goal

On the personnel report, hourly employees (those with COMP_FREQUENCY = 'H' in PS_JOB_V) should show their hourly rate alongside the monthly salary in the personnel table cell.

Source-of-truth note

Use HOURLY_RT from caes_hcmods.PS_JOB_V directly. Do not compute hourly from monthly (e.g. MONTHLY_RT / 173.33) — the column exists and is the authoritative value.

Files touched in the deferred attempt (all reverted at the tip of main)

  • datamart/StoredProcedures/usp_GetPositionBudgets.sql — add HOURLY_RT to the LatestPosition CTE, the outer Oracle SELECT, and the temp table; final outer T-SQL SELECT exposes CASE WHEN pb.COMP_FREQUENCY = 'H' THEN pb.HOURLY_RT END AS HOURLY_RATE so the column is null for non-hourly employees.
  • web/server/Models/PositionBudgetRecord.cs — add nullable decimal? HourlyRate with [JsonPropertyName(\"hourlyRate\")].
  • web/client/src/queries/personnel.ts — add hourlyRate: number | null to PersonnelRecord.
  • web/client/src/components/project/PersonnelTable.tsx — propagate hourlyRate in aggregateByPosition; render `{formatCurrency(hourlyRate)}/hr` under the monthly salary when present.
  • web/client/src/test/components/PersonnelTable.test.tsx — add hourlyRate: null to createRecord fixture.

Where the deferred attempt got stuck

The SP modification triggered Oracle errors that were not the obvious "missing column" type:

  1. ORA-00904 "B" initially — diagnosed as T-SQL string-concat truncation on the Oracle query being passed to OPENQUERY (single quote doubling pushed the composed literal past the OLE DB provider's threshold).
  2. Refactored to chunked NVARCHAR(MAX) appends — "B" error went away.
  3. Switched from OPENQUERY to EXEC (@OracleQuery) AT [linked_server] to bypass the literal-string requirement and REPLACE doubling. Required remote proc transaction promotion set to false on the linked server (one-time DBA op) to clear the INSERT…EXEC distributed-transaction error.
  4. After all of that, ORA-01747 "invalid user.table.column" still reproduces. Direct queries against PS_JOB_V for HOURLY_RT, MONTHLY_RT, COMP_FREQUENCY work fine, so it's a structural issue in the modified Oracle SQL — not a permission or column-existence problem.

Suggested next step

Add a temporary SELECT @OracleQuery AS DEBUG; right before the EXEC ... AT and paste the result into a manual SELECT * FROM OPENQUERY(...) to let Oracle pinpoint where the parser chokes. Then walk the CTEs in isolation if needed.

Acceptance

  • Personnel table cell renders \${monthlySalary} with \${hourlyRate}/hr underneath for hourly employees.
  • For non-hourly employees, only monthly salary renders (HOURLY_RATE is null).
  • SP returns the new column without errors against prod-equivalent data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions