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 / banking-and-reconciliation

Banking and reconciliation

Banking and reconciliation connects external bank statements with ERPNext accounting records. It brings statement activity into bank transactions, helps an accountant match each transaction to an existing accounting document or create the needed entry, and shows whether the bank account balance and clearance dates agree with the system. The feature is available through a separate Banking web client that runs through ERPNext.

System scope

The Banking area serves as the work space between a bank account and the general ledger. A company bank account supplies the ledger account and currency, while imported bank transactions provide the external view that users must explain through matching or new accounting entries.

Bank account context

A company bank account is the anchor for the full flow. It links a bank account record to one company ledger account and gives the Banking client the account currency and the set of transactions that it can display. The account must be enabled and marked as a company account for statement import and reconciliation work. The same account can store statement closing-balance snapshots for comparison at a selected date. See Accounting and finance for the wider accounting model.

References: erpnext/…/bank_account.json• L54-112 erpnext/…/bank_account.py• L62-93 erpnext/…/bank_account.py• L155-193 erpnext/…/bank_account.py• L196-237 erpnext/…/test_bank_account.py• L17-40 banking/…/BankPicker.tsx• L17-45

Statement ingestion

Statement ingestion turns a file supplied by a bank into submitted Bank Transaction records. It preserves the source statement as an import log so users can inspect the detected dates, amounts, totals, and closing balance before they add the transactions to the account. The Bank Statement Import record also supports a Google Sheets source, MT940 format, custom CSV delimiters, and status values that show import progress.

Statement import

The statement importer accepts CSV, XLSX, XLS, and table-based PDF statements. It detects the header and amount style, maps source columns to transaction fields, and lets the user correct the mapping before import. PDF statements are handled as separate tables, so the user can include only transaction tables and adjust a table region when the bank layout needs help. Password-protected PDF files can use a password stored for the bank account.

A direct upload path also reads CSV or XLSX rows and uses the selected bank's field mapping to create submitted Bank Transactions. It checks create access before processing and reports successful and failed rows, so the source file still becomes bank activity before reconciliation explains it.

References: banking/…/BankStatementImporter.tsx• L42-72 banking/…/BankStatementImporter.tsx• L161-208 erpnext/…/bank_statement_import.json• L38-63 erpnext/…/bank_statement_import.json• L71-113 erpnext/…/bank_statement_import.json• L145-185 erpnext/…/bank_statement_import.json• L200-225 erpnext/…/bank_statement_import_log.py• L191-257 erpnext/…/bank_statement_import_log.py• L920-985 erpnext/…/bank_transaction_upload.py• L12-39 erpnext/…/bank_transaction_upload.py• L42-75

Import review and posting

The Bank Statement Import record is the review boundary between a file and live accounting data. The user reviews the detected rows and summary, then posts the accepted rows as Bank Transactions for the selected company bank account. Each transaction carries the bank date, deposit or withdrawal, description, reference, type, and account currency. The imported statement closing balance is also stored for later comparison with the system balance.

The import does not create a payment or journal entry for every bank row. It creates the external bank activity first. Reconciliation then explains that activity through existing documents or through entries created from the Banking work space.

References: erpnext/…/bank_statement_import.json• L9-36 erpnext/…/bank_statement_import.json• L71-113 erpnext/…/bank_statement_import.json• L158-185 erpnext/…/bank_statement_import_log.py• L480-570 erpnext/…/bank_transaction.json• L61-117 erpnext/…/bank_transaction.json• L123-151 erpnext/…/bank_transaction.py• L54-95 erpnext/…/bank_transaction.py• L112-119 banking/…/ViewBankStatementImportLog.tsx• L14-52

Matching and reconciliation

Reconciliation reduces the unallocated amount on a Bank Transaction by linking it to an accounting document. The Banking work space keeps the unmatched bank activity on one side and possible accounting documents or create actions on the other, so a user can resolve both recorded payments and bank-only activity.

Reconciliation workspace

The main Banking screen is scoped by company, bank account, and date range. It shows the account balances and reconciliation progress, then provides separate views for matching, statements, transactions, clearance, and incorrect clearance dates. The matching view supports search and filters over unreconciled bank transactions and presents candidate documents for the selected transaction.

The workspace can match a bank transaction to an existing Payment Entry, Journal Entry, or other supported accounting document. It can also create a Payment Entry, create a Bank Entry through a journal entry, record an internal transfer, or record a payment when no suitable document exists. Each create action submits the accounting document and links it back to the bank transaction.

Matching uses the amount that reached or left the selected bank account. This distinction matters for transfers where the amount sent can differ from the amount received. The matching view therefore compares the bank-side amount and reduces each candidate by amounts already allocated to other bank transactions. When the party account uses another currency, the bank-side amount remains authoritative while the accounting entry derives the party-side amount and records any rounding difference through the normal exchange treatment.

The server also applies company, document, party, and account permissions while it finds and links candidates. This keeps the client from turning a visible search result into a reconciliation that the user cannot safely submit.

References: banking/…/BankReconciliation.tsx• L26-79 banking/…/BankReconciliation.tsx• L107-143 banking/…/MatchAndReconcile.tsx• L40-69 erpnext/…/bank_reconciliation_tool.py• L1060-1172 erpnext/…/bank_reconciliation_tool.py• L1319-1375 erpnext/…/bank_reconciliation_tool.py• L1563-1608 erpnext/…/bank_reconciliation_tool.py• L1630-1679 erpnext/…/bank_reconciliation_tool.py• L1723-1726 erpnext/…/bank_reconciliation_tool.py• L1014-1038 erpnext/…/bank_transaction.py• L156-239 erpnext/…/test_bank_reconciliation_tool.py• L134-188 erpnext/…/test_bank_reconciliation_tool.py• L242-292 erpnext/…/test_bank_reconciliation_tool.py• L337-424 erpnext/…/test_bank_reconciliation_tool.py• L498-563

Automatic reconciliation

Automatic reconciliation applies the same candidate matching process to unreconciled transactions in a selected scope. Small sets run at once, while larger sets run in background batches. The result reports fully reconciled and partially reconciled transactions so the remaining work stays visible.

Automatic matching is stricter than a ranked manual search. It requires the transaction reference to agree with the candidate for the supported payment, journal, and sales invoice flows. The process also limits work to bank transactions and linked documents that the current user can write, so a permission boundary does not create a false reconciliation result.

References: erpnext/…/bank_reconciliation_tool.py• L959-1036 erpnext/…/bank_reconciliation_tool.py• L1100-1195 erpnext/…/bank_reconciliation_tool.py• L1331-1380 erpnext/…/bank_reconciliation_tool.py• L1397-1447 erpnext/…/test_bank_reconciliation_tool.py• L53-101 erpnext/…/test_bank_reconciliation_tool.py• L190-205 erpnext/…/test_bank_reconciliation_tool.py• L698-716

Reconciliation states

A Bank Transaction records how much of its deposit or withdrawal has been allocated to accounting documents. Its state is therefore more useful than a simple yes-or-no match:

StateMeaning
Not reconciledNo amount is linked to an accounting document.
Partially reconciledSome amount is linked, but an unallocated amount remains.
ReconciledThe full bank amount is linked.
CancelledThe bank transaction was cancelled rather than available for matching.

The transaction record also uses Pending and Settled for stages around reconciliation. The transaction list exposes the allocation state with allocated and unallocated amounts. Users can undo a reconciliation to remove the link and return the amount to the work queue. Cancelling a linked accounting document also returns the bank transaction's amount to the unallocated state. This is distinct from cancelling the bank transaction itself or cancelling the accounting document for other business reasons.

References: erpnext/…/bank_transaction.json• L71-92 erpnext/…/bank_transaction.json• L123-151 erpnext/…/bank_transaction.json• L163-172 erpnext/…/bank_transaction.py• L54-95 erpnext/…/bank_transaction.py• L148-155 erpnext/…/test_bank_transaction.py• L50-121 banking/…/BankTransactionList.tsx• L100-177 banking/…/BankTransactionUnreconcileModal.tsx• L22-47

Payment reconciliation tool

Payment Reconciliation is a separate accounting tool for resolving open party balances. It fetches unreconciled payments, journal entries, invoices, and eligible notes for a company, party, and receivable or payable account. It then allocates payments against outstanding documents and updates the party ledger; it is not a replacement for matching an external bank transaction.

The tool supports date and amount filters, accounting dimensions, partial allocations, and foreign-currency differences. When a difference needs an accounting entry, the user selects the difference account and posting date before reconciliation completes. Access checks protect the company, account, party, and dimension scope used by the operation.

References: erpnext/…/payment_reconciliation.json• L48-170 erpnext/…/payment_reconciliation.py• L136-162 erpnext/…/payment_reconciliation.py• L374-425 erpnext/…/payment_reconciliation.py• L480-625 erpnext/…/payment_reconciliation.py• L660-677 erpnext/…/payment_reconciliation.js• L97-113 erpnext/…/payment_reconciliation.js• L266-433

Matching rules

Matching rules provide a second path for repeated bank activity. A rule checks the company, transaction direction, amount range, and description conditions before it classifies an unreconciled transaction as a bank entry, payment entry, or transfer. Description conditions can check text at the start, end, or anywhere in the description, or use a regular expression.

Rules run by priority, and the first matching rule is recorded on the bank transaction. A bank-entry rule can provide one account or several accounts, while a payment-entry rule carries the party and account context needed for the later accounting action. Rules classify transactions; they do not replace the accounting decision. The resulting classification guides the action that creates or links the accounting document, while the bank transaction remains the record of the external movement.

Evaluation runs on submitted unreconciled transactions. Scheduled evaluation normally skips transactions that already have a rule result, while an explicit run can evaluate them again. Invalid amount formulas and description patterns are rejected when a rule is saved, and a description check that exceeds its time limit is treated as no match.

References: erpnext/…/bank_transaction_rule.py• L20-55 erpnext/…/bank_transaction_rule.py• L71-84 erpnext/…/bank_transaction_rule.py• L89-156 erpnext/…/bank_transaction_rule.py• L178-243 erpnext/…/bank_transaction_rule.py• L246-314 erpnext/…/test_bank_transaction_rule.py• L76-173 erpnext/…/test_bank_transaction_rule.py• L175-296 erpnext/…/bank_transaction.json• L264-277 banking/…/MatchingRules.tsx• L24-42

Clearance and statement reporting

Clearance records when an accounting entry has reached the bank. Reconciliation links external bank activity to accounting entries, while clearance dates let the system distinguish entries that are posted in the ledger from entries that should already appear in the bank statement.

Clearance tracking

The clearance summary lists bank-related accounting entries for a date range and shows whether each entry has a clearance date. It covers submitted journal entries, payment entries, paid purchase invoices, and point-of-sale invoice payments that use the selected bank account. Users can set or change that date from the Banking client. The system guards against a clearance date that is earlier than the cheque date, and it provides an incorrect-clearance view for entries whose clearance date is earlier than their posting date.

Resetting an incorrect clearance date removes the date from the accounting document. Cancelling a reconciled bank transaction also removes the clearance effect from the linked entry. Cancelling a linked payment returns the bank transaction to an unallocated state, while amending that payment starts without the old clearance date. These actions correct different parts of the bank-to-ledger relationship and should not be treated as interchangeable.

References: erpnext/…/bank_clearance.py• L92-180 erpnext/…/bank_reconciliation_tool.py• L421-456 erpnext/…/bank_clearance_summary.py• L15-74 erpnext/…/bank_clearance_summary.py• L77-185 banking/…/BankClearanceSummary.tsx• L94-202 banking/…/IncorrectlyClearedEntries.tsx• L67-95 erpnext/…/test_bank_clearance.py• L86-110 erpnext/…/test_bank_clearance_summary.py• L36-118 erpnext/…/test_bank_transaction.py• L51-81 erpnext/…/test_bank_transaction.py• L106-135

Reconciliation statement

The Bank Reconciliation Statement explains the expected bank balance at a selected date. It starts with the ledger balance, accounts for outstanding cheques and deposits, adjusts for entries cleared at an invalid time, and produces a calculated statement balance. Its detail rows show the related document, account, reference, posting date, and clearance date.

The statement includes bank-side activity from journal entries, payment entries, paid purchase invoices, and optional point-of-sale transactions. It respects the selected company and finance book, and it reports amounts in the bank account currency. The calculated balance can be compared with the closing balance saved from an imported statement. A difference usually means that the bank activity or clearance state is not yet fully represented in the ledger. The Banking client also reports the opening balance, system closing balance, statement closing balance, difference, and reconciliation progress for the selected period.

References: erpnext/…/bank_reconciliation_statement.py• L16-62 erpnext/…/bank_reconciliation_statement.py• L116-139 erpnext/…/bank_reconciliation_statement.py• L142-271 erpnext/…/bank_reconciliation_statement.py• L274-356 erpnext/…/test_bank_reconciliation_statement.py• L25-76 banking/…/BankReconciliationStatement.tsx• L50-69 banking/…/BankReconciliationStatement.tsx• L235-310 banking/…/BankBalance.tsx• L29-47

Banking web client

Banking is a separate React web client that provides the focused reconciliation and import experience. ERPNext supplies its session, boot data, permissions, accounting documents, reports, and server calls, so the client is a user interface over the ERPNext accounting model rather than a separate accounting system.

ERPNext route boundary

ERPNext serves the Banking client at /banking and provides the session context that the client needs. The client checks the ERPNext login session, redirects unauthenticated users to ERPNext login, and uses the Frappe API for bank accounts, statement imports, bank transactions, matching, and reports. Its routes cover the reconciliation home page, statement upload, and import-log review.

The production build is emitted into ERPNext public assets and its HTML entry is copied into the ERPNext web directory. In development, the client requests a limited boot context from the ERPNext web handler so it can use the same session model as the deployed page.

References: banking/…/App.tsx• L14-55 banking/…/main.tsx• L9-41 erpnext/…/banking.py• L9-29 banking/vite.config.ts• L20-24 banking/package.json• L6-11

For the surrounding accounting model, read Accounting and finance. For the ledger-side rules that create and update financial entries, read Financial transaction posting.

Change checklist

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

  • Changes to the Bank Account company-account rules, linked ledger account, currency, or disabled state must stay aligned with the account picker, statement import permissions, and balance snapshot access.
  • Changes to stored statement closing balances must preserve date selection, company-account permissions, and the balance used by the reconciliation statement and Banking balance summary.
  • Changes to the Bank Transaction amount or allocation rules must stay aligned with the matching lists, transaction status labels, reconciliation progress, and balance calculations.
  • Changes to statement column detection or PDF table handling must preserve the import-log preview, the final transaction shape, and the saved closing balance used by the reconciliation statement.
  • Changes to Bank Statement Import source options, delimiter handling, or import status must preserve the preview, import-log review, and final Bank Transaction posting path.
  • Changes to direct CSV/XLSX upload or bank field mappings must preserve the permission checks, date conversion, row-level success and error counts, and the selected bank account on each created transaction.
  • Changes to matching rules must preserve company, direction, amount, and description conditions, priority order, the first-match result, and the evaluated flag used by scheduled and explicit runs.
  • Changes to rule classifications or their account, party, or amount settings must stay aligned with the accounting action that creates or links the document.
  • Changes to supported matching document types must update both the candidate search and the create-and-link actions so the client cannot offer a document that the server cannot reconcile.
  • Changes to matching amounts or reference filters must preserve the bank-side amount used for deposits and withdrawals, existing allocations, foreign-currency party-side conversion, and the stricter reference check used by automatic reconciliation.
  • Changes to payment creation or exchange-rate handling must preserve the authoritative bank-side amount and the accounting treatment for rounding differences.
  • Changes to Payment Reconciliation filters, allocation limits, or difference handling must preserve the invoice and payment query scope, party permissions, currency differences, and ledger updates.
  • Changes to clearance-date rules must be checked against the clearance summary, reconciliation statement, and incorrectly cleared entries report because each view uses the date for a different accounting question.
  • Changes to cancellation or amendment behavior must preserve the link between bank transaction allocation and the linked document's clearance date.
  • Changes to the Banking route or build output must preserve the ERPNext web entry point, boot session, asset path, and unauthenticated redirect.

Important failure modes

TriggerConsequenceGuard
The selected bank account is not a company account, is disabled, or points to a ledger account from another company.Statement import or reconciliation cannot use the account safely.Use an enabled company bank account linked to one non-group Bank account in the same company.
A statement closing balance is saved without access to the selected bank account.The balance used for comparison can be changed outside the permitted company scope.Enforce Bank Account write permission when saving a statement balance.
A file has no usable transaction mapping or a PDF has no detectable tables.The import cannot produce a reliable transaction preview or may contain no rows to post.Review the detected header, mapping, and PDF table selection before import.
A Google Sheet used for import is not publicly accessible.The import cannot read the sheet rows.Use a publicly accessible sheet with the required Bank Account column.
A direct upload uses an unsupported file type or a bank mapping does not match the source headers.Rows cannot be mapped into submitted Bank Transactions.Use CSV or XLSX with headers that match the selected bank's mapping.
A bank transaction currency differs from its bank account currency.The transaction cannot be posted as valid bank activity.Import or enter the transaction in the account currency.
A bank transaction keeps an unallocated amount.It stays unreconciled and can keep the system balance different from the statement balance.Match the remaining amount or create the suitable payment, bank entry, or transfer.
An internal transfer has different sent and received amounts.Matching against the wrong side can leave the bank transaction unmatched or allocate the wrong amount.Compare a deposit with the amount received into the selected bank account and a withdrawal with the amount paid from it.
A foreign-currency party account is reconciled without using the bank-side amount as the source amount.The new payment can have the wrong party-side value or fail to balance after exchange-rate rounding.Keep the bank-side amount authoritative and use the current exchange treatment for the party-side amount and residual.
A matching result or linked voucher is outside the user's company or permission scope.The result must be rejected or could expose an accounting document that the user cannot safely reconcile.Filter readable candidates and enforce write access for the bank transaction and linked voucher on the server.
An imported transaction has no matching reference for automatic reconciliation.Automatic reconciliation leaves it unreconciled even when its amount is similar to a posted entry.Review the bank reference and the candidate document before using automatic reconciliation.
A broad matching rule has higher priority than a more specific rule.The broad rule classifies the transaction first and prevents the intended rule from matching.Order specific rules before broad rules and re-evaluate transactions after changing rule order.
A rule contains an invalid amount formula or description pattern.The rule cannot be saved and cannot classify transactions.Use a supported amount expression and a valid description condition.
A description regular expression exceeds the allowed run time.The condition is treated as no match and the transaction may remain unreconciled or match a later rule.Use a bounded regular expression and review the transaction when no rule matches.
Payment Reconciliation is run without a valid company, party, or receivable/payable account scope.The tool cannot safely fetch or update the intended open balances.Select permitted company, party, account, and required invoice and payment records first.
A payment or journal amount is allocated above the invoice balance or remaining payment amount.Reconciliation is rejected and the party ledger remains unchanged.Keep each allocation within both the payment and invoice outstanding amounts.
A linked payment is cancelled or amended without considering reconciliation state.The bank transaction or clearance date can no longer reflect the accounting document correctly.Recheck the bank transaction allocation and clearance date after the document change.
A clearance date is earlier than the posting date.The entry appears in the incorrect-clearance report and weakens the statement balance calculation.Reset the clearing date or set a valid date after the posting date.
An unauthenticated user opens the Banking client.The client does not render the work space and sends the user to ERPNext login.Start from an active ERPNext session.

Key files

FileWhy to read it
banking/…/BankReconciliation.tsxShows the user-facing reconciliation work space and its five main views.
erpnext/…/bank_account.pyDefines the company bank account boundary, account selection, currency context, and statement balance access.
erpnext/…/bank_statement_import.jsonDefines the statement import record, its source options, review areas, and import status.
erpnext/…/bank_transaction.jsonDefines the bank activity record, allocation amounts, statuses, and rule links used by reconciliation.
erpnext/…/bank_transaction.pyDefines the bank transaction as the link between statement activity, allocation, clearance, and reconciliation state.
erpnext/…/bank_transaction_rule.pyDefines the conditions, priority order, classification, and scheduled evaluation of repeated bank activity.
erpnext/…/test_bank_transaction_rule.pyVerifies rule conditions, classification requirements, amount expressions, and invalid-pattern handling.
erpnext/…/bank_statement_import_log.pyExplains statement preview, file normalization, PDF handling, and creation of bank transactions.
erpnext/…/bank_transaction_upload.pyShows the direct CSV/XLSX upload path and the bank-specific field mapping used to create bank transactions.
erpnext/…/bank_reconciliation_tool.pyShows how matching, automatic reconciliation, new accounting entries, transfers, currency conversion, and clearance updates cross the client-server boundary.
erpnext/…/payment_reconciliation.pyShows the separate party-level flow for fetching, allocating, and reconciling open payments and invoices.
erpnext/…/bank_reconciliation_statement.pyDefines the balance explanation and the accounting entries included in the statement view.
erpnext/…/bank_clearance_summary.pyDefines the date-range view of cleared and uncleared bank-related entries.
banking/…/BankBalance.tsxShows how the client presents statement balance, system balance, difference, and progress.
banking/…/App.tsxShows the separate Banking routes, ERPNext session use, and statement import navigation.
erpnext/…/banking.pyShows the ERPNext web entry context used to boot the Banking client.
erpnext/…/test_bank_reconciliation_tool.pyVerifies date scoping, automatic reconciliation, bank-side amounts for transfers, foreign-currency payment amounts, permission boundaries, and reconciliation result messages.
erpnext/…/test_bank_transaction.pyVerifies matching, allocation recovery after cancellation, status reset, and clearance reset after amendment.
erpnext/…/test_payment_reconciliation.pyVerifies party-level allocation, date and amount filters, foreign-currency differences, and recovery after cancellation.
erpnext/…/test_bank_clearance_summary.pyVerifies clearance rows, date scope, tax-adjusted payment amounts, POS payments, and foreign-currency bank amounts.
erpnext/…/test_bank_reconciliation_statement.pyVerifies ledger balance, finance-book scope, invalid clearance treatment, and bank-currency reporting.