-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FINERACT-2081: Fix Accrual activity - reverse and replayed couple of … #4334
base: develop
Are you sure you want to change the base?
Conversation
7502d1a
to
9691e6a
Compare
2e08ee9
to
58aac9c
Compare
@alberto-art3ch Kindly squash you commits! |
loanTransaction.reverse(); | ||
} else { | ||
loanTransaction.updateComponentsAndTotal(principalPortion, interestPortion, feeChargesPortion, penaltyChargesPortion); | ||
if (currentInstallment.isObligationsMet()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure you are not changing the transaction date in case the repayment date is later than the installment due date!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How must to be that? I mean we are processing here the Accrual Activity Loan Transaction, no the repayment transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only update the transaction date of an Accrual Activity transaction, if the obligations met date is earlier than the due date but later than the from date of the period and not the current installment is fully paid or overpaid, but the whole loan!
We want to change the existing accrual activity transaction date, if the loan got fully paid / overpaid earlier and that date if between the period from and due date!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! it is updated
@@ -122,7 +122,11 @@ public void processAccrualActivityForLoanClosure(@NotNull Loan loan) { | |||
|
|||
if (installmentAccruals.isEmpty()) { | |||
// No AAT for this installment; create one | |||
makeAccrualActivityTransaction(loan, installment, installment.getDueDate()); | |||
LocalDate transactionDate = installment.getDueDate(); | |||
if (loan.isOverPaid() && installment.getDueDate().isAfter(loan.getOverpaidOnDate())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only the overpayment situation? What about it was fully paid? Do we need this at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid of commenting out is not enough....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly see my review!
58aac9c
to
cd09fd0
Compare
…times after backdated repayment
cd09fd0
to
10a3df8
Compare
…times after backdated repayment
Description
Accrual activity is reversed and replayed couple of times after backdated repayment.
FINERACT-2081
select
over them_loan_transaction
tableChecklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Write the commit message as per https://github.com/apache/fineract/#pull-requests
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 coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/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
Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.