General ledger
GL Entry, Payment Ledger Entry and what a submit or cancel writes to them.
Every submitted voucher that touches money writes GL Entry rows. Nobody edits them by hand. A user's insert is refused with "Ledger entries are written by their voucher". You submit or cancel the voucher that wrote them.
The ledgers a voucher writes
| RecType | One row per | Read by |
|---|---|---|
| GL Entry | Account line of the voucher, with debit and credit in company, account and transaction currency | General Ledger, Trial Balance, the financial statements |
| Payment Ledger Entry | Line on a Receivable or Payable account. amount is positive when it raises the party's outstanding | Accounts Receivable and Payable, Payment Reconciliation |
| Advance Payment Ledger Entry | Payment Entry line paid in advance against a Sales or Purchase Order | The order's Advance Paid |
| Account Closing Balance | Account and cost center at a closed period's end | The financial reports. See Fiscal years and closing |
The Payment Ledger rows are written before the GL rows, in the voucher's own transaction.
Checks on every posting
Example
A Sales Invoice for 100 plus 18% tax, paid later by a Payment Entry, writes:
| Voucher | Account | Debit | Credit | Payment Ledger amount |
|---|---|---|---|---|
| Sales Invoice | Debtors - AT | 118 | +118 | |
| Sales Invoice | Sales - AT | 100 | ||
| Sales Invoice | Output Tax - AT | 18 | ||
| Payment Entry | Cash - AT | 118 | ||
| Payment Entry | Debtors - AT | 118 | -118 |
The customer's outstanding is the sum of the live Payment Ledger amounts, 0.
Cancelling a voucher
A submitted voucher is never deleted. Cancel it, then Amend to get a draft copy named <name>-1. How the cancel touches the ledgers depends on Accounts Settings' Enable Immutable Ledger.
The original rows are flagged is_cancelled, and mirror rows with debit and credit swapped are added, also flagged. Reports read only rows that are not cancelled, so the voucher disappears from them. Payment Ledger rows are set delinked and get negated delinked rows.
A cancelled Delivery Note that had posted 300:
| Account | Debit | Credit | is_cancelled |
|---|---|---|---|
| Cost of Goods Sold - AT | 300 | yes | |
| Stock In Hand - AT | 300 | yes | |
| Cost of Goods Sold - AT | 300 | yes | |
| Stock In Hand - AT | 300 | yes |
To rebuild a voucher's rows after a correction, use Repost Accounting Ledger.