FINERACT-2520: Add disbursement charges to total repayment expected in progressive loan schedule#5592
FINERACT-2520: Add disbursement charges to total repayment expected in progressive loan schedule#5592Wiki05 wants to merge 1 commit intoapache:developfrom
Conversation
|
@Wiki05 hii, somthing went wrong while the push, 3000+ file changes (+5 ,-1,135,822), please check, also make sure to sign your commits. |
a342c5a to
091cc1c
Compare
Hi @airajena , thank you for pointing that out! I've reset my branch and force-pushed a clean version. It now shows only 1 file changed and includes the commit sign-off as requested. Please let me know if it looks good now! |
| scheduleParams.incrementPeriodNumber(); | ||
| } | ||
|
|
||
| // Fix for FINERACT-2520: Ensure disbursement charges are added to total expected repayment |
There was a problem hiding this comment.
Please do not add such comments in the code unless required, this helps to keep code readable. These fixes comments/explaination of changes belong to PR description.
There was a problem hiding this comment.
Understood @airajena , I've removed the comment from the code now.
091cc1c to
7ef3b98
Compare
|
|
||
| if (chargesDueAtTimeOfDisbursement.compareTo(BigDecimal.ZERO) > 0) { | ||
| scheduleParams.addTotalRepaymentExpected(Money.of(currency, chargesDueAtTimeOfDisbursement, mc)); | ||
| } |
There was a problem hiding this comment.
Hi Can you add a unit test covering this case for coverage?
There was a problem hiding this comment.
Hi @Aman-Mittal , I've added a new unit test to LoanScheduleGeneratorTest.java that verifies the inclusion of disbursement charges in the total repayment. Please let me know if it looks good now!
7ef3b98 to
f0eff02
Compare
|
please run ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest as pre commit checks so ci checks don't fail |
f0eff02 to
9621f01
Compare
I have successfully run spotlessJavaApply locally using Java 21. I've amended the commit and force-pushed the formatted code. |
9621f01 to
a77bb35
Compare
|
Hi @Aman-Mittal , @airajena, I see that test-core-4 failed in the PostgreSQL/MySQL CI runs. I'm analyzing the logs to see if it's a decimal precision issue in the new unit test. I'll push a fix as soon as I identify the exact mismatch. |
please refer: Error: 1 unsigned commit(s). See CONTRIBUTING.md#signing-your-commits |
dabd9b1 to
3639349
Compare
Thank you for catching that! I've amended the commit with the -s flag to ensure it is properly signed. I've also included the decimal precision fix (stripTrailingZeros()) in this same commit to address the test-core-4 failure |
1a70750 to
2cefb6a
Compare
|
Hi @airajena , @Aman-Mittal . I have updated my GitHub primary email to match my local Git config and re-signed the commit using the -s flag. I have also implemented the stripTrailingZeros() precision fix in the unit test, which should resolve the previous test-core-4 failures. The PR is now ready for the automated checks to run. |
Please review the failing test cases and checks! |
2cefb6a to
aead4ef
Compare
Hi @adamsaghy , I have addressed the Checkstyle violation in the :fineract-progressive-loan module. I manually removed the trailing spaces on line 188 of LoanScheduleGeneratorTest.java and confirmed that ./gradlew checkstyleTest now passes locally using Java 21. I have force-pushed the amended commit with the -s flag to ensure the signature remains verified. Ready for the final CI run. |
|
please run ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest |
aead4ef to
618dc9f
Compare
|
I've verified my changes. While the global checkstyleMain reports legacy errors in other modules, I have confirmed that the :fineract-progressive-loan module (where my changes are) passes all checkstyle, spotbugs, and test tasks locally with Java 21. |
`What went wrong: [Incubating] Problems report is available at: file:///home/runner/work/fineract/fineract/build/reports/problems/problems-report.html |
618dc9f to
82f6bac
Compare
|
@airajena, I have manually corrected the indentation in LoanScheduleGeneratorTest.java to match the required 8-space alignment. Additionally, I have now configured GPG signing on my local environment. I've force-pushed the updated commit, which should now show the Verified badge and pass the Commit Signature check. |
|
I have completed the requested environment and formatting updates. Manual Formatting: I have corrected the indentation in LoanScheduleGeneratorTest.java to match the required 8-space alignment. |
|
82f6bac to
806448a
Compare
|
I have added the missing whitespace after the for keyword on line 238 and force-pushed the signed commit. |
|
@Wiki05 Yes, the issue is not with your PR. Can you please rebase this PR with latest |
806448a to
0fa863a
Compare
|
I have successfully rebased the PR with the latest develop branch as requested. The checks are now running against the updated codebase. |
|
Hi @adamsaghy , |
|
Signed-off-by: Wiki05 <vigneshdev1022@gmail.com> Signed-off-by: Vignesh <vigneshdev1022@gmail.com>
0fa863a to
fd33b1f
Compare

Description
This PR fixes FINERACT-2520 where disbursement charges were missing from the total repayment expected in the progressive loan schedule.
Changes
Updated ProgressiveLoanScheduleGenerator.java to explicitly add chargesDueAtTimeOfDisbursement to the scheduleParams.totalRepaymentExpected after the main repayment loop.
Impact
Ensures the final schedule model correctly reflects all initial charges, matching the logic used in cumulative loan models.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.