cardinal
Accounting

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

RecTypeOne row perRead by
GL EntryAccount line of the voucher, with debit and credit in company, account and transaction currencyGeneral Ledger, Trial Balance, the financial statements
Payment Ledger EntryLine on a Receivable or Payable account. amount is positive when it raises the party's outstandingAccounts Receivable and Payable, Payment Reconciliation
Advance Payment Ledger EntryPayment Entry line paid in advance against a Sales or Purchase OrderThe order's Advance Paid
Account Closing BalanceAccount and cost center at a closed period's endThe 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

Each line needs a fiscal year for its posting date, and a Profit and Loss line needs a cost center.
A line on a Receivable or Payable account needs Party Type and Party. A party is refused on any other account except Equity.
A line needs a debit or a credit. Profit and Loss accounts are refused in an opening entry.
The account's currency must match the line's account currency.
Debit must equal credit. A difference up to 0.5 (or 5 in the last decimal place for Journal and Payment Entries) goes to the Company's Round Off Account and Round Off Cost Center. A larger one fails with "Debit and Credit not equal".
The posting date must be after the Company's Accounts Frozen Till Date, outside a closed Accounting Period, and after the last submitted Period Closing Voucher.

Example

A Sales Invoice for 100 plus 18% tax, paid later by a Payment Entry, writes:

VoucherAccountDebitCreditPayment Ledger amount
Sales InvoiceDebtors - AT118+118
Sales InvoiceSales - AT100
Sales InvoiceOutput Tax - AT18
Payment EntryCash - AT118
Payment EntryDebtors - AT118-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:

AccountDebitCreditis_cancelled
Cost of Goods Sold - AT300yes
Stock In Hand - AT300yes
Cost of Goods Sold - AT300yes
Stock In Hand - AT300yes

To rebuild a voucher's rows after a correction, use Repost Accounting Ledger.

On this page