fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100...@apache.org
Subject [1/2] incubator-fineract git commit: [MIFOSX-2656] - Accrual transaction should be added only on the first tranche disbursal
Date Tue, 24 May 2016 11:08:25 GMT
Repository: incubator-fineract
Updated Branches:
  refs/heads/develop 66eb337e3 -> 851b22d16


[MIFOSX-2656] - Accrual transaction should be added only on the first tranche disbursal


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

Branch: refs/heads/develop
Commit: 2faea6d27fc7714293b7685721c1b44a75b9028a
Parents: 7ae9b67
Author: Adi Narayana Raju <adi.raju@confluxtechnologies.com>
Authored: Tue May 24 14:47:28 2016 +0530
Committer: Adi Narayana Raju <adi.raju@confluxtechnologies.com>
Committed: Tue May 24 14:47:28 2016 +0530

----------------------------------------------------------------------
 .../portfolio/loanaccount/domain/Loan.java         | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/2faea6d2/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 dae03dd..04a497a 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
@@ -2286,7 +2286,8 @@ public class Loan extends AbstractPersistable<Long> {
          * selected
          **/
 
-        if (isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct()) {
+        if (isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct()
+        		&& ((isMultiDisburmentLoan() && getDisbursedLoanDisbursementDetails().size()
== 1) || !isMultiDisburmentLoan())) {
             final LoanTransaction interestAppliedTransaction = LoanTransaction.accrueInterest(getOffice(),
this, interestApplied,
                     actualDisbursementDate, createdDate, currentUser);
             this.loanTransactions.add(interestAppliedTransaction);
@@ -2296,7 +2297,19 @@ public class Loan extends AbstractPersistable<Long> {
 
     }
 
-    public void regenerateScheduleOnDisbursement(final ScheduleGeneratorDTO scheduleGeneratorDTO,
final boolean recalculateSchedule,
+    private List<LoanDisbursementDetails> getDisbursedLoanDisbursementDetails() {
+    	List<LoanDisbursementDetails> ret = new ArrayList<>();
+    	if(this.disbursementDetails != null && this.disbursementDetails.size() >
0){
+            for (LoanDisbursementDetails disbursementDetail : this.disbursementDetails) {
+                if (disbursementDetail.actualDisbursementDate() != null) {
+                    ret.add(disbursementDetail);
+                }
+            }
+    	}
+		return ret;
+	}
+
+	public void regenerateScheduleOnDisbursement(final ScheduleGeneratorDTO scheduleGeneratorDTO,
final boolean recalculateSchedule,
             final LocalDate actualDisbursementDate, BigDecimal emiAmount, final AppUser currentUser,
LocalDate nextPossibleRepaymentDate,
             Date rescheduledRepaymentDate) {
         boolean isEmiAmountChanged = false;


Mime
View raw message