Skip to main content

Interface: InvoicePreviewLine

Defined in: src/server/services/invoice/generate.ts:72

One service line of an InvoicePreview (mirrors a prospective invoice_line_items row), one per contractor (its latest/chosen assignment). Money is integer USD cents; hours are decimal.

Billing rule: billedHours = min(actualHours, contractedHours) and amountCents = round(billedHours × hourlyRateCents). If the line's overage was approved for this week, the cap is lifted and the full actualHours is billed instead (and varianceFlagged is suppressed).

Properties​

actualHours​

readonly actualHours: number

Defined in: src/server/services/invoice/generate.ts:82

Hours actually worked this week, summed from payable time entries (rounded to 2 dp).


amountCents​

readonly amountCents: number

Defined in: src/server/services/invoice/generate.ts:87

Line total in integer USD cents (round(billedHours × hourlyRateCents)).


assignmentId​

readonly assignmentId: string

Defined in: src/server/services/invoice/generate.ts:74


billedHours​

readonly billedHours: number

Defined in: src/server/services/invoice/generate.ts:84

The quantity actually billed = min(actual, contracted), or full actual when overage is approved.


contractedHours​

readonly contractedHours: number

Defined in: src/server/services/invoice/generate.ts:80

Weekly contracted hours from the assignment (the default billing cap).


contractorId​

readonly contractorId: string

Defined in: src/server/services/invoice/generate.ts:73


contractorName​

readonly contractorName: string

Defined in: src/server/services/invoice/generate.ts:75


description​

readonly description: string

Defined in: src/server/services/invoice/generate.ts:78

Human-readable line label (service type + contractor + period), as printed on the PDF.


hourlyRateCents​

readonly hourlyRateCents: number

Defined in: src/server/services/invoice/generate.ts:85


serviceType​

readonly serviceType: string | null

Defined in: src/server/services/invoice/generate.ts:76


varianceFlagged​

readonly varianceFlagged: boolean

Defined in: src/server/services/invoice/generate.ts:91

True when variancePct exceeds the facility threshold and overage was NOT approved — a review signal, not a block.


variancePct​

readonly variancePct: number

Defined in: src/server/services/invoice/generate.ts:89

Percent by which actual hours differ from contracted (used to drive varianceFlagged).