-
Notifications
You must be signed in to change notification settings - Fork 36
feat(Bank Reconcilitation Beta): prioritize ranking parameters #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: version-15-hotfix
Are you sure you want to change the base?
Changes from all commits
399882a
ae40540
f6dba81
7519402
137f752
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,6 +29,13 @@ | |||||
| from banking.overrides.bank_transaction import CustomBankTransaction | ||||||
|
|
||||||
| MAX_QUERY_RESULTS = 150 | ||||||
| # Weights for ranking parameters | ||||||
| REF_RANK_WEIGHT = 3 # Reference field equality match | ||||||
| PARTY_RANK_WEIGHT = 2 # Party match | ||||||
| AMOUNT_RANK_WEIGHT = 2 # Amount match | ||||||
| DATE_RANK_WEIGHT = 1 # Date match | ||||||
| NAME_MATCH_WEIGHT = 3 # Name (Paid From) match | ||||||
| REF_MATCH_WEIGHT = 3 # Reference number found in transaction description | ||||||
|
|
||||||
|
|
||||||
| class BankReconciliationToolBeta(Document): | ||||||
|
|
@@ -607,11 +614,11 @@ def check_matching( | |||||
| # already covered in DB query | ||||||
| continue | ||||||
|
|
||||||
| # higher rank if voucher name is in bank transaction | ||||||
| # higher rank if voucher reference appears in bank transaction description | ||||||
| reference_no = voucher["reference_no"] | ||||||
| if reference_no and (reference_no.strip() in transaction.description): | ||||||
| voucher["rank"] += 1 | ||||||
| voucher["name_in_desc_match"] = 1 | ||||||
|
PatrickDEissler marked this conversation as resolved.
|
||||||
| voucher["name_in_desc_match"] = 1 | |
| voucher["ref_in_desc_match"] = 1 |
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new weighted rank_expression for unpaid Sales Invoices no longer includes currency_match (it’s still selected as currency_match, but it does not influence ordering anymore). This changes behavior vs. the previous ranking and may cause foreign-currency vouchers to rank similarly to same-currency ones. If currency is still intended to affect ranking, add it back with an explicit weight (or remove it from the select if it’s intentionally no longer used).
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as unpaid Sales Invoices: currency_match was previously part of the unpaid Purchase Invoice ranking but is now omitted from the weighted rank_expression while still being selected. If currency should still influence the ordering, include it with a weight; otherwise drop the currency_match column to avoid dead fields/misleading output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introducing weights changes the overall rank scale (it can now exceed the previously documented max rank). There is existing documentation in the ranking utilities describing a fixed min/max range; consider updating that note (or documenting the new expected range here) so future changes don’t rely on stale assumptions about rank values.