LocalDate check should be according to timezone of tenant.
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
3ee051cf57
commit
2ae916618b
+2
-2
@@ -2929,7 +2929,7 @@ public class Loan extends AbstractPersistableCustom<Long> {
|
|||||||
validateRepaymentDateIsOnNonWorkingDay(paymentTransaction.getTransactionDate(), holidayDetailDTO.getWorkingDays(),
|
validateRepaymentDateIsOnNonWorkingDay(paymentTransaction.getTransactionDate(), holidayDetailDTO.getWorkingDays(),
|
||||||
holidayDetailDTO.isAllowTransactionsOnNonWorkingDay());
|
holidayDetailDTO.isAllowTransactionsOnNonWorkingDay());
|
||||||
|
|
||||||
if (paymentTransaction.getTransactionDate().isAfter(new LocalDate())) {
|
if (paymentTransaction.getTransactionDate().isAfter(DateUtils.getLocalDateOfTenant())) {
|
||||||
final String errorMessage = "The date on which a loan charge paid cannot be in the future.";
|
final String errorMessage = "The date on which a loan charge paid cannot be in the future.";
|
||||||
throw new InvalidLoanStateTransitionException("charge.payment", "cannot.be.a.future.date", errorMessage,
|
throw new InvalidLoanStateTransitionException("charge.payment", "cannot.be.a.future.date", errorMessage,
|
||||||
paymentTransaction.getTransactionDate());
|
paymentTransaction.getTransactionDate());
|
||||||
@@ -3767,7 +3767,7 @@ public class Loan extends AbstractPersistableCustom<Long> {
|
|||||||
rescheduledOnLocalDate, getDisbursementDate());
|
rescheduledOnLocalDate, getDisbursementDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rescheduledOnLocalDate.isAfter(new LocalDate())) {
|
if (rescheduledOnLocalDate.isAfter(DateUtils.getLocalDateOfTenant())) {
|
||||||
final String errorMessage = "The date on which a loan is rescheduled cannot be in the future.";
|
final String errorMessage = "The date on which a loan is rescheduled cannot be in the future.";
|
||||||
throw new InvalidLoanStateTransitionException("close.reschedule", "cannot.be.a.future.date", errorMessage,
|
throw new InvalidLoanStateTransitionException("close.reschedule", "cannot.be.a.future.date", errorMessage,
|
||||||
rescheduledOnLocalDate);
|
rescheduledOnLocalDate);
|
||||||
|
|||||||
+2
-2
@@ -1794,7 +1794,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
.retrieveInstallmentLoanCharges(chargeData.getId(), true);
|
.retrieveInstallmentLoanCharges(chargeData.getId(), true);
|
||||||
PortfolioAccountData portfolioAccountData = null;
|
PortfolioAccountData portfolioAccountData = null;
|
||||||
for (final LoanInstallmentChargeData installmentChargeData : chargePerInstallments) {
|
for (final LoanInstallmentChargeData installmentChargeData : chargePerInstallments) {
|
||||||
if (!installmentChargeData.getDueDate().isAfter(new LocalDate())) {
|
if (!installmentChargeData.getDueDate().isAfter(DateUtils.getLocalDateOfTenant())) {
|
||||||
if (portfolioAccountData == null) {
|
if (portfolioAccountData == null) {
|
||||||
portfolioAccountData = this.accountAssociationsReadPlatformService.retriveLoanLinkedAssociation(chargeData
|
portfolioAccountData = this.accountAssociationsReadPlatformService.retriveLoanLinkedAssociation(chargeData
|
||||||
.getLoanId());
|
.getLoanId());
|
||||||
@@ -1810,7 +1810,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
transferFeeCharge(sb, accountTransferDTO);
|
transferFeeCharge(sb, accountTransferDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (chargeData.getDueDate() != null && !chargeData.getDueDate().isAfter(new LocalDate())) {
|
} else if (chargeData.getDueDate() != null && !chargeData.getDueDate().isAfter(DateUtils.getLocalDateOfTenant())) {
|
||||||
final PortfolioAccountData portfolioAccountData = this.accountAssociationsReadPlatformService
|
final PortfolioAccountData portfolioAccountData = this.accountAssociationsReadPlatformService
|
||||||
.retriveLoanLinkedAssociation(chargeData.getLoanId());
|
.retriveLoanLinkedAssociation(chargeData.getLoanId());
|
||||||
final SavingsAccount fromSavingsAccount = null;
|
final SavingsAccount fromSavingsAccount = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user