Skip to content

feat: bank reconciliation rule#326

Closed
0xD0M1M0 wants to merge 40 commits intoalyf-de:version-15-hotfixfrom
0xD0M1M0:bank-reconcilation-rule
Closed

feat: bank reconciliation rule#326
0xD0M1M0 wants to merge 40 commits intoalyf-de:version-15-hotfixfrom
0xD0M1M0:bank-reconcilation-rule

Conversation

@0xD0M1M0
Copy link
Contributor

@0xD0M1M0 0xD0M1M0 commented Dec 16, 2025

This PR adds two main functionallities and a side functionallity:

  1. Book included bank fees to a selected account
  2. Book bank transactions based on preset rules
  3. Convert all negative values for deposit, withdrawal and included_fee/excluded fee into positive values

The order of applied functions is 3, 1 and 2. All values are converted into positive values, then bank fees are booked and if unreconciled values remain, bank reconciliation rules are applied.

Function 1:
Bank fees saved in the included_fee field in ERPNext (depends frappe/erpnext#51112) are booked on submit to a specific bank fee account. This account is specified in the "Bank Account".

Function 2:
On submit, the bank transaction is checked if it matches one pre-set booking rule in the DocType "Bank Reconciliation Rule". If it matches, the full unallocated amount is booked to an "Account" specified in the rule. Partical bookings are not supported. Also no matching with invoices is done. It purely books the bank transaction to an Account.

Function 3:
This support function eliminates import errors as all values in the fields deposit, withdrawal, included_fee and excluded fee need to be positive.

This PR works also with Bank Statement imports and bank imports, as they are applied to the Bank Transaction directly.

To Do:

  • Mention enforce_positive_values in documentation (after merge)
  • Put both Fee and Reco Rule into the same Journal Entry(?) -> No
  • Link Fee Journal Entry to Bank Transaction, so they are traceable and cancelled together

@barredterra barredterra self-requested a review December 16, 2025 14:53
@PatrickDEissler PatrickDEissler self-requested a review December 16, 2025 16:19
@PatrickDEissler PatrickDEissler removed their request for review December 19, 2025 08:55
@barredterra barredterra force-pushed the bank-reconcilation-rule branch from 697555e to 0cf3e0c Compare February 2, 2026 15:15
@barredterra barredterra force-pushed the bank-reconcilation-rule branch from 8bd10c7 to ff920d9 Compare February 2, 2026 17:24
@0xD0M1M0
Copy link
Contributor Author

In case the bank rule did not work correctly or the accountant decides to assign a different account and cancels the journal entry of the rule, the fee should stay untouched and booked to the fee account. I therefore opt for two separate journal entries. One for the bank fee and one for the rule. In this case the accountant even can use the bank reconciliation tool to reasign the bank transaction without touching the bank fee again.

- type hints
- optional parameters last
- pass atomic values instead of doc
Otherwise existing sites will break because they don't have a Bank Fee Account specified yet.
@barredterra
Copy link
Member

Split into smaller PRs: #345, #346, #347

This way it's easier to reason about and iterate on each feature separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants