adamsaghy commented on code in PR #3885:
URL: https://github.com/apache/fineract/pull/3885#discussion_r1593964011
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/delinquency/service/DelinquencyReadPlatformServiceImpl.java:
##########
@@ -126,11 +126,32 @@ public CollectionData calculateLoanCollectionData(final
Long loanId) {
if (optLoan.isPresent()) {
final Loan loan = optLoan.get();
+ final LoanTransaction lastPayment =
loan.getLastPaymentTransaction();
+ final LoanTransaction lastRepaymentTransaction =
loan.getLastRepaymentOrDownPaymentTransaction();
+
// If the Loan is not Active yet, return template data
if (loan.isSubmittedAndPendingApproval() || loan.isApproved()) {
return CollectionData.template();
}
+ // If the Loan is Closed (Rejected, Closed written-off, Withdrawn
by Client, Closed with outstanding marked
+ // for
+ // reschedule, Closed obligation met) return template data with
last payment and repayment transaction
+ // details
+ if (loan.isClosed()) {
Review Comment:
Its not a big deal, but for rejected / withdrawn loan i dont think we could
have any payment / repayment, so returning template for them would be more
suitable. However i guess the same outcome happens this way as well. Right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]