galovics commented on code in PR #2516:
URL: https://github.com/apache/fineract/pull/2516#discussion_r948800670
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -4022,7 +4023,8 @@ public boolean isOpen() {
private boolean isAllTranchesNotDisbursed() {
return this.loanProduct.isMultiDisburseLoan()
- && (LoanStatus.fromInt(this.loanStatus).isActive() ||
LoanStatus.fromInt(this.loanStatus).isApproved())
+ && (LoanStatus.fromInt(this.loanStatus).isActive() ||
LoanStatus.fromInt(this.loanStatus).isApproved()
Review Comment:
Same as above.
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -2537,7 +2537,8 @@ public boolean canDisburse(final LocalDate
actualDisbursementDate) {
LoanStatus.fromInt(this.loanStatus));
boolean isMultiTrancheDisburse = false;
- if (LoanStatus.fromInt(this.loanStatus).isActive() &&
isAllTranchesNotDisbursed()) {
+ if ((LoanStatus.fromInt(this.loanStatus).isActive() ||
LoanStatus.fromInt(this.loanStatus).isClosedObligationsMet()
Review Comment:
Couldn't we extract the LoanStatus.fromInt call before the if so it's not
called for every condition? Would make the code much cleaner.
--
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]