Skip to content

FINERACT-2838: Transaction summary report - Exclude re-age and fix amortization mapping sign - #6463

Merged
adamsaghy merged 3 commits into
apache:developfrom
openMF:FINERACT-2838/transaction-summary-report-exclude-reage-fix-amortization-sign
Sep 23, 2026
Merged

adamsaghy merged 3 commits into
apache:developfrom
openMF:FINERACT-2838/transaction-summary-report-exclude-reage-fix-amortization-sign

Conversation

@oleksii-novikov-onix

@oleksii-novikov-onix oleksii-novikov-onix commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

FINERACT-2838: Transaction Summary Report and Transaction Summary Report with Asset Owner

Re-age / re-amortize exclusion

Re-age (29) and re-amortize (30) transactions are now excluded from both reports, the same way other non-reportable types are already skipped. Neither transaction moves money, so it should not produce report rows.

Amortization mapping sign fix (Transaction Summary Report with Asset Owner)

Amortization transactions are reported per base transaction using m_loan_amortization_allocation_mapping. Each mapping row stores a positive amount typed AM or AM_ADJ. The amortization transaction amount is the net of these rows (sum of AM minus sum of AM_ADJ), and its type depends on the sign of the net. Until now every mapping row was reported as positive, so when one transaction netted both kinds of rows (for example, two backdated adjustments on different base transactions), the reported amounts did not add up to the transaction amount.

The minority mapping type is now negated, so the reported rows add up to the transaction net:

  • Capitalized Income Amortization (36) and Buy Down Fee Amortization (42): AM_ADJ rows are negated
  • Capitalized Income Amortization Adjustment (39) and Buy Down Fee Amortization Adjustment (43): AM rows are negated

The fix is applied to both the posted and reversed amortization CTEs, for PostgreSQL and MySQL.

MySQL schema change

On MySQL, stretchy_report.report_sql is widened from TEXT to MEDIUMTEXT (changeset 0254-0). The updated MySQL SQL for the Asset Owner report is about 66 KB, which is over the 65,535-byte TEXT limit. The column is nullable and has no default, so no constraints are lost. PostgreSQL is not affected.

Tests

New E2E scenarios in Reporting.feature:

  • UC04: a Buy Down Fee Amortization Adjustment netted from AM and AM_ADJ rows of two different buy down fees is reported with the correct sign
  • UC05: the same case for Capitalized Income Amortization Adjustment
  • UC06: a live re-age and a re-amortization, each with its later undo, are excluded from both reports on their own days

Existing scenarios were extended to cover re-age undo and buy down fee / capitalized income adjustments.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.
  • If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.
  • I followed the AI Policy.

Your assigned reviewer(s) will follow our guidelines for code reviews.

@oleksii-novikov-onix
oleksii-novikov-onix force-pushed the FINERACT-2838/transaction-summary-report-exclude-reage-fix-amortization-sign branch from 24b5416 to a1ccba9 Compare September 18, 2026 11:20
@ruzeynalov
ruzeynalov force-pushed the FINERACT-2838/transaction-summary-report-exclude-reage-fix-amortization-sign branch from 81d0476 to e1d5533 Compare September 21, 2026 13:40
@oleksii-novikov-onix
oleksii-novikov-onix force-pushed the FINERACT-2838/transaction-summary-report-exclude-reage-fix-amortization-sign branch 2 times, most recently from 0562f75 to 0e6f407 Compare September 22, 2026 10:36
…fix to capitalized income and exclude re-amortize
@oleksii-novikov-onix
oleksii-novikov-onix force-pushed the FINERACT-2838/transaction-summary-report-exclude-reage-fix-amortization-sign branch from 0e6f407 to 2398541 Compare September 22, 2026 14:24
@adamsaghy
adamsaghy marked this pull request as ready for review September 23, 2026 10:53

@adamsaghy adamsaghy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adamsaghy
adamsaghy merged commit 95d4447 into apache:develop Sep 23, 2026
185 of 186 checks passed
@adamsaghy
adamsaghy deleted the FINERACT-2838/transaction-summary-report-exclude-reage-fix-amortization-sign branch September 23, 2026 10:59
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.

3 participants