fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100...@apache.org
Subject incubator-fineract git commit: multi tranche loan validation add and foreclose issues for multi tranche issues fixed
Date Thu, 23 Jun 2016 12:10:44 GMT
Repository: incubator-fineract
Updated Branches:
  refs/heads/develop c31c46b6d -> 91a51698f


multi tranche loan validation add and foreclose issues for multi tranche issues fixed


Project: http://git-wip-us.apache.org/repos/asf/incubator-fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-fineract/commit/91a51698
Tree: http://git-wip-us.apache.org/repos/asf/incubator-fineract/tree/91a51698
Diff: http://git-wip-us.apache.org/repos/asf/incubator-fineract/diff/91a51698

Branch: refs/heads/develop
Commit: 91a51698fb8159a602614ed61325eac616b95227
Parents: c31c46b
Author: venkatconflux <venkata.conflux@confluxtechnologies.com>
Authored: Wed Jun 22 18:47:56 2016 +0530
Committer: venkatconflux <venkata.conflux@confluxtechnologies.com>
Committed: Wed Jun 22 18:47:56 2016 +0530

----------------------------------------------------------------------
 .../apache/fineract/portfolio/loanaccount/domain/Loan.java  | 8 +++++++-
 .../service/LoanWritePlatformServiceJpaRepositoryImpl.java  | 9 ++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/91a51698/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
----------------------------------------------------------------------
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 e0428b0..40ad978 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
@@ -6227,7 +6227,13 @@ public class Loan extends AbstractPersistable<Long> {
             }   
             
         }
-
+        
+        for(LoanDisbursementDetails loanDisbursementDetails : getDisbursementDetails()){
+            if(loanDisbursementDetails.actualDisbursementDate() == null){
+                 totalPrincipal = Money.of(currency, totalPrincipal.getAmount().subtract(loanDisbursementDetails.principal()));
+            }
+        }
+        
         LocalDate installmentStartDate = getDisbursementDate();
 
         if (newInstallments.size() > 0) {

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/91a51698/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
----------------------------------------------------------------------
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 c5ea298..3fee3c9 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
@@ -33,7 +33,6 @@ import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.fineract.accounting.journalentry.service.JournalEntryWritePlatformService;
-import org.apache.fineract.infrastructure.codes.data.CodeValueData;
 import org.apache.fineract.infrastructure.codes.domain.CodeValue;
 import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper;
 import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
@@ -2903,6 +2902,14 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
 
         String noteText = this.fromApiJsonHelper.extractStringNamed(LoanApiConstants.noteParamName,
element);
         LoanRescheduleRequest loanRescheduleRequest = null;
+        for (LoanDisbursementDetails loanDisbursementDetails : loan.getDisbursementDetails())
{
+            if (!loanDisbursementDetails.expectedDisbursementDateAsLocalDate().isAfter(transactionDate)
+                    && loanDisbursementDetails.actualDisbursementDate() == null)
{
+                final String defaultUserMessage = "The loan with undisbrsed tranche before
foreclosure cannot be foreclosed.";
+                throw new LoanForeclosureException("loan.with.undisbursed.tranche.before.foreclosure.cannot.be.foreclosured",
+                        defaultUserMessage, transactionDate);
+            }
+        }
         this.loanScheduleHistoryWritePlatformService.createAndSaveLoanScheduleArchive(loan.getRepaymentScheduleInstallments(),
                 loan, loanRescheduleRequest);
         


Mime
View raw message