This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 2ae9166  LocalDate check should be according to timezone of tenant.
2ae9166 is described below

commit 2ae916618b40004d1118e44d7c71efaa2d3b4e6f
Author: Mohit Sinha <[email protected]>
AuthorDate: Thu Apr 11 00:24:33 2019 +0700

    LocalDate check should be according to timezone of tenant.
---
 .../java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java   | 4 ++--
 .../service/LoanWritePlatformServiceJpaRepositoryImpl.java            | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
index f880155..c7b6cc3 100755
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
@@ -2929,7 +2929,7 @@ public class Loan extends AbstractPersistableCustom<Long> 
{
         
validateRepaymentDateIsOnNonWorkingDay(paymentTransaction.getTransactionDate(), 
holidayDetailDTO.getWorkingDays(),
                 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.";
             throw new InvalidLoanStateTransitionException("charge.payment", 
"cannot.be.a.future.date", errorMessage,
                     paymentTransaction.getTransactionDate());
@@ -3767,7 +3767,7 @@ public class Loan extends AbstractPersistableCustom<Long> 
{
                     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.";
             throw new InvalidLoanStateTransitionException("close.reschedule", 
"cannot.be.a.future.date", errorMessage,
                     rescheduledOnLocalDate);
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
index 411974e..068265f 100755
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
@@ -1794,7 +1794,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl 
implements LoanWritePlatf
                             
.retrieveInstallmentLoanCharges(chargeData.getId(), true);
                     PortfolioAccountData portfolioAccountData = null;
                     for (final LoanInstallmentChargeData installmentChargeData 
: chargePerInstallments) {
-                        if (!installmentChargeData.getDueDate().isAfter(new 
LocalDate())) {
+                        if 
(!installmentChargeData.getDueDate().isAfter(DateUtils.getLocalDateOfTenant())) 
{
                             if (portfolioAccountData == null) {
                                 portfolioAccountData = 
this.accountAssociationsReadPlatformService.retriveLoanLinkedAssociation(chargeData
                                         .getLoanId());
@@ -1810,7 +1810,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl 
implements LoanWritePlatf
                             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
                             
.retriveLoanLinkedAssociation(chargeData.getLoanId());
                     final SavingsAccount fromSavingsAccount = null;

Reply via email to