FINERACT-406 allow disbursal of topup loan on same date of transaction of previous loan

This commit is contained in:
Lionel Raymundi - Poincenot
2017-02-24 18:49:02 -03:00
parent c1af6d6685
commit c197614af6
2 changed files with 5 additions and 5 deletions
@@ -301,7 +301,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
"loanIdToClose is invalid, Currency code is different.");
}
final LocalDate lastUserTransactionOnLoanToClose = loanToClose.getLastUserTransactionDate();
if(!newLoanApplication.getDisbursementDate().isAfter(lastUserTransactionOnLoanToClose)){
if(newLoanApplication.getDisbursementDate().isBefore(lastUserTransactionOnLoanToClose)){
throw new GeneralPlatformDomainRuleException(
"error.msg.loan.disbursal.date.should.be.after.last.transaction.date.of.loan.to.be.closed",
"Disbursal date of this loan application "+newLoanApplication.getDisbursementDate()
@@ -710,7 +710,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
"loanIdToClose is invalid, Currency code is different.");
}
final LocalDate lastUserTransactionOnLoanToClose = loanToClose.getLastUserTransactionDate();
if(!existingLoanApplication.getDisbursementDate().isAfter(lastUserTransactionOnLoanToClose)){
if(existingLoanApplication.getDisbursementDate().isBefore(lastUserTransactionOnLoanToClose)){
throw new GeneralPlatformDomainRuleException(
"error.msg.loan.disbursal.date.should.be.after.last.transaction.date.of.loan.to.be.closed",
"Disbursal date of this loan application "+existingLoanApplication.getDisbursementDate()
@@ -1123,7 +1123,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
}
final LocalDate lastUserTransactionOnLoanToClose = loanToClose.getLastUserTransactionDate();
if(!loan.getDisbursementDate().isAfter(lastUserTransactionOnLoanToClose)){
if(loan.getDisbursementDate().isBefore(lastUserTransactionOnLoanToClose)){
throw new GeneralPlatformDomainRuleException(
"error.msg.loan.disbursal.date.should.be.after.last.transaction.date.of.loan.to.be.closed",
"Disbursal date of this loan application "+loan.getDisbursementDate()
@@ -1376,4 +1376,4 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
}
}
}
}
@@ -317,7 +317,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
"Loan to be closed with this topup is not active.");
}
final LocalDate lastUserTransactionOnLoanToClose = loanToClose.getLastUserTransactionDate();
if(!loan.getDisbursementDate().isAfter(lastUserTransactionOnLoanToClose)){
if(loan.getDisbursementDate().isBefore(lastUserTransactionOnLoanToClose)){
throw new GeneralPlatformDomainRuleException(
"error.msg.loan.disbursal.date.should.be.after.last.transaction.date.of.loan.to.be.closed",
"Disbursal date of this loan application "+loan.getDisbursementDate()