general_ledger_revision
In short
General ledger. This table includes all the bookkeeping entries of the company.
The general ledger includes all the bookkeeping entries of the company, at the most granular level.
By design, this table is one of the heaviest of the Pennylane data model, so make sure your queries are optimized before using it in production.
Filter key(s)
company_id
Sorting key
ClickHouse skips blocks only when the filter starts with this key, in this order. When the first column is `company_id`, put `company_id` in every query. Read a fleet one company at a time, or in batches of `company_id`. Do not run one query with no company filter. List only the columns you need. `SELECT *` reads columns you will not use.
company_id, id
Secondary index
This index helps a little after `company_id` is filtered. It does not replace the sorting key.
date(minmax)
Available columns
id
Int64
Unique ID of the ledger event on Pennylane.
company_id
Int64
Unique ID of the company on Pennylane, referring to companies.id.
company_name
String
Company's display name on Pennylane.
date
Date
Date of the ledger event, in YYYY-MM-DD format.
lettering
Nullable(Int64)
In case the ledger event is part of a lettered group of events, lettering is a unique ID for the group.
Examples: 350 312 715, 344 963 571
label
Nullable(String)
Label of the bookkeeping entry if any, defaulting to the label of the document attached to the entry, for example an invoice or a bank transaction.
Examples: "Facture XYZ - F-2023-06-345", "URSSAF d'Ile de France (123456789)"
debit
Nullable(Decimal(18, 4))
Bookkeeping entry amount in case of debits.
credit
Nullable(Decimal(18, 4))
Bookkeeping entry amount in case of credits.
plan_item_number
Nullable(String)
A plan_item describes an entry of the company's accounting plan.
The plan_item_number is the standard account number identifying the plan item. Note: multiple accounts with different VAT rates can hold the same number.
Examples: "411008", "445710", "512001"
plan_item_label
Nullable(String)
Label of the account.
Examples: "Capital", "TVA déductible sur autres biens et services", "Achats de marchandises"
journal_code
LowCardinality(Nullable(String))
Short code identifying the journal the bookkeeping entry belongs to.
Examples: "VT", "HA", "OD", "BQ"
journal_label
Nullable(String)
Label of the journal the bookkeeping entry belongs to.
Examples: "Journal des ventes", "Journal des achats", "Journal de trésorerie"
document_id
Nullable(Int64)
ID of the document (invoice, bank transaction, addendum, etc) associated with the bookkeeping entry.
document_label
Nullable(String)
Label of the document (invoice, bank transaction, addendum, etc) associated with the bookkeeping entry.
Examples: "Facture XYZ - F-2023-06-345", "Virement émis ABCD"
invoice_number
Nullable(String)
Invoice number, in case the document attached to the bookkeeping entry is an invoice.
Examples: "F-2023-06-345", "F-2023-06-346"
fec_pieceref
Nullable(String)
Piece reference used in the FEC export.
thirdparty_id
Nullable(Int64)
A thirdparty represents a supplier or a customer of the company managed on Pennylane. Third parties can be both legal entities or individuals. The thirdparty_id is the unique identifier of the third party on Pennylane, and refers to suppliers.id or customers.id depending on the type of third party.
If the bookkeeping entry is associated with a third party, thirdparty_id is its ID.
Otherwise, thirdparty_id is inherited from the document associated with the bookkeeping entry in case of 4xx (invoices) and 5xx (bank transactions) accounts.
thirdparty_plan_item_number
Nullable(String)
Third party's 401/411 account number in the accounting plan.
Examples: "401100024", "411NORAUTO"
thirdparty_plan_item_label
Nullable(String)
Third party's account label in the accounting plan.
Examples: "John Doe", "Norauto"
invoice_link
Nullable(String)
Link to the invoice on the Pennylane app, in case the document attached to the bookkeeping entry is an invoice.
document_created_at
Nullable(DateTime64(6, 'UTC'))
Creation date of the document associated with the bookkeeping entry.
document_updated_at
Nullable(DateTime64(6, 'UTC'))
Last update date of the document associated with the bookkeeping entry.