Skip to content

FINERACT-1315: Add accrual journal entries for loan transfers#5816

Open
San-43 wants to merge 3 commits intoapache:developfrom
San-43:FINERACT-1315-fix
Open

FINERACT-1315: Add accrual journal entries for loan transfers#5816
San-43 wants to merge 3 commits intoapache:developfrom
San-43:FINERACT-1315-fix

Conversation

@San-43
Copy link
Copy Markdown
Contributor

@San-43 San-43 commented Apr 29, 2026

Description

When a client is transferred between offices, active loans now create the expected accounting journal entries for the loan transfer transactions. This covers accrual accounting and the transfer flow for:

  • Transfer initiated
  • Transfer approved
  • Transfer withdrawn

Note

During manual validation, I also found that journal entries could be posted to the loan’s current office instead of the office stored on the loan transaction (2nd commit).

Loan transactions

image

Transfer initiated

2026-04-29_00-31_2

Transfer aproved

2026-04-29_00-32

Transfer withdraw (after another initiated)

image

@San-43 San-43 changed the title Fineract-1315: Add accrual journal entries for loan transfers FINERACT-1315: Add accrual journal entries for loan transfers Apr 29, 2026
Copy link
Copy Markdown
Member

@Aman-Mittal Aman-Mittal left a comment

Choose a reason for hiding this comment

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

Please address my concerns. While explain me your reasoning of the ticket implementation

@adamsaghy
Copy link
Copy Markdown
Contributor

@Aman-Mittal
Copy link
Copy Markdown
Member

@San-43 if possible can you also share all the api level logs.

Like this. If you have tested this on local environment.

What were the curls when creating loan product, offices, and loan transfer api curl that initiate transfer when you transfered the loan to one office to another.

I want to try something.

@San-43
Copy link
Copy Markdown
Contributor Author

San-43 commented Apr 29, 2026

@San-43 https://github.com/apache/fineract/actions/runs/25094912179/job/73538720134?pr=5816

Hi @adamsaghy seems like the problem was unrelated dependency resolution from Maven Central, not a code/test assertion failure. Either way i'm planning to update the PR so please do not rerun the tests yet.

> Could not resolve org.apache.rat:apache-rat:0.15.
     Required by:
         project :fineract-avro-schemas
      > Could not resolve org.apache.rat:apache-rat:0.15.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/rat/apache-rat/0.15/apache-rat-0.15.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/org/apache/rat/apache-rat/0.15/apache-rat-0.15.pom'. Received status code 403 from server: Forbidden

@San-43
Copy link
Copy Markdown
Contributor Author

San-43 commented Apr 29, 2026

@San-43 if possible can you also share all the api level logs.

Like this. If you have tested this on local environment.

What were the curls when creating loan product, offices, and loan transfer api curl that initiate transfer when you transfered the loan to one office to another.

I want to try something.

Sure, i'll share the logs along with the updated changes in the next few hours.

@Aman-Mittal
Copy link
Copy Markdown
Member

@San-43 if possible can you also share all the api level logs.

Like this. If you have tested this on local environment.

What were the curls when creating loan product, offices, and loan transfer api curl that initiate transfer when you transfered the loan to one office to another.

I want to try something.

Sure, i'll share the logs along with the updated changes in the next few hours.

@San-43 Great to hear, what I primarily want that curl logs of all activities you have done while testing this change in your local environment. You can extract those by recording network activity in chrome dev tools and download all network related activity.

My goal is that I can test those changes myself locally and automate those api calls in postman or BDD scripts.

@San-43
Copy link
Copy Markdown
Contributor Author

San-43 commented Apr 29, 2026

@San-43 if possible can you also share all the api level logs.

Like this. If you have tested this on local environment.

What were the curls when creating loan product, offices, and loan transfer api curl that initiate transfer when you transfered the loan to one office to another.

I want to try something.

Sure, i'll share the logs along with the updated changes in the next few hours.

@San-43 Great to hear, what I primarily want that curl logs of all activities you have done while testing this change in your local environment. You can extract those by recording network activity in chrome dev tools and download all network related activity.

My goal is that I can test those changes myself locally and automate those api calls in postman or BDD scripts.

Sounds good @Aman-Mittal. I’ll try it in postman too. Maybe I can just share the Postman collection instead.

@San-43
Copy link
Copy Markdown
Contributor Author

San-43 commented Apr 30, 2026

Hi again @Aman-Mittal, I pushed the latest changes.

I also put together the manual API validation flow with the curls: FINERACT-1315-api-evidence.md

And I created a Postman collection in case you want to run the same flow locally. It creates two fresh clients on each run, one for the initiated/approved transfer flow and another for the withdrawal flow. It also creates the CDMX office if it does not already exist: FINERACT-1315-postman_collection.json

The breaking changes reported in the failing test are all under working-capital loan endpoints and report id changing from string to integer. It seems unrelated to my latest commit.

And here are some screenshots of the results:

Clients

image

Loan transactions for "San Mart"

image

Transfer initiated

image

Transfer approved

image

Loan transactions for "san mart withdraw"

image

Transfer initiated

image

Transfer withdrawn

image

@Aman-Mittal
Copy link
Copy Markdown
Member

@San-43 thanks will try to review it.

@adamsaghy I may be little late to continue my review in that case can you review rest of the PR?

@adamsaghy
Copy link
Copy Markdown
Contributor

@San-43 Can you please rebase this PR? (it might be out of sync -> hence https://github.com/apache/fineract/actions/runs/25137677428/job/73683248999?pr=5816 failure

@San-43 San-43 force-pushed the FINERACT-1315-fix branch from a4fce59 to 5496a8a Compare April 30, 2026 16:27
@San-43
Copy link
Copy Markdown
Contributor Author

San-43 commented Apr 30, 2026

@San-43 Can you please rebase this PR? (it might be out of sync -> hence https://github.com/apache/fineract/actions/runs/25137677428/job/73683248999?pr=5816 failure

Done.

@San-43
Copy link
Copy Markdown
Contributor Author

San-43 commented Apr 30, 2026

Hi again @adamsaghy api compatibility and shard 1 failed to load dependencies while shard 9 seems unrelated.

org.opentest4j.AssertionFailedError: expected: 600L but was: 700L at org.apache.fineract.test.messaging.event.EventCheckHelper.lambda$loanAccountDataV1Check$6(EventCheckHelper.java:214) at org.apache.fineract.test.messaging.EventAssertion$EventAssertionBuilder.extractingData(EventAssertion.java:145) at org.apache.fineract.test.messaging.event.EventCheckHelper.loanAccountDataV1Check(EventCheckHelper.java:179) at org.apache.fineract.test.messaging.event.EventCheckHelper.loanBalanceChangedEventCheck(EventCheckHelper.java:166) at org.apache.fineract.test.stepdef.loan.LoanStepDef.createCBR(LoanStepDef.java:629) at ✽.Admin makes Credit Balance Refund transaction on "15 April 2024" with 15 EUR transaction amount(file:///home/runner/work/fineract/fineract/fineract-e2e-tests-runner/src/test/resources/features/LoanCapitalizedIncome-Part2.feature:720)

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