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-115 : In Loan tranche details page if any tranche is added, Tranche disbursement charge is getting added twice
Date Mon, 13 Mar 2017 11:57:56 GMT
Repository: incubator-fineract
Updated Branches:
  refs/heads/develop f159e59c1 -> 121df4eb0


FINERACT-115 : In Loan tranche details page if any tranche is added, Tranche disbursement
charge is getting added twice


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

Branch: refs/heads/develop
Commit: df93ce64dbddfdeb6fe4f972705625f1baac5c1b
Parents: b36ba8e
Author: nazeer1100126 <nazeer.shaik@confluxtechnologies.com>
Authored: Wed Mar 8 18:17:17 2017 +0530
Committer: nazeer1100126 <nazeer.shaik@confluxtechnologies.com>
Committed: Wed Mar 8 18:23:01 2017 +0530

----------------------------------------------------------------------
 .../fineract/portfolio/loanaccount/domain/Loan.java     | 12 ++++++++----
 .../domain/LoanTrancheDisbursementCharge.java           |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/df93ce64/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 8b5a707..6deb432 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
@@ -5868,10 +5868,14 @@ public class Loan extends AbstractPersistableCustom<Long> {
         }
         return actualDisbursementDate;
     }
-
-    public void addTrancheLoanCharge(Charge charge) {
-        if (!trancheCharges.contains(charge)) {
-            trancheCharges.add(new LoanTrancheCharge(charge, this));
+    
+    public void addTrancheLoanCharge(final Charge charge) {
+        final List<Charge> appliedCharges = new ArrayList<>(); 
+        for(final LoanTrancheCharge loanTrancheCharge: this.trancheCharges){
+            appliedCharges.add(loanTrancheCharge.getCharge());
+        }
+        if (!appliedCharges.contains(charge)) {
+            this.trancheCharges.add(new LoanTrancheCharge(charge, this));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/df93ce64/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheDisbursementCharge.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheDisbursementCharge.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheDisbursementCharge.java
index d2258ce..56360bb 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheDisbursementCharge.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheDisbursementCharge.java
@@ -34,7 +34,7 @@ public class LoanTrancheDisbursementCharge extends AbstractPersistableCustom<Lon
     @JoinColumn(name = "loan_charge_id", referencedColumnName = "id", nullable = false)
     private LoanCharge loancharge;
     
-    @ManyToOne(cascade = CascadeType.PERSIST, optional = false)
+    @ManyToOne(cascade = CascadeType.ALL, optional = false)
     @JoinColumn(name="disbursement_detail_id", referencedColumnName = "id", nullable = false)
     private LoanDisbursementDetails loanDisbursementDetails; 
     


Mime
View raw message