Skip to main content

Function: fetchStatementInvoices()

fetchStatementInvoices(svc, companyId, facilityId): Promise<SectionRead<StatementInvoiceRead>>

Defined in: src/db/queries/ar.ts:407

Every invoice this ONE facility has ever been sent, with the interest + period + stored-PDF fields the statement adds. Deliberately unfiltered on status: buildStatement owns which rows become lines (via the shared isOutstandingInvoice), so the statement can never disagree with the AR page about who owes what because a WHERE clause drifted.

Parameters​

svc​

SupabaseClient

companyId​

string

facilityId​

string

Returns​

Promise<SectionRead<StatementInvoiceRead>>