app.journal_lines
TableRow level security on
Lines of a journal entry: one account, dimension 1 and 2, and either a debit or a credit. Immutable once the entry is posted. Posted lines are the Universal Posting Line (app.posting_lines).
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.journal_entries on insert; never accepted from the caller and never changed.References app.organizations.id |
| journal_entry_id | uuid | No | Entry the line belongs to.References app.journal_entries.id |
| line_number | integer | No | Order of the line within the entry. |
| account_code | text | No | GL account from the fixed chart (Bible tab 29).References xpms.dim_gl_account.account_code |
| cost_center_id | uuid | Yes | Dimension 1 cost center.References app.cost_centers.id |
| urid | text | Yes | Dimension 2: canon discipline or category. |
| counterparty_id | uuid | Yes | Vendor or client the line concerns; NULL for revenue without one.References app.counterparties.id |
| element_id | text | Yes | Catalog element, when one applies.References xpms.elements.element_id |
| description | text | No | Sentence-case line description. |
| quantity | numeric | Yes | Quantity, when the line counts something. |
| unit_basis | text | Yes | Unit of the quantity from the controlled unit list.References xpms.dim_unit_alias.alias |
| debit_minor | bigint | No | Debit amount in minor units; zero on a credit line. |
| credit_minor | bigint | No | Credit amount in minor units; zero on a debit line. |
| currency_code | character(3) | No | ISO 4217 currency of the line.References private.currencies.currency_code |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Yes | Person who inserted the row, or null for a platform process. Set by the database.References app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Yes | Person who last changed the row, or null for a platform process. Set by the database.References app.people.id |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |