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 ​

LedgerWhat it recordsCommon sources
General LedgerDebit and credit amounts by accountInvoices, payments, journal entries, stock documents, assets, payroll
Payment LedgerReceivable and payable references, allocations, and outstanding amountsInvoices, payments, credit notes, journal entries with a party
Stock LedgerQuantity, valuation rate, and stock value by Item and warehousePurchase 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 ​

AccountDebitCredit
Customer receivableInvoice total
IncomeNet sales
Output taxTax 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 ​

AccountDebitCredit
Expense, asset, or Stock Received But Not BilledNet purchase
Input taxTax amount
Supplier payableInvoice 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 ​

DocumentBusiness effectLedger effect
QuotationOffer to a customerNone
Sales OrderCustomer commitment and fulfilment planNone. An advance is a separate Payment Entry.
Purchase OrderCommitment to a supplierNone. An advance is a separate Payment Entry.
Delivery NoteGoods deliveredStock and cost of goods sold, with perpetual inventory
Purchase ReceiptGoods receivedStock and receipt accrual, with perpetual inventory
Sales InvoiceCustomer billingIncome, tax, receivable, optional stock
Purchase InvoiceSupplier billingExpense or asset, tax, payable, optional stock
Payment EntryMoney movedBank 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 ​

  1. Open the submitted document.
  2. Select View > Accounting Ledger. On a Journal Entry or a Payment Entry, select View > Ledger.
  3. Check that the debit total equals the credit total, and that the posting date, accounts, party, cost center, and dimensions are correct.
  4. For a stock document, select View > Stock Ledger and check the quantity and value.
  5. Open the General Ledger report for the account.
  6. For an outstanding amount, open the Accounts Receivable or Accounts Payable report.
  7. 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 ​

ProblemWhat to check
A submitted document has no GL entryCheck 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 usedCheck the Item, Item Group, company, and party defaults.
The invoice is paid but still outstandingCheck the payment's references and allocated amounts. Reconcile an unallocated payment.
Stock Ledger and General Ledger values differCheck backdated stock documents, reposting, and cancelled documents. Run the Stock and Account Value Comparison report.
A backdated correction is blockedCheck the company's Accounts Frozen Till Date, the Accounting Period restrictions, and your roles.