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:
- 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).
- Refactored to chunked
NVARCHAR(MAX) appends — "B" error went away.
- 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.
- 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.
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_RTfromcaes_hcmods.PS_JOB_Vdirectly. 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— addHOURLY_RTto theLatestPositionCTE, the outer Oracle SELECT, and the temp table; final outer T-SQL SELECT exposesCASE WHEN pb.COMP_FREQUENCY = 'H' THEN pb.HOURLY_RT END AS HOURLY_RATEso the column is null for non-hourly employees.web/server/Models/PositionBudgetRecord.cs— add nullabledecimal? HourlyRatewith[JsonPropertyName(\"hourlyRate\")].web/client/src/queries/personnel.ts— addhourlyRate: number | nulltoPersonnelRecord.web/client/src/components/project/PersonnelTable.tsx— propagatehourlyRateinaggregateByPosition; render `{formatCurrency(hourlyRate)}/hr` under the monthly salary when present.web/client/src/test/components/PersonnelTable.test.tsx— addhourlyRate: nulltocreateRecordfixture.Where the deferred attempt got stuck
The SP modification triggered Oracle errors that were not the obvious "missing column" type:
NVARCHAR(MAX)appends — "B" error went away.OPENQUERYtoEXEC (@OracleQuery) AT [linked_server]to bypass the literal-string requirement and REPLACE doubling. Requiredremote proc transaction promotionset tofalseon the linked server (one-time DBA op) to clear theINSERT…EXECdistributed-transaction error.PS_JOB_VforHOURLY_RT, MONTHLY_RT, COMP_FREQUENCYwork 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 theEXEC ... ATand paste the result into a manualSELECT * FROM OPENQUERY(...)to let Oracle pinpoint where the parser chokes. Then walk the CTEs in isolation if needed.Acceptance
\${monthlySalary}with\${hourlyRate}/hrunderneath for hourly employees.