fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100...@apache.org
Subject [1/3] incubator-fineract git commit: MIFOSX-2400 : fix for overdue charges on payment time
Date Tue, 16 Feb 2016 12:50:14 GMT
Repository: incubator-fineract
Updated Branches:
  refs/heads/develop bb4799f58 -> 9c27413cf


MIFOSX-2400 : fix for overdue charges on payment time


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

Branch: refs/heads/develop
Commit: a13a80794fabe8bba6dc6e359006d7ab594f649d
Parents: bb4799f
Author: pramod <pramod@confluxtechnologies.com>
Authored: Mon Feb 15 16:01:32 2016 +0530
Committer: pramod <pramod@confluxtechnologies.com>
Committed: Mon Feb 15 16:01:32 2016 +0530

----------------------------------------------------------------------
 .../fineract/portfolio/loanaccount/domain/Loan.java    | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/a13a8079/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 dc37c7f..b59d4dc 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
@@ -1596,15 +1596,14 @@ public class Loan extends AbstractPersistable<Long> {
 
     private void recalculateLoanCharge(final LoanCharge loanCharge, final int penaltyWaitPeriod)
{
         BigDecimal amount = BigDecimal.ZERO;
-        if (loanCharge.isOverdueInstallmentCharge()) {
-            amount = calculateOverdueAmountPercentageAppliedTo(loanCharge, penaltyWaitPeriod);
-        } else {
-            amount = calculateAmountPercentageAppliedTo(loanCharge);
-        }
-
         BigDecimal chargeAmt = BigDecimal.ZERO;
         BigDecimal totalChargeAmt = BigDecimal.ZERO;
         if (loanCharge.getChargeCalculation().isPercentageBased()) {
+        	 if (loanCharge.isOverdueInstallmentCharge()) {
+                 amount = calculateOverdueAmountPercentageAppliedTo(loanCharge, penaltyWaitPeriod);
+             } else {
+                 amount = calculateAmountPercentageAppliedTo(loanCharge);
+             }
             chargeAmt = loanCharge.getPercentage();
             if (loanCharge.isInstalmentFee()) {
                 totalChargeAmt = calculatePerInstallmentChargeAmount(loanCharge);
@@ -1621,7 +1620,7 @@ public class Loan extends AbstractPersistable<Long> {
 
     private BigDecimal calculateOverdueAmountPercentageAppliedTo(final LoanCharge loanCharge,
final int penaltyWaitPeriod) {
         LoanRepaymentScheduleInstallment installment = loanCharge.getOverdueInstallmentCharge().getInstallment();
-        LocalDate graceDate = LocalDate.now().minusDays(penaltyWaitPeriod);
+        LocalDate graceDate = DateUtils.getLocalDateOfTenant().minusDays(penaltyWaitPeriod);
         Money amount = Money.zero(getCurrency());
         if (graceDate.isAfter(installment.getDueDate())) {
             amount = calculateOverdueAmountPercentageAppliedTo(installment, loanCharge.getChargeCalculation());


Mime
View raw message