app.invoices
TablaSeguridad a nivel de fila activa
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).
Clave primaria: id
| Columna | Tipo | Admite nulos | Descripción |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.projects on insert; never accepted from the caller and never changed.Hace referencia a app.organizations.id |
| project_id | uuid | No | Project the invoice belongs to.Hace referencia a app.projects.id |
| direction | app.money_direction | No | Receivable (we bill) or Payable (we are billed). |
| counterparty_id | uuid | Sí | Client billed or vendor billing; NULL when a person engaged as an individual is the payee.Hace referencia a app.counterparties.id |
| invoice_number | text | Sí | Invoice number: ours for a receivable, the vendor's identifier for a payable. |
| issued_on | date | Sí | Date the invoice was issued. |
| due_on | date | Sí | Date payment is due. |
| currency_code | character(3) | No | ISO 4217 currency of the invoice.Hace referencia a private.currencies.currency_code |
| invoice_state | app.invoice_state | No | Invoice state. Changes only through the invoice RPCs. |
| deleted_at | timestamp with time zone | Sí | Soft delete time. A row with deleted_at set is ignored by every access helper. |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Sí | Person who inserted the row, or null for a platform process. Set by the database.Hace referencia a app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Sí | Person who last changed the row, or null for a platform process. Set by the database.Hace referencia a app.people.id |
| payee_person_id | uuid | Sí | Person billing as an individual (a payable for someone engaged with no company account). Exactly one of counterparty_id and payee_person_id is set.Hace referencia a app.people.id |
| engagement_id | uuid | Sí | Engagement the invoice bills, when it bills one; always set for a person payee.Hace referencia a app.engagements.id |