You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by na...@apache.org on 2016/05/24 11:08:25 UTC

[1/2] incubator-fineract git commit: [MIFOSX-2656] - Accrual transaction should be added only on the first tranche disbursal

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 <ad...@confluxtechnologies.com>
Authored: Tue May 24 14:47:28 2016 +0530
Committer: Adi Narayana Raju <ad...@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;


[2/2] incubator-fineract git commit: Merge branch 'MIFOSX-2656' into develop

Posted by na...@apache.org.
Merge branch 'MIFOSX-2656' into develop


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

Branch: refs/heads/develop
Commit: 851b22d166b266ec78750543b207893e5d170345
Parents: 66eb337 2faea6d
Author: Nazeer Hussain Shaik <na...@confluxtechnologies.com>
Authored: Tue May 24 16:35:03 2016 +0530
Committer: Nazeer Hussain Shaik <na...@confluxtechnologies.com>
Committed: Tue May 24 16:35:03 2016 +0530

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