Skip to content

app.invoices

TableRow level security on

Invoices issued to clients (Receivable) and received from vendors (Payable). Totals and balances are derived (app.invoice_totals). A closed production refuses new invoices (invariant 10).

Primary key: id

Columns of app.invoices
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org, derived from app.projects on insert; never accepted from the caller and never changed.References app.organizations.id
project_iduuidNoProject the invoice belongs to.References app.projects.id
directionapp.money_directionNoReceivable (we bill) or Payable (we are billed).
counterparty_iduuidYesClient billed or vendor billing; NULL when a person engaged as an individual is the payee.References app.counterparties.id
invoice_numbertextYesInvoice number: ours for a receivable, the vendor's identifier for a payable.
issued_ondateYesDate the invoice was issued.
due_ondateYesDate payment is due.
currency_codecharacter(3)NoISO 4217 currency of the invoice.References private.currencies.currency_code
invoice_stateapp.invoice_stateNoInvoice state. Changes only through the invoice RPCs.
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id
payee_person_iduuidYesPerson billing as an individual (a payable for someone engaged with no company account). Exactly one of counterparty_id and payee_person_id is set.References app.people.id
engagement_iduuidYesEngagement the invoice bills, when it bills one; always set for a person payee.References app.engagements.id