app.invoice_matches
TablaSeguridad a nivel de fila activa
Three-way matches of a payable invoice to a purchase order and a goods receipt (invariant 17). A receipt matches one invoice once; the variance is derived in app.invoice_match_results, and a payable invoice with an unresolved mismatch is never approved.
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.invoices on insert; never accepted from the caller and never changed.Hace referencia a app.organizations.id |
| invoice_id | uuid | No | Payable invoice matched.Hace referencia a app.invoices.id |
| purchase_order_id | uuid | No | Purchase order the invoice bills.Hace referencia a app.purchase_orders.id |
| goods_receipt_id | uuid | No | Receipt of that order the invoice bills. A receipt is matched once.Hace referencia a app.goods_receipts.id |
| resolution_note | text | Sí | Why a mismatch is accepted, recorded by someone other than the matcher. |
| resolved_by | uuid | Sí | Person who accepted the mismatch.Hace referencia a app.people.id |
| resolved_at | timestamp with time zone | Sí | When the mismatch was accepted. |
| 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 |