Repository: incubator-fineract
Updated Branches:
  refs/heads/develop 1873db645 -> 14a1216d0


FINERACT-418 penalties should be applied until the day before running job


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

Branch: refs/heads/develop
Commit: a7b27d6d363198c6017408a768d90015b047ef0c
Parents: 8cc560c
Author: Lionel Raymundi - Poincenot <lio...@poincenot.com>
Authored: Sun Mar 19 23:11:29 2017 -0300
Committer: Lionel Raymundi - Poincenot <lio...@poincenot.com>
Committed: Sun Mar 19 23:11:29 2017 -0300

----------------------------------------------------------------------
 .../service/LoanWritePlatformServiceJpaRepositoryImpl.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/a7b27d6d/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
----------------------------------------------------------------------
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
index 4f02d2e..abb6353 100755
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
@@ -2395,15 +2395,15 @@ public class LoanWritePlatformServiceJpaRepositoryImpl 
implements LoanWritePlatf
         final Long penaltyPostingWaitPeriodValue = 
this.configurationDomainService.retrieveGraceOnPenaltyPostingPeriod();
         final LocalDate dueDate = 
command.localDateValueOfParameterNamed("dueDate");
         Long diff = penaltyWaitPeriodValue + 1 - penaltyPostingWaitPeriodValue;
-        if (diff < 0) {
-            diff = 0L;
+        if (diff < 1) {
+            diff = 1L;
         }
         LocalDate startDate = 
dueDate.plusDays(penaltyWaitPeriodValue.intValue() + 1);
         Integer frequencyNunber = 1;
         if (feeFrequency == null) {
             scheduleDates.put(frequencyNunber++, 
startDate.minusDays(diff.intValue()));
         } else {
-            while (DateUtils.getLocalDateOfTenant().isAfter(startDate)) {
+            while (!startDate.isAfter(DateUtils.getLocalDateOfTenant())) {
                 scheduleDates.put(frequencyNunber++, 
startDate.minusDays(diff.intValue()));
                 LocalDate scheduleDate = 
scheduledDateGenerator.getRepaymentPeriodDate(PeriodFrequencyType.fromInt(feeFrequency),
                         chargeDefinition.feeInterval(), startDate, null, null);

Reply via email to