About the immutable ledger ​

ERPNext does not rewrite or delete posted ledger entries. When you cancel a document, ERPNext keeps the original General Ledger and Stock Ledger entries and adds opposite entries. You correct mistakes with new, traceable documents. Reviewers and auditors can always see what was posted first and how it was reversed.

Why the ledger is protected ​

Ledger entries form an ordered history. A change to an old entry can change later results:

  • Under FIFO valuation, a changed earlier stock movement changes which stock layers later movements use.
  • Under moving average valuation, it changes later valuation rates and cost of goods sold.
  • A changed invoice or tax entry changes reports and tax returns for a period that you already reported.

What happens when you cancel a document ​

Example: a submitted Journal Entry debits Office Maintenance Expense 120 and credits Bank 120. When you cancel it, the status becomes Cancelled, and ERPNext adds a credit of 120 to the expense and a debit of 120 to the bank under the same voucher. The net effect is zero.

The General Ledger report hides cancelled entries. Select Show Cancelled Entries to see them.

The same applies to invoices, payments, and stock documents.

Posting date of the reversal ​

By default, the reversal entries carry the posting date of the original document. If you select Enable Immutable Ledger in Accounts Settings, ERPNext posts the reversal on the cancellation date, and reports include the cancelled entries. A past period then stays as it was reported.

How to correct a document ​

SituationCorrection
The draft is wrongEdit or delete the draft.
A submitted invoice is wrongCancel and amend it, if the period and links allow it.
A customer returns goodsCreate a return or a Credit Note.
A supplier return or a rate correctionCreate a return or a Debit Note.
A Journal Entry needs an opposite entrySelect Actions > Reverse Journal Entry.
The document is correct but its ledger entries are outdatedUse Repost Accounting Ledger.

A cancelled document with ledger entries cannot be deleted in normal use, because it is the source of the entries. Delete Accounting and Stock Ledger entries on deletion of transaction in Accounts Settings changes this. Never delete GL Entry or Stock Ledger Entry rows in the database.

Backdated stock documents ​

ERPNext allows a stock document dated before later movements of the same Item and warehouse. It then creates a Repost Item Valuation job that recalculates the later Stock Ledger entries in order. Stock Settings, negative stock rules, frozen dates, accounting periods, and batch and serial number rules can still block the document.

When a backdated correction is needed:

  1. Check that the period is open. See Freeze accounting entries and Accounting Period.
  2. Submit the smallest correction possible.
  3. Wait until the Repost Item Valuation job is complete.
  4. Check the Stock Ledger, the stock balance and value, and the accounting reports.

A large or old correction can take a long time. Test it on a copy of the site first.

Corrections in a closed period ​

A Period Closing Voucher, a frozen date, or an Accounting Period can block a cancellation, an amendment, or a repost. Decide with your accountant whether to reopen the period with approval, or to post an adjustment in the current period.

Check the audit trail after a correction ​

  1. Open the document and check its status and its Amended From or return reference.
  2. Select View > Ledger, or filter the General Ledger by the voucher number with Show Cancelled Entries selected.
  3. For stock documents, check the Stock Ledger and any Repost Item Valuation.
  4. Check the financial statements, stock values, tax reports, and outstanding amounts.