feat: bank reconciliation rule#326
Closed
0xD0M1M0 wants to merge 40 commits intoalyf-de:version-15-hotfixfrom
Closed
feat: bank reconciliation rule#3260xD0M1M0 wants to merge 40 commits intoalyf-de:version-15-hotfixfrom
0xD0M1M0 wants to merge 40 commits intoalyf-de:version-15-hotfixfrom
Conversation
PatrickDEissler
requested changes
Dec 17, 2025
banking/klarna_kosma_integration/doctype/bank_reconciliation_rule/bank_reconciliation_rule.py
Outdated
Show resolved
Hide resolved
- filter by broader "Expense" type instead of "COGS" - Show Fee account only when Company Account is set (se we can always fetch the relevant filter values) - Fetch company and currency in the same query
clearance_date is set to None during submit, set afterwards to clear journal entry
barredterra
reviewed
Jan 27, 2026
barredterra
reviewed
Jan 27, 2026
…econcilation-rule
697555e to
0cf3e0c
Compare
- reduce nesting - catch JSONDecodeErrors
8bd10c7 to
ff920d9
Compare
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.
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds two main functionallities and a side functionallity:
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:
enforce_positive_valuesin documentation (after merge)