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: FINERACT-182
Date Thu, 23 Jun 2016 12:15:36 GMT
Repository: incubator-fineract
Updated Branches:
  refs/heads/develop 91a51698f -> e2b0084c9


FINERACT-182


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

Branch: refs/heads/develop
Commit: 8894269543a1aea893b32216952ea366c45ed205
Parents: c31c46b
Author: venkatconflux <venkata.conflux@confluxtechnologies.com>
Authored: Thu Jun 23 14:37:37 2016 +0530
Committer: venkatconflux <venkata.conflux@confluxtechnologies.com>
Committed: Thu Jun 23 14:37:37 2016 +0530

----------------------------------------------------------------------
 .../integrationtests/ClientLoanIntegrationTest.java     | 12 ++++++------
 .../fineract/portfolio/loanaccount/domain/Loan.java     | 11 +++++++++--
 .../portfolio/loanaccount/domain/LoanCharge.java        |  4 ++++
 3 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/88942695/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
index 9a241a2..b2a737c 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
@@ -1890,9 +1890,9 @@ public class ClientLoanIntegrationTest {
         loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
         validateCharge(flatInstallmentFee, loanCharges, "50", "100.00", "50.0", "50.0");
 
-        this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September
2011", new JournalEntry(Float.valueOf("50.0"),
+        this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November
2011", new JournalEntry(Float.valueOf("50.0"),
                 JournalEntry.TransactionType.CREDIT));
-        this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 September
2011",
+        this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 November
2011",
                 new JournalEntry(Float.valueOf("50.0"), JournalEntry.TransactionType.DEBIT));
 
         System.out.println("----------Make repayment 2------------");
@@ -2079,9 +2079,9 @@ public class ClientLoanIntegrationTest {
         loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
         validateCharge(percentageInstallmentFee, loanCharges, "1", "61.19", "29.11", "29.70");
 
-        this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September
2011", new JournalEntry(Float.valueOf("29.7"),
+        this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November
2011", new JournalEntry(Float.valueOf("29.7"),
                 JournalEntry.TransactionType.CREDIT));
-        this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 September
2011",
+        this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 November
2011",
                 new JournalEntry(Float.valueOf("29.7"), JournalEntry.TransactionType.DEBIT));
 
         System.out.println("----------Make repayment 2------------");
@@ -2280,9 +2280,9 @@ public class ClientLoanIntegrationTest {
         loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
         validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, "1", "63.02",
"31.51", "31.51");
 
-        this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September
2011", new JournalEntry(
+        this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November
2011", new JournalEntry(
                 Float.valueOf("31.51"), JournalEntry.TransactionType.CREDIT));
-        this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 September
2011",
+        this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 November
2011",
                 new JournalEntry(Float.valueOf("31.51"), JournalEntry.TransactionType.DEBIT));
 
         System.out.println("----------Make repayment 2------------");

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/88942695/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..f55111e 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
@@ -972,9 +972,16 @@ public class Loan extends AbstractPersistable<Long> {
         }
 
         LocalDate transactionDate = getDisbursementDate();
-        if (loanCharge.isSpecifiedDueDate()) {
-            transactionDate = loanCharge.getDueLocalDate();
+        if (loanCharge.isDueDateCharge()) {
+            if (loanCharge.getDueLocalDate().isAfter(DateUtils.getLocalDateOfTenant())) {
+                transactionDate = DateUtils.getLocalDateOfTenant();
+            } else {
+                transactionDate = loanCharge.getDueLocalDate();
+            }
+        }else if(loanCharge.isInstalmentFee()){
+            transactionDate = loanCharge.getInstallmentLoanCharge(loanInstallmentNumber).getRepaymentInstallment().getDueDate();
         }
+        
         scheduleGeneratorDTO.setRecalculateFrom(transactionDate);
 
         updateSummaryWithTotalFeeChargesDueAtDisbursement(deriveSumTotalOfChargesDueAtDisbursement());

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/88942695/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java
index ee2c382..0c0bcbf 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java
@@ -987,4 +987,8 @@ public class LoanCharge extends AbstractPersistable<Long> {
     public boolean isTrancheDisbursementCharge() {
         return ChargeTimeType.fromInt(this.chargeTime).equals(ChargeTimeType.TRANCHE_DISBURSEMENT);
     }
+    
+    public boolean isDueDateCharge() {
+        return this.dueDate != null;
+    }
 }
\ No newline at end of file


Mime
View raw message