v_ai_ledger_lines¶
General ledger: every debit/credit posting line the accounting system generates, for every transaction type. Accrual basis. amount is signed (debit positive, credit negative).
- Populated by: QuickBooks Online
Columns¶
| Name | Type | Nullable | Allowed values | Description |
|---|---|---|---|---|
id |
character varying |
No | — | Kipper's internal row id, not the accounting system's id (that is source_id, where the view has one). |
data_source_id |
character varying |
Yes | — | The entity (connected data source) this row belongs to. External IDs (source_id and the *_external_id columns) and company names are unique only within one entity, so join related rows on data_source_id as well as their external IDs. |
entry_date |
date |
Yes | — | Date the posting hit the ledger, taken from the transaction the line belongs to. |
account_external_id |
character varying |
Yes | — | ID of the account this line posts to, in the source system. Join to metadata.source_id where metadata_type = 'account'. |
account_name |
character varying |
Yes | — | Display name of the account this line posts to, denormalized from the source so account questions need no join. |
account_number |
character varying |
Yes | — | Chart-of-accounts number for the account, when the source reports one. |
amount |
numeric(18, 2) |
Yes | — | Signed posting amount in the home currency: positive for a debit, negative for a credit. Net activity is SUM(amount). |
posting_type |
character varying |
Yes | debit, credit |
Which side of the ledger this line posts to: 'debit' or 'credit'. |
source_txn_external_id |
character varying |
Yes | — | ID of the transaction this posting belongs to, in the source system. Join to transaction.source_id. |
txn_type |
character varying |
Yes | invoice, bill, payment, vendorpayment, salesreceipt, deposit, customerdeposit, prepayment, vendorprepayment, overpayment, vendoroverpayment, transfer, refundreceipt, creditmemo, vendorcredit, check, expense, creditcardexpense, creditcardcredit, journalentry, purchaseorder, salesorder, bom, bomrevision |
Kipper normalized type of the transaction this posting belongs to. Null when the source reports a transaction type Kipper does not model (e.g. Sales Tax Payment, Inventory Qty Adjust). |
doc_number |
character varying |
Yes | — | Document number of the transaction this posting belongs to (e.g. invoice number). |
company_name |
character varying |
Yes | — | Display name of the customer, vendor or employee on the transaction, denormalized from the source so party questions need no join. |
company_external_id |
character varying |
Yes | — | ID of the customer, vendor or employee on the transaction, in the source system. Join to company.source_id. |
description |
text |
Yes | — | Memo or description the source reports on this posting line. Per line, not inherited from the transaction, so it is null on lines that carry no memo. |
currency |
character varying |
Yes | — | Home currency code the amounts are expressed in (e.g. USD). |
Joins¶
Relationships this view takes part in. External IDs are unique only within one connected entity, so every external-ID join matches on data_source_id as well.
v_ai_ledger_lines.source_txn_external_id = v_ai_transactions_all.source_id AND v_ai_ledger_lines.txn_type = v_ai_transactions_all.type AND v_ai_ledger_lines.data_source_id = v_ai_transactions_all.data_source_idv_ai_ledger_lines.account_external_id = v_ai_metadata.source_id AND v_ai_ledger_lines.data_source_id = v_ai_metadata.data_source_idv_ai_ledger_lines.company_external_id = v_ai_companies.source_id AND v_ai_ledger_lines.data_source_id = v_ai_companies.data_source_id
Across entities¶
A workspace can hold several connected companies. A query run across all of them returns rows from each, and external IDs (source_id and the *_external_id columns) and company names are unique only within one entity — so match on data_source_id too whenever you join or group.