Skip to content

fix!: remove date filter from matched vouchers (backport #386)#395

Merged
barredterra merged 5 commits into
version-15-hotfixfrom
mergify/bp/version-15-hotfix/pr-386
Jul 17, 2026
Merged

fix!: remove date filter from matched vouchers (backport #386)#395
barredterra merged 5 commits into
version-15-hotfixfrom
mergify/bp/version-15-hotfix/pr-386

Conversation

@mergify

@mergify mergify Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

tl;dr: Payment Entry & Journal Entry in "Match Voucher" are no longer filtered by date, matching the other voucher types. We remove these filters wherever we don't need them.

Statement date filters were applied inconsistently: they scoped bank transactions and Payment Entry / Journal Entry matching, but not invoices or other voucher types. That made the same date fields mean different things depending on voucher type, and optional or partial dates could silently return no PE/JE matches.

Date filters now only define the statement period you are reconciling. Voucher discovery is per bank transaction and relies on ranking (amount, reference, party, date proximity) instead of hard date cutoffs, so older open invoices and backdated entries remain matchable.

Removed the reference-date filter UI because it only ever affected PE/JE and no longer matches how matching works.

Warning

Behavioral break for any get_matching_queries implementer (or user/API client) that relied on voucher date filtering. get_matching_queries keeps the old signature, but banking now always calls it with from_date=None, to_date=None, filter_by_reference_date=False. Hook implementers that still apply those date args will silently stop date-filtering (and may return more rows). HRMS does exactly that for Expense Claim matching.


This is an automatic backport of pull request #386 done by [Mergify](https://mergify.com).

(cherry picked from commit 85dac55)

# Conflicts:
#	banking/klarna_kosma_integration/doctype/bank_reconciliation_tool_beta/bank_reconciliation_tool_beta.json
#	banking/klarna_kosma_integration/doctype/bank_reconciliation_tool_beta/bank_reconciliation_tool_beta.py
@mergify mergify Bot added the conflicts label Jun 29, 2026
@mergify

This comment was marked as resolved.

@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the backport faithfully removes PE/JE date filters and is self-consistent across JS, Python, JSON, and tests.

The change is a clean removal of an inconsistent feature. The stdlib warnings.warn path directly fixes the concern raised in the prior thread. Date params in get_linked_payments are kept for backward compat with a proper deprecation notice. Tests were updated and a new regression test was added. No new blocking issues were found.

No files require special attention.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Client as "Browser / API Client"
    participant WL as "get_linked_payments"
    participant CM as "check_matching"
    participant GQ as "get_queries"
    participant PE as "get_pe_matching_query"
    participant JE as "get_je_matching_query"

    Note over Client,JE: BEFORE - date filters threaded all the way down
    Client->>WL: "from_date, to_date, filter_by_reference_date"
    WL->>CM: "from_date, to_date, filter_by_reference_date"
    CM->>GQ: "from_date, to_date, filter_by_reference_date"
    GQ->>PE: "WHERE posting_date / reference_date BETWEEN ..."
    GQ->>JE: "WHERE posting_date / cheque_date BETWEEN ..."

    Note over Client,JE: AFTER - date args accepted for compat but dropped
    Client->>WL: "from_date, to_date (legacy) or no date args"
    WL-->>Client: "DeprecationWarning if any date arg is not None"
    WL->>CM: "(no date args)"
    CM->>GQ: "common_filters only"
    GQ->>PE: "rank by amount / reference / party / date proximity"
    GQ->>JE: "ORDER BY posting_date (not cheque_date)"
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Client as "Browser / API Client"
    participant WL as "get_linked_payments"
    participant CM as "check_matching"
    participant GQ as "get_queries"
    participant PE as "get_pe_matching_query"
    participant JE as "get_je_matching_query"

    Note over Client,JE: BEFORE - date filters threaded all the way down
    Client->>WL: "from_date, to_date, filter_by_reference_date"
    WL->>CM: "from_date, to_date, filter_by_reference_date"
    CM->>GQ: "from_date, to_date, filter_by_reference_date"
    GQ->>PE: "WHERE posting_date / reference_date BETWEEN ..."
    GQ->>JE: "WHERE posting_date / cheque_date BETWEEN ..."

    Note over Client,JE: AFTER - date args accepted for compat but dropped
    Client->>WL: "from_date, to_date (legacy) or no date args"
    WL-->>Client: "DeprecationWarning if any date arg is not None"
    WL->>CM: "(no date args)"
    CM->>GQ: "common_filters only"
    GQ->>PE: "rank by amount / reference / party / date proximity"
    GQ->>JE: "ORDER BY posting_date (not cheque_date)"
Loading

Reviews (2): Last reviewed commit: "fix: emit deprecation via stdlib warning..." | Re-trigger Greptile

@barredterra
barredterra merged commit f8a2e4d into version-15-hotfix Jul 17, 2026
4 checks passed
@barredterra
barredterra deleted the mergify/bp/version-15-hotfix/pr-386 branch July 17, 2026 16:01
@barredterra

Copy link
Copy Markdown
Member

🎉 This PR is included in version 15.36.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

1 participant