Skip to content
AccountancyPath

Accounting for DevelopersModule 2: Data model and designIntermediate2 min read

Reversals and Audit Trails in Accounting Systems

How accounting software corrects mistakes without editing history: reversing entries, correcting entries, voids, audit trails, period locks and what auditors expect.

Lesson 6 of 16
Course outline (16 lessons)

Before this lesson:Journal and General Ledger Database DesignJournal Entries

Mistakes in financial data are inevitable: a payment applied to the wrong invoice, an amount typed wrong, a webhook processed with a bug. How a system corrects them determines whether it can be trusted.

The rule: never edit, never delete

Once an entry is posted, it is a historical fact: this was recorded at this time. Editing or deleting it would:

  • change reports that have already been sent to people;
  • break reconciliations with banks and payment providers;
  • make it impossible to explain past balances;
  • destroy the evidence auditors rely on.

Instead, accounting systems are append-only.

Reversing entries

A reversing entry is an exact mirror of the original: the same accounts and amounts, with debits and credits swapped (in code, every posting’s sign flipped). The net effect of the original plus its reversal is zero.

Worked example

Correcting a mis-posted expense

Original entry (wrong account): $300 of software was recorded as Office Supplies.

Entry 101 (original, 3 March)
AccountDebit (Dr)Credit (Cr)
Office Supplies Expense$300
Cash$300
Total✓ Balanced$300$300
Entry 145 (reversal of 101, 20 March)
AccountDebit (Dr)Credit (Cr)
Cash$300
Office Supplies Expense$300
Total✓ Balanced$300$300
Entry 146 (correct entry, 20 March)
AccountDebit (Dr)Credit (Cr)
Software Expense$300
Cash$300
Total✓ Balanced$300$300

Cash is correct throughout, Office Supplies nets to zero, Software has $300, and the history shows exactly what happened and when.

A correcting entry that posts only the difference (debit Software, credit Office Supplies) is also common and equally valid. Full reversal plus re-entry is easier to automate and reason about.

function reverse(original: JournalEntry, reason: string, effectiveDate: string): JournalEntry {
  return {
    id: newId(),
    idempotencyKey: `reversal:${original.id}`, // an entry can only be reversed once
    effectiveDate,
    description: `Reversal of ${original.id}: ${reason}`,
    reversesEntryId: original.id,
    postings: original.postings.map((p) => ({ ...p, amountMinor: -p.amountMinor })),
  };
}

Accrual reversals

Accountants also reverse entries deliberately. A month-end accrued expense, say $2,000 of contractor work not yet invoiced, is often reversed automatically on the first day of the next month. When the real invoice arrives and is posted normally, the estimate does not double-count.

What a good audit trail contains

For every entry:

  • who created it (user or service account) and when (created timestamp);
  • what caused it (source type and source id, such as an invoice or payment event);
  • which period it belongs to (effective date);
  • why, for manual and correcting entries (a required reason);
  • links between reversals and originals.

For reference data such as accounts, tax rates and exchange rates, keep version history so past entries can be interpreted with the values that applied at the time.

Period locking

After a period is closed, block new entries with an effective date inside it. Corrections are posted in the current open period, referencing the original. Re-opening a closed period should be rare, restricted to specific roles, and itself recorded.

Voids vs reversals

User interfaces often offer “void invoice” or “refund payment”. Underneath, these should create reversing or offsetting entries, not delete anything. The invoice record can show a status of voided, while the ledger shows the original and its reversal.

Recap

  • Posted entries are immutable; corrections are new entries.
  • A reversal mirrors the original with signs flipped; then post the correct entry.
  • Record who, when, what caused it, which period and why.
  • Lock closed periods and make voids create reversing entries.

Active recall

Quick check · Test yourself

Work out each answer in your head first, then reveal the explanation and mark whether you got it right.

  1. 1An invoice for $500 was posted to the wrong customer. What entries correct it?

    Show worked answer

    A reversal of the original entry (credit the wrong customer's receivable $500, debit revenue $500), then a new entry debiting the right customer's receivable and crediting revenue.

  2. 2Why do accountants post automatic reversals of month-end accruals on the first day of the next month?

    Show worked answer

    So that when the actual invoice arrives and is recorded normally, the expense is not counted twice. The reversal cancels the estimate in the new period.

Key terms in this lesson

Lesson 6 of 16 · Accounting for Developers

Finished this lesson?

Mark it complete to track your progress through the course. Progress is saved in this browser only.

Previous lesson: Building a Trial Balance from Ledger Data

Subject GuideAccounting Systems & Personal Finance

Mei-Ling Chen(陈美玲)

Turns accounting invariants into clean code—and everyday personal money clarity.

  • Double-Entry Ledger Engineering
  • SQL Schemas & Financial APIs
  • Multi-Currency & Billing Code

More lessons with Mei-Ling

Published:

Educational content only—not accounting, tax, legal or investment advice. See our editorial policy or report an error via our corrections policy.

Search