How transactions post to the ledger
ERPNext creates ledger entries when you submit a document. The document records what happened in the business. The ledger entries record its financial effect. This page explains which documents post, what they post, and how to trace an amount back to its source.
When a document affects the books
- A draft has no ledger effect.
- On submit, ERPNext validates the posting date, company, currency, accounts, cost centers, dimensions, and the debit and credit totals. Then it creates the entries.
- The Posting Date decides the accounting period. For stock documents, the Posting Time also sets the order used for stock valuation.
- On cancel, ERPNext reverses the entries. It does not delete the history. To correct a document, cancel it and amend it. Learn more about the immutable ledger.
The three ledgers
| Ledger | What it records | Common sources |
|---|---|---|
| General Ledger | Debit and credit amounts by account | Invoices, payments, journal entries, stock documents, assets, payroll |
| Payment Ledger | Receivable and payable references, allocations, and outstanding amounts | Invoices, payments, credit notes, journal entries with a party |
| Stock Ledger | Quantity, valuation rate, and stock value by Item and warehouse | Purchase Receipts, Delivery Notes, Stock Entries, invoices with Update Stock |
One document can post to more than one ledger. For example, a Sales Invoice with Update Stock records income and the receivable in the General Ledger, reduces stock in the Stock Ledger and the General Ledger, and creates the customer's outstanding amount in the Payment Ledger.
What common documents post
The tables show the normal pattern. The actual accounts come from the company, Item, Item Group, warehouse, party, and tax setup.
Sales Invoice
| Account | Debit | Credit |
|---|---|---|
| Customer receivable | Invoice total | |
| Income | Net sales | |
| Output tax | Tax amount |
The outstanding amount stays open until a payment, a credit note, or a write-off settles it. If Update Stock is selected, the invoice also debits cost of goods sold and credits the stock account at valuation cost. Without Update Stock, the Delivery Note posts the stock effect.
Purchase Invoice
| Account | Debit | Credit |
|---|---|---|
| Expense, asset, or Stock Received But Not Billed | Net purchase | |
| Input tax | Tax amount | |
| Supplier payable | Invoice total |
With perpetual inventory and a Purchase Receipt, the Purchase Invoice clears Stock Received But Not Billed instead of debiting stock again.
Payment Entry
- Receive: debits bank or cash and credits the customer receivable.
- Pay: debits the supplier payable and credits bank or cash.
- Internal Transfer: moves money between two bank or cash accounts.
The cash posting and the allocation are separate. One payment can settle one invoice, several invoices, part of an invoice, or stay unallocated as an advance. Use Payment Reconciliation to allocate an existing payment later without recording the money again.
Credit Note and Debit Note
A Credit Note is a return Sales Invoice. A Debit Note is a return Purchase Invoice. Each one reverses or reduces the sales or purchase, the tax, the party balance, and the stock effect of the original. Create it against the original invoice so that ERPNext updates the original's outstanding amount.
Journal Entry
A Journal Entry posts the debit and credit rows that you enter. Use it for accruals, provisions, reclassifications, write-offs, and other adjustments that no specific document covers. Do not use it in place of an invoice or a Payment Entry: those documents carry the party, taxes, items, due dates, and stock that a journal does not.
Delivery Note and Purchase Receipt
With perpetual inventory:
- A Delivery Note debits cost of goods sold and credits the warehouse's stock account.
- A Purchase Receipt debits the warehouse's stock account and credits Stock Received But Not Billed.
Neither document creates a receivable or a payable. The invoice does that.
Stock Entry and Stock Reconciliation
A Stock Entry posts the value of receipts, issues, transfers, manufacture, and repacks. A Stock Reconciliation sets counted quantities and rates, and posts the difference to the stock adjustment account.
Assets, payroll, and expense claims
- Buying or capitalizing an asset debits the asset account. Depreciation debits depreciation expense and credits accumulated depreciation. A sale or scrapping posts the gain or loss.
- Payroll debits salary expenses and credits payroll payable. The salary payment clears the payable.
- An expense claim records the expense and the amount payable to the employee.
Deferred revenue and expense
When an invoice item uses deferred accounting, the invoice first posts to a deferred account. ERPNext then moves the amount to income or expense over the service period. Learn more in About deferred revenue and expense.
Foreign-currency documents
ERPNext stores the amount in the transaction currency and in the company currency. If the payment uses a different exchange rate from the invoice, ERPNext posts the difference as an exchange gain or loss. Exchange Rate Revaluation restates open foreign-currency balances at a reporting date.
Documents that do not post to the ledger
| Document | Business effect | Ledger effect |
|---|---|---|
| Quotation | Offer to a customer | None |
| Sales Order | Customer commitment and fulfilment plan | None. An advance is a separate Payment Entry. |
| Purchase Order | Commitment to a supplier | None. An advance is a separate Payment Entry. |
| Delivery Note | Goods delivered | Stock and cost of goods sold, with perpetual inventory |
| Purchase Receipt | Goods received | Stock and receipt accrual, with perpetual inventory |
| Sales Invoice | Customer billing | Income, tax, receivable, optional stock |
| Purchase Invoice | Supplier billing | Expense or asset, tax, payable, optional stock |
| Payment Entry | Money moved | Bank or cash, and the party account |
Orders still drive operational reports: stock planning, fulfilment status, payment schedules, and advances.
Documents created without their source
You can create many documents directly, without an order or a receipt. The document is valid, but the upstream document is not updated:
- A direct Sales Invoice does not update the billed percentage of a Sales Order.
- A direct Delivery Note does not update the delivered percentage of a Sales Order.
- A direct Purchase Invoice does not update the billed percentage of a Purchase Order.
- An invoice with Update Stock combines stock and billing, so there is no separate delivery or receipt.
If an order exists, create the next document from the order. Learn more in Choose an accounting workflow.
Trace an amount from a document to a report
- Open the submitted document.
- Select View > Accounting Ledger. On a Journal Entry or a Payment Entry, select View > Ledger.
- Check that the debit total equals the credit total, and that the posting date, accounts, party, cost center, and dimensions are correct.
- For a stock document, select View > Stock Ledger and check the quantity and value.
- Open the General Ledger report for the account.
- For an outstanding amount, open the Accounts Receivable or Accounts Payable report.
- Open the financial statement and drill down into the amount.
TIP
On a draft invoice, select Preview > Accounting Ledger to see the entries before you submit.
If the document is correct but the account is wrong, check the defaults on the company, Item, Item Group, warehouse, party, and tax template. Fix the setup before you post more documents.
Troubleshooting
| Problem | What to check |
|---|---|
| A submitted document has no GL entry | Check whether the document posts at all (see the table above). For stock documents, check perpetual inventory and Update Stock. |
| The wrong income or expense account was used | Check the Item, Item Group, company, and party defaults. |
| The invoice is paid but still outstanding | Check the payment's references and allocated amounts. Reconcile an unallocated payment. |
| Stock Ledger and General Ledger values differ | Check backdated stock documents, reposting, and cancelled documents. Run the Stock and Account Value Comparison report. |
| A backdated correction is blocked | Check the company's Accounts Frozen Till Date, the Accounting Period restrictions, and your roles. |