Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4B45C200B32 for ; Thu, 23 Jun 2016 14:10:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 49AAD160A59; Thu, 23 Jun 2016 12:10:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 696C2160A58 for ; Thu, 23 Jun 2016 14:10:50 +0200 (CEST) Received: (qmail 81999 invoked by uid 500); 23 Jun 2016 12:10:49 -0000 Mailing-List: contact commits-help@fineract.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@fineract.incubator.apache.org Delivered-To: mailing list commits@fineract.incubator.apache.org Received: (qmail 81987 invoked by uid 99); 23 Jun 2016 12:10:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2016 12:10:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 32653C0015 for ; Thu, 23 Jun 2016 12:10:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.648 X-Spam-Level: X-Spam-Status: No, score=-4.648 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.428] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 08bK4EWBsNXu for ; Thu, 23 Jun 2016 12:10:46 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 7DE935F245 for ; Thu, 23 Jun 2016 12:10:45 +0000 (UTC) Received: (qmail 81788 invoked by uid 99); 23 Jun 2016 12:10:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2016 12:10:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3614BE38B1; Thu, 23 Jun 2016 12:10:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nazeer1100126@apache.org To: commits@fineract.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) archived-at: Thu, 23 Jun 2016 12:10:51 -0000 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 Authored: Wed Jun 22 18:47:56 2016 +0530 Committer: venkatconflux 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 { } } - + + 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);