Introducing a new way to review your PRs.

Read the announcement

frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)

View on GitHub

20 documents · Updated Nov 23, 2026

docs / financial-transaction-posting

Financial transaction posting

Financial transaction posting turns approved business events into balanced accounting records. Invoices, journal entries, and payment entries validate their source data before they affect the general ledger, payment ledger, stock values, tax balances, or outstanding amounts. The process preserves an audit trail by correcting posted effects through reversal or reposting rather than direct edits. See Accounting and financial operations, Banking and reconciliation, Sales and fulfillment, Purchase to pay, and Point of sale and subscriptions for the wider business flows around these records.

Financial posting model

A financial voucher is a submitted document that states an economic event. Its posting flow builds debit and credit rows with the company, account, party, currency, date, source voucher, and reporting dimensions needed for later balances and reports.

The general ledger records the full accounting effect. The payment ledger focuses on receivable and payable movement, so invoice balances and allocations can change without treating every general ledger row as a payment reference. See Accounting and financial operations for the wider accounting model and Banking and reconciliation for bank-side matching and clearance.

The posting path follows this high-level sequence:

flowchart LR
    D[Draft financial voucher] --> V[Business and accounting validation]
    V --> C[Build accounting rows]
    C --> G[General ledger entries]
    C --> P[Payment ledger entries for receivables and payables]
    G --> R[Balances and financial reports]
    P --> O[Outstanding amounts and allocations]
    G --> X[Cancellation or reposting]
    P --> X

Transaction families

Invoice posting

Sales and purchase invoices record what a customer owes or what a company owes a supplier. Before submission, each invoice checks its party account, source links, amounts, currency, taxes, and any stock or billing rules. A purchase invoice also enforces the purchase-order and receipt rules set for the buying flow, while a hold can block later settlement until its release date. The invoice then owns the accounting rows, payment references, due dates, and outstanding balance created from that event (erpnext/…/sales_invoice.py• L310-409, erpnext/…/purchase_invoice.py• L271-350, erpnext/…/purchase_invoice.py• L453-478, erpnext/…/purchase_invoice.py• L780-824).

Sales invoices normally debit a customer account and credit income or related accounts. Purchase invoices normally credit a supplier account and debit expense, asset, or stock-related accounts. A stock-updating purchase invoice can post accepted and rejected quantities together. Its return carries the billed and valued rejected quantity back to the source warehouse, while an unbilled and unvalued rejected quantity returns stock without a general ledger amount (erpnext/…/test_purchase_invoice.py• L3317-3415, erpnext/…/test_purchase_invoice.py• L3424-3465).

Purchase invoice progress uses stock quantity in the correct item unit when it updates purchase order and material request receipt status. When a purchase receipt is made from an invoice, the mapping keeps only the pending quantity after prior receipts, mapped rows, and returns. It converts that quantity to stock units before it updates receipt progress and value (erpnext/…/purchase_invoice.py• L688-749, erpnext/…/mapper.py• L50-143).

Sales invoices carry the accounting and reporting context needed for posting. They can also join payment, stock, tax, payment-term, return, debit-note, and dimension flows, so the invoice model is the hand-off point between a sale and its later settlement. The user-facing invoice flow exposes the next business action only when its balance and source state allow it. This links billing to payment, delivery, returns, dunning, and inter-company processing without changing the posting boundary (erpnext/…/sales_invoice.js• L73-223, erpnext/…/sales_invoice.json• L744-795, erpnext/…/sales_invoice.json• L1357-1418, erpnext/…/sales_invoice.json• L1904-1978).

Debit notes do not update stock. Subcontracted sales also keep stock updates off because their material flow is handled by the related subcontracting process. These rules keep a financial adjustment from creating a second inventory movement (erpnext/…/sales_invoice.py• L320-357, erpnext/…/sales_invoice.py• L1081-1090, erpnext/…/sales_invoice.py• L1340-1348).

Sales invoices with fixed-asset items use the company’s asset disposal account and depreciation cost center for the sale effect. The company-specific defaults must exist before the invoice can create that accounting result (erpnext/…/sales_invoice.py• L418-436, erpnext/…/sales_invoice.py• L1400-1410, erpnext/…/depreciation.py• L850-866).

Inter-company mapping creates the counterpart document only when the internal parties, price list, and company rules are valid. It carries only open quantities and preserves links to the source. Because the target is on the other side of buying or selling, the mapper removes terms and item tax templates that do not apply to that company. The lookup also checks access to the source document and rejects a caller-supplied field outside the allowed mapping contract. This prevents invalid terms, cross-company tax data, or hidden counterpart data from entering the target invoice (erpnext/…/mapper.py• L155-211, erpnext/…/mapper.py• L213-301, erpnext/…/mapper.py• L337-460, erpnext/…/test_sales_invoice.py• L3844-3914).

References: erpnext/…/sales_invoice.py• L310-409 erpnext/…/sales_invoice.py• L320-357 erpnext/…/sales_invoice.py• L418-436 erpnext/…/sales_invoice.py• L447-464 erpnext/…/sales_invoice.py• L1081-1090 erpnext/…/sales_invoice.py• L1180-1186 erpnext/…/sales_invoice.py• L1340-1348 erpnext/…/sales_invoice.py• L1400-1410 erpnext/…/sales_invoice.js• L73-223 erpnext/…/sales_invoice.json• L744-795 erpnext/…/sales_invoice.json• L1357-1418 erpnext/…/sales_invoice.json• L1904-1978 erpnext/…/purchase_invoice.py• L271-350 erpnext/…/purchase_invoice.py• L453-478 erpnext/…/purchase_invoice.py• L688-749 erpnext/…/purchase_invoice.py• L780-824 erpnext/…/mapper.py• L50-143 erpnext/…/test_purchase_invoice.py• L3317-3415 erpnext/…/test_purchase_invoice.py• L3424-3465 erpnext/…/mapper.py• L155-211 erpnext/…/mapper.py• L213-301 erpnext/…/mapper.py• L337-460 erpnext/…/test_sales_invoice.py• L3844-3914 erpnext/…/depreciation.py• L850-866

Point-of-sale invoice posting

A point-of-sale invoice combines the sale and its immediate payment. The POS profile supplies the payment modes, accounts, taxes, terms, price settings, and stock behavior. It supplies defaults for a new invoice while validation keeps values already entered on the invoice. Validation checks the payment direction, enabled modes, open session, and full-payment rule when partial payment is not allowed (erpnext/…/sales_invoice.py• L342-399, erpnext/…/sales_invoice.py• L441-447, erpnext/…/pos.py• L21-79, erpnext/…/pos.py• L90-105).

The resulting rows move value from the customer side to the selected cash or bank accounts. Change and write-off use separate accounting effects when configured. A POS return reverses the payment direction, so the cash movement and invoice balance stay aligned (erpnext/…/test_sales_invoice.py• L1362-1436). Positive POS invoices need a payment mode. Return payments must have the opposite sign, and a submitted invoice must be fully paid unless its profile permits partial payment (erpnext/…/pos.py• L182-212, erpnext/…/pos.py• L262-278, erpnext/…/test_sales_invoice.py• L1409-1436).

References: erpnext/…/sales_invoice.py• L342-399 erpnext/…/sales_invoice.py• L441-447 erpnext/…/pos.py• L21-79 erpnext/…/pos.py• L90-105 erpnext/…/pos.py• L182-212 erpnext/…/pos.py• L262-278 erpnext/…/test_sales_invoice.py• L1362-1436 erpnext/…/test_sales_invoice.py• L1480-1544

Journal entry posting

A journal entry is the direct double-entry route for manual and system-generated accounting events. Its rows state the accounts, amounts, parties, references, currencies, and reporting context. The entry must contain usable rows with equal debit and credit totals before submission. Special entry types add context for opening balances, taxes, assets, reversals, and inter-company movement (erpnext/…/journal_entry.py• L142-185, erpnext/…/journal_entry.py• L684-785).

Journal entries can link to submitted documents with outstanding balances, or create one linked reverse entry. Reference checks keep the party, account, direction, and remaining balance tied to the source document. The selection path returns only submitted entries with an unmatched row, and the form rejects manual Payment Entry references because payment links must be created by the payment flow. This makes the journal route useful for advances, adjustments, depreciation, disposal, and exchange effects without weakening the same posting boundary (erpnext/…/journal_entry.js• L47-60, erpnext/…/journal_entry.js• L527-570, erpnext/…/journal_entry.py• L590-659, erpnext/…/journal_entry.py• L1108-1155).

Large entries can submit or cancel in the background. After submission or cancellation, invoice references also synchronize the related payment schedule, so a journal allocation does not leave the invoice schedule at an old outstanding amount (erpnext/…/journal_entry.py• L216-254, erpnext/…/journal_entry.py• L327-373, erpnext/…/journal_entry.py• L388-392).

References: erpnext/…/journal_entry.js• L47-60 erpnext/…/journal_entry.js• L244-333 erpnext/…/journal_entry.js• L527-570 erpnext/…/journal_entry.py• L142-185 erpnext/…/journal_entry.py• L216-254 erpnext/…/journal_entry.py• L327-373 erpnext/…/journal_entry.py• L388-392 erpnext/…/journal_entry.py• L590-659 erpnext/…/journal_entry.py• L684-785 erpnext/…/journal_entry.py• L1108-1155

Payment entry posting

A payment entry records money received, money paid, or an internal transfer. It checks the party, bank or cash accounts, currencies, references, allocations, deductions, taxes, and final difference. Each allocation must match the current balance and the party and account relationship of its submitted source. Payment-term allocation is checked against the latest term balance, with the account currency setting the rounding boundary (erpnext/…/payment_entry.py• L178-207, erpnext/…/payment_entry.py• L438-488, erpnext/…/payment_entry.py• L504-607, erpnext/…/test_payment_entry.py• L2312-2338, erpnext/…/test_payment_entry.py• L2490-2515).

The posting moves value between the party account and a bank, cash, or other account. References connect the payment to invoices, orders, journal entries, advances, or payment requests. An unallocated amount remains with the party for later allocation or reconciliation. Internal transfers use distinct source and target accounts without party references, and only enabled bank accounts are attached to their two sides (erpnext/…/payment_entry.py• L301-367, erpnext/…/payment_entry.py• L417-422, erpnext/…/payment_entry.py• L633-735, erpnext/…/test_payment_entry.py• L58-78, erpnext/…/test_payment_entry.py• L1294-1349).

When a payment is created from a source document, the selected company bank or cash account must be enabled. If no usable company account exists, the flow can use the party’s company bank account instead. This prevents a disabled bank default from entering a new payment while still supporting party-specific settlement accounts (erpnext/…/payment_entry.py• L2929-2938, erpnext/…/payment_entry.py• L2978-2992, erpnext/…/test_payment_entry.py• L58-78).

Write-offs, bank charges, taxes, exchange differences, and dunning deductions become separate accounting effects. A dunning deduction must belong to the submitted dunning for the same customer and company and must use its income account. The payment must reach zero difference before submission. Tax adjustments use the amount in company currency and convert it through the bank-side currency, so the payment amount, ledger effect, and bank match stay aligned across currencies (erpnext/…/payment_entry.py• L209-282, erpnext/…/payment_entry.py• L1198-1217, erpnext/…/gl_composer.py• L24-46, erpnext/…/test_payment_entry.py• L2060-2215).

Payment references also respect the effective hold state of a purchase invoice. A held invoice remains unavailable for payment until its release date, while an invoice whose release date has arrived can return to the outstanding flow. The check runs again when the payment is saved, so a hold added after payment creation cannot be bypassed (erpnext/…/payment_entry.py• L802-867, erpnext/…/test_payment_entry.py• L2217-2265, erpnext/…/purchase_invoice.py• L275-276).

References: erpnext/…/payment_entry.py• L178-207 erpnext/…/payment_entry.py• L209-282 erpnext/…/payment_entry.py• L2929-2938 erpnext/…/payment_entry.py• L301-367 erpnext/…/payment_entry.py• L417-422 erpnext/…/payment_entry.py• L438-488 erpnext/…/payment_entry.py• L504-607 erpnext/…/payment_entry.py• L633-735 erpnext/…/payment_entry.py• L802-867 erpnext/…/payment_entry.py• L1198-1217 erpnext/…/payment_entry.py• L2978-2992 erpnext/…/gl_composer.py• L24-46 erpnext/…/test_payment_entry.py• L58-78 erpnext/…/test_payment_entry.py• L1294-1349 erpnext/…/test_payment_entry.py• L2060-2215 erpnext/…/test_payment_entry.py• L2217-2265 erpnext/…/test_payment_entry.py• L2312-2338 erpnext/…/test_payment_entry.py• L2490-2515 erpnext/…/purchase_invoice.py• L271-276

Payment reconciliation

Payment reconciliation matches open invoice-side balances with unreconciled payments, journal entries, and return notes for one party account. It applies company, party, date, amount, cost-center, dimension, and permission filters before it creates allocations (erpnext/…/payment_reconciliation.py• L136-176, erpnext/…/payment_reconciliation.py• L192-235, erpnext/…/payment_reconciliation.py• L386-426).

The tool keeps each party account and each posted payment-ledger row as a separate matching unit. It carries the same row-level cost center, remark, currency, and dimension into the allocation, then books exchange differences when invoice and payment rates differ. This prevents a summary query from joining metadata or balances from different ledger rows (erpnext/…/payment_reconciliation.py• L441-476, erpnext/…/payment_reconciliation.py• L492-612, erpnext/…/test_payment_reconciliation.py• L275-422).

Reconciliation updates invoice outstanding amounts and payment schedules without changing the original voucher. It can create a system journal for a return note or an exchange difference, and cancellation or unreconciliation restores the open balance and schedule state (erpnext/…/payment_reconciliation.py• L588-670, erpnext/…/payment_reconciliation.py• L877-985, erpnext/…/test_payment_reconciliation.py• L762-889, erpnext/…/test_payment_reconciliation.py• L931-986).

References: erpnext/…/payment_reconciliation.py• L136-176 erpnext/…/payment_reconciliation.py• L192-235 erpnext/…/payment_reconciliation.py• L386-426 erpnext/…/payment_reconciliation.py• L441-476 erpnext/…/payment_reconciliation.py• L492-612 erpnext/…/payment_reconciliation.py• L588-670 erpnext/…/payment_reconciliation.py• L877-985 erpnext/…/test_payment_reconciliation.py• L275-422 erpnext/…/test_payment_reconciliation.py• L424-447 erpnext/…/test_payment_reconciliation.py• L762-889 erpnext/…/test_payment_reconciliation.py• L931-986 erpnext/…/test_payment_reconciliation.py• L1865-1919 erpnext/…/test_payment_reconciliation.py• L2229-2267

Tax effects

Tax calculation

Tax calculation turns tax templates and item tax rules into amounts that affect the voucher total and later ledger rows. It resolves currency, discounts, tax order, inclusive tax behavior, tax bases, rounding, and the final total before posting (erpnext/…/taxes_and_totals.py• L46-89, erpnext/…/taxes_and_totals.py• L150-164, erpnext/…/taxes_and_totals.py• L744-819).

Tax rows can charge the net total, an earlier tax row, a previous total, a paid amount, or an actual amount. The rules reject invalid row links and inconsistent inclusive-tax combinations. The tax account must belong to the voucher company so the calculated amount can become a valid ledger row (erpnext/…/taxes.py• L109-127, erpnext/…/taxes.py• L239-322).

Invoice tests protect the relationship between an inclusive gross price and its net amount, tax, and grand total across decimal and zero-decimal currencies. The goal is one stable total that can be posted and reported without double-rounding differences (erpnext/…/test_sales_invoice.py• L445-515, erpnext/…/test_sales_invoice.py• L517-770).

References: erpnext/…/taxes_and_totals.py• L46-89 erpnext/…/taxes_and_totals.py• L150-164 erpnext/…/taxes_and_totals.py• L744-819 erpnext/…/taxes.py• L109-127 erpnext/…/taxes.py• L239-322 erpnext/…/test_sales_invoice.py• L445-515 erpnext/…/test_sales_invoice.py• L517-770

Tax ledger effects

Invoice and payment posting use the calculated tax rows to create entries against tax accounts. Purchase invoice tax rows can affect the supplier balance and stock or asset value as well as tax liability. A valuation charge can become part of stock or asset value, while its remaining effect stays linked to the tax account. Tax withholding remains tied to the source invoice or payment during submission and cancellation (erpnext/…/gl_composer.py• L754-891, erpnext/…/gl_composer.py• L218-282, erpnext/…/payment_entry.py• L178-207).

For payment entries, the tax effect also changes the paid and received amounts after tax. The company-currency amount is the control value, and the account currency shows the same effect through the relevant exchange rate (erpnext/…/payment_entry.py• L1198-1217, erpnext/…/test_payment_entry.py• L2060-2215).

References: erpnext/…/gl_composer.py• L754-891 erpnext/…/gl_composer.py• L218-282 erpnext/…/payment_entry.py• L178-207 erpnext/…/payment_entry.py• L1198-1217 erpnext/…/test_payment_entry.py• L2060-2215

Accounting dimensions and controls

Dimension assignment

An accounting dimension is a reporting axis such as a business unit or program. It links a supported accounting document to a value that can flow into its ledger rows. Active dimensions can provide company-specific defaults, while cost center and project provide related reporting context (erpnext/…/base_gl_composer.py• L40-75, erpnext/…/accounting_dimension.py• L270-303, erpnext/…/accounting_dimension.py• L369-402).

Each dimension must refer to one standalone business document type. It cannot use a protected or already-used type. When a dimension changes, the system propagates its field to supported accounting documents. If a document already has that field, its existing value supplies the dimension instead of creating a second field (erpnext/…/accounting_dimension.py• L43-109, erpnext/…/accounting_dimension.py• L141-175).

Dimension defaults are checked per company. A dimension can also be disabled. Disabling changes the shared field so users cannot edit the value, and that configuration action requires write access to the Accounting Dimension record. Deleting a dimension also removes its related filters, which prevents stale rules from applying to a dimension that no longer exists (erpnext/…/accounting_dimension.py• L111-131, erpnext/…/accounting_dimension.py• L210-263).

References: erpnext/…/base_gl_composer.py• L40-75 erpnext/…/accounting_dimension.py• L43-109 erpnext/…/accounting_dimension.py• L111-131 erpnext/…/accounting_dimension.py• L141-175 erpnext/…/accounting_dimension.py• L210-263 erpnext/…/accounting_dimension.py• L270-303 erpnext/…/accounting_dimension.py• L369-402

Posting controls

The posting boundary rejects rows that could weaken the books. It checks account status and company ownership, party and currency fit, cost centers, mandatory dimensions, accounting periods, frozen dates, closing limits, and debit-credit balance. The checks run after each voucher has built its proposed rows (erpnext/…/gl_validator.py• L20-68, erpnext/…/gl_validator.py• L96-146, erpnext/…/gl_entry.py• L84-103, erpnext/…/gl_entry.py• L172-217).

The general ledger then applies shared row processing before submission. This includes cost center allocation, similar-row merging, negative amount normalization, and final validation. Dimension filters apply account-level mandatory or allowed-value rules to the assembled rows, including payment ledger rows, so outstanding reports use the same reporting context as the general ledger (erpnext/…/general_ledger.py• L34-75, erpnext/…/general_ledger.py• L141-153, erpnext/…/general_ledger.py• L359-387, erpnext/…/gl_validator.py• L149-182, erpnext/…/payment_ledger_entry.py• L91-125).

References: erpnext/…/gl_validator.py• L20-68 erpnext/…/gl_validator.py• L96-146 erpnext/…/gl_validator.py• L149-182 erpnext/…/gl_entry.py• L84-103 erpnext/…/gl_entry.py• L172-217 erpnext/…/general_ledger.py• L34-75 erpnext/…/general_ledger.py• L141-153 erpnext/…/general_ledger.py• L359-387 erpnext/…/payment_ledger_entry.py• L91-125

Ledger correction lifecycle

Cancellation and immutable records

Cancellation does not remove the financial history of a submitted voucher. The source document first updates its linked business effects, tax withholding, stock or asset state, and outstanding amounts. The system then creates reversing debit and credit rows that offset the original effect. With immutable ledger enabled, the original rows remain unchanged and the reversal is a new record with the cancellation date (erpnext/…/sales_invoice.py• L547-640, erpnext/…/purchase_invoice.py• L897-965, erpnext/…/journal_entry.py• L338-373, erpnext/…/payment_entry.py• L368-392, erpnext/…/general_ledger.py• L607-725).

The same correction principle applies to payment ledger effects. A cancelled payment reverses or delinks its payment-side records according to the ledger mode, then updates references, schedules, and outstanding amounts. Individual general ledger entries do not own this operation. The source voucher owns the correction path (erpnext/…/utils.py• L2151-2173, erpnext/…/gl_entry.py• L325-328).

References: erpnext/…/sales_invoice.py• L547-640 erpnext/…/purchase_invoice.py• L897-965 erpnext/…/journal_entry.py• L338-373 erpnext/…/payment_entry.py• L368-392 erpnext/…/general_ledger.py• L607-725 erpnext/…/utils.py• L2151-2173 erpnext/…/gl_entry.py• L325-328

Reposting and amendments

Some submitted documents can change fields that affect their accounting rows. The source document detects changes to accounts, taxes, payments, deferred accounting, or dimensions. It validates the new values and rebuilds the related ledger effects through reposting rather than editing posted rows (erpnext/…/sales_invoice.py• L428-433, erpnext/…/sales_invoice.py• L1287-1305, erpnext/…/purchase_invoice.py• L831-842, erpnext/…/journal_entry.py• L327-336, erpnext/…/payment_entry.py• L284-299).

This source-owned route keeps the general ledger, payment ledger, and related business records tied to one correction event. It also means a change to a source-document contract, such as a mapped terms rule or item reference, must be checked for its effect on the document that will later post the accounting rows (erpnext/…/mapper.py• L199-240).

References: erpnext/…/sales_invoice.py• L428-433 erpnext/…/sales_invoice.py• L1287-1305 erpnext/…/purchase_invoice.py• L831-842 erpnext/…/journal_entry.py• L327-336 erpnext/…/payment_entry.py• L284-299 erpnext/…/mapper.py• L199-240

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to invoice account or tax composition must preserve both general ledger rows and payment-ledger allocation behavior.
  • Changes to stock-updating purchase invoice returns must preserve rejected quantity, valuation, grand total, and reversal balance together.
  • Changes to purchase invoice receipt mapping must preserve pending quantity after mapped receipts and returns, plus the conversion from item units to stock units.
  • Changes to purchase invoice receipt progress must preserve stock-unit conversion for purchase orders and material requests.
  • Changes to fixed-asset sales must preserve company-specific disposal account and depreciation cost center validation.
  • Changes to inter-company mapping must preserve pending quantities, source access, source links, counterpart company rules, and terms and tax templates valid for the target side.
  • Changes to sales invoice fields or actions must preserve payment, return, debit-note, POS, payment-term, and dimension flows.
  • Changes to POS profile defaults or POS payment validation must preserve explicit invoice values, payment signs, open-session checks, and the partial-payment rule.
  • Changes to payment creation must preserve the exclusion of disabled company bank defaults and the fallback to an enabled party bank account.
  • Changes to inclusive tax, payment tax, or currency rounding must preserve the relation between net amount, tax amount, grand total, account currency, bank amount, and posted debit-credit rows.
  • Changes to payment-term allocation must preserve latest outstanding checks and account-currency precision.
  • Changes to payment hold checks must preserve the distinction between an active hold and a release date that has arrived at both lookup and save time.
  • Changes to journal reference lookup or outstanding APIs must preserve source permissions, unmatched-row rules, reference direction, and compatibility for existing callers.
  • Changes to reconciliation queries must preserve party-account grouping and row-level payment-ledger metadata.
  • Changes to reconciliation allocations must preserve payment schedules, exchange difference dates, dimension filters, and reversal behavior.
  • Changes to accounting dimension creation, disablement, or deletion must preserve propagated fields, company defaults, filters, and the permission boundary for shared field changes.
  • Changes to dimension filters or posting validation must be checked in both general ledger and payment ledger paths.
  • Changes to submitted invoice fields must preserve the validation and repost path rather than direct edits to posted rows.

Important failure modes

TriggerConsequenceGuard
A purchase return contains fully rejected stock that was billed and valuedThe return can bill the wrong amount or leave stock and ledger values out of balanceReturn calculation uses the original rejected quantity and valuation
A fully rejected return was never valuedThe return can create a false financial amountThe return keeps the stock movement but creates no GL entry when its value is zero
A purchase receipt is mapped without subtracting prior mapped and returned quantityThe receipt can overstate received stock and billing progressMapping keeps only pending quantity and converts it to stock units
A disabled company bank account is selected as the generated payment defaultA new payment can point to an account that cannot be used for settlementDefault lookup filters out disabled company bank accounts and then checks the party bank fallback
Payment tax is converted with the wrong account currencyThe payment, bank reconciliation amount, and ledger rows can disagreeCompany-currency tax is converted through the bank-side exchange rate
A payment references a purchase invoice whose hold has not expiredThe payment can settle an invoice that is still blockedReference validation checks the invoice’s effective blocked state when the payment is saved
A stock-updating invoice reports received quantity without its unit conversionPurchase order or material request progress can be overstated or understatedReceipt status uses stock quantity and the item conversion factor
A fixed-asset sale uses missing or cross-company disposal defaultsThe invoice cannot create a valid asset disposal effectCompany-specific disposal account and depreciation cost center checks run before posting
An inter-company source carries terms or tax data that are valid only for selling or the source companyThe target purchase document can contain invalid commercial or tax rulesMapping clears inapplicable terms and item tax templates
A POS return keeps positive payment rowsThe return can increase cash instead of reversing the original receiptPOS validation requires negative return payment amounts
A POS invoice has no open session or lacks full payment when partial payment is disabledThe sale can bypass session control or leave a POS balance that the profile does not allowPOS validation checks the profile session and payment policy before submission
A journal row manually references a Payment EntryThe payment can be linked outside the payment flow and become hard to reconcileThe journal form rejects manually entered Payment Entry references
A journal entry references a row that was already matchedThe new entry can consume an amount that is no longer outstandingJournal reference selection and validation require a submitted unmatched row
A reconciliation query combines metadata from different payment-ledger rowsOutstanding results can show a cost center or remark that was never posted with that balanceQuery results keep party account and row-level metadata as matching keys
A reconciliation limit nets balances across party accountsA valid outstanding voucher can disappear from the resultOutstanding queries group and limit each party account separately
A reconciliation user lacks company or dimension permissionThe user can view or allocate entries outside the permitted scopeAccess checks and dimension filters run before fetch and reconcile actions
A voucher uses a disabled, group, or wrong-company accountSubmission cannot create a valid ledger effectAccount and company checks reject the row before posting
A tax row points to an invalid prior row or a tax account from another companyTotals or tax ledger rows can be wrongTax-row and tax-account validation blocks the voucher
A required or disallowed dimension is missing from a ledger rowAccount-level reporting rules are brokenDimension rules validate assembled general and payment ledger rows
A posting date falls in a closed or frozen periodA prior accounting period can changePeriod and freeze-date checks block posting or cancellation
A submitted voucher is cancelled by editing ledger rows directlyThe source and audit trail lose their relationshipLedger rows require source-voucher cancellation and reversal

Key files

FileWhy to read it
erpnext/…/sales_invoice.pyShows sales invoice validation, stock and asset boundaries, submission effects, repost triggers, and source-owned cancellation.
erpnext/…/sales_invoice.jsShows the invoice’s user-facing links to payments, POS, returns, inter-company invoices, dunning, discounting, and dimensions.
erpnext/…/pos.pyShows how POS profiles supply defaults and how payment modes, returns, sessions, and partial-payment rules are checked.
erpnext/…/sales_invoice.jsonShows the invoice fields that connect stock, taxes, payments, payment terms, returns, debit notes, and accounting dimensions.
erpnext/…/mapper.pyShows inter-company document mapping, pending quantities, source access, source links, and target-side terms and tax handling.
erpnext/…/test_sales_invoice.pyVerifies invoice totals, inclusive tax, POS effects, inter-company mapping, asset sale rules, and ledger results.
erpnext/…/purchase_invoice.pyShows purchase validation, stock-unit progress updates, hold rules, submission effects, and repost triggers.
erpnext/…/mapper.pyShows how purchase invoices become receipts while preserving pending quantities, returns, taxes, and stock units.
erpnext/…/purchase_invoice.jsonShows the purchase invoice fields that connect stock update, rejected warehouses, taxes, payment terms, holds, payments, and dimensions.
erpnext/…/gl_composer.pyShows how supplier, stock, valuation tax, withholding, payment, write-off, and rounding effects become purchase invoice ledger rows.
erpnext/…/test_purchase_invoice.pyVerifies stock-updating purchase invoice returns, rejected quantities, valuation, unit conversion, and balanced ledger effects.
erpnext/…/journal_entry.pyShows direct double-entry validation, references, permissions, outstanding amounts, reposting, and cancellation.
erpnext/…/journal_entry.jsShows journal reference selection, balancing, currency behavior, reverse-entry actions, and the boundary against manual payment references.
erpnext/…/mapper.pyShows linked payment and reverse-journal creation.
erpnext/…/payment_entry.pyShows payment validation, payment-term allocation, bank-account selection, tax currency handling, dunning checks, invoice holds, outstanding updates, reposting, and cancellation.
erpnext/…/test_payment_entry.pyVerifies enabled bank defaults, payment tax amounts across currencies, payment-term precision, internal transfers, bank effects, and payment blocking for held purchase invoices.
erpnext/…/payment_reconciliation.pyShows how open invoices and payment-side vouchers are filtered, allocated, reconciled, and corrected for exchange differences.
erpnext/…/test_payment_reconciliation.pyVerifies party-account grouping, row metadata, permissions, dimensions, currency rounding, payment schedules, and reversal behavior.
erpnext/…/general_ledger.pyDefines shared row processing, posting, and reversal behavior.
erpnext/…/gl_entry.pyDefines the validation and audit boundary for each general ledger row.
erpnext/…/payment_ledger_entry.pyShows the ledger used for receivable and payable outstanding effects.
erpnext/…/taxes_and_totals.pyExplains how totals and tax amounts are resolved before posting.
erpnext/…/taxes.pyExplains tax template and tax-account validation.
erpnext/…/accounting_dimension.pyExplains dimension lifecycle, field propagation, defaults, deletion, and permissions.
erpnext/…/gl_validator.pyShows shared account, period, currency, dimension, and balance checks.
erpnext/…/depreciation.pyShows the company-level defaults required for asset disposal accounting.