Skip to main content

Interface: InvoicePreview

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

A computed-but-unpersisted invoice for one facility and one billing week, returned by buildInvoicePreview for the review/confirm UI. All money is integer USD cents.

The billing week is the unified Mon–Sun week (ADR-0044): period.start is the Monday weekStart and period.end is weekStart + 6 (the Sunday, inclusive), both as ISO YYYY-MM-DD strings. Each line bills the lesser of actual vs contracted hours unless that line's overage was approved (see InvoicePreviewLine).

Properties​

anyVarianceFlagged​

readonly anyVarianceFlagged: boolean

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


dueDateLabel​

readonly dueDateLabel: string

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


existingInvoice​

readonly existingInvoice: { number: string; status: string; } | null

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

Set when a non-void invoice already exists for this facility+week.


facilityId​

readonly facilityId: string

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


facilityName​

readonly facilityName: string

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


issueDateLabel​

readonly issueDateLabel: string

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


lines​

readonly lines: InvoicePreviewLine[]

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


period​

readonly period: object

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

Unified Mon–Sun billing week as inclusive ISO YYYY-MM-DD bounds: start = Monday, end = Monday + 6 (Sunday).

end​

end: string

start​

start: string


thresholdPct​

readonly thresholdPct: number

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


totalCents​

readonly totalCents: number

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