Skip to content

Fix: out of range transactions fix on supplemental txns - 3821#3851

Open
AlexZorkin wants to merge 2 commits intodevelopfrom
fix/alex-line-22-3821
Open

Fix: out of range transactions fix on supplemental txns - 3821#3851
AlexZorkin wants to merge 2 commits intodevelopfrom
fix/alex-line-22-3821

Conversation

@AlexZorkin
Copy link
Collaborator

Fix Summary

Issue: Supplemental reports assessed after the compliance period ended were excluded from Line 17, causing incorrect Line 22 values.

Root Cause: Code checked transaction create_date instead of the report's compliance_period to determine if a transaction should be included in the period's available balance.

Fix: Modified calculate_line_17_available_balance_for_period() to:

  1. Join to CompliancePeriod table to get the report's period year
  2. Check if report_compliance_period <= target_period instead of create_date <= period_end_date
  3. Maintain fallback to create_date for historical data without period info

Result: Supplemental reports are now correctly included in Line 17 based on which period they belong to, regardless of when they were assessed. This automatically fixes Line 22 since it's calculated as Line 17 + Line 20.

@AlexZorkin AlexZorkin changed the title fix: out of range transactions fix on supplemental txns Fix: out of range transactions fix on supplemental txns - 3821 Feb 6, 2026
@AlexZorkin AlexZorkin requested a review from prv-proton February 6, 2026 02:09
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Backend Test Results

1 517 tests   1 515 ✅  11m 27s ⏱️
   43 suites      1 💤
    1 files        1 ❌

For more details on these failures, see this check.

Results for commit 878729b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Frontend Test Results

    1 files    310 suites   3m 19s ⏱️
5 056 tests 5 038 ✅ 18 💤 0 ❌
5 066 runs  5 048 ✅ 18 💤 0 ❌

Results for commit 878729b.

♻️ This comment has been updated with latest results.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant