Allow to add charge with same disbursement date
This commit is contained in:
committed by
Arnold Gálovics
parent
7c6e85be10
commit
8954de5ded
+11
@@ -712,6 +712,17 @@ public class LoanCharge extends AbstractPersistableCustom {
|
||||
return target != null && target.isAfter(fromNotInclusive) && !target.isAfter(upToAndInclusive);
|
||||
}
|
||||
|
||||
public boolean isDueForCollectionFromIncludingAndUpToAndIncluding(final LocalDate fromNotInclusive, final LocalDate upToAndInclusive) {
|
||||
final LocalDate dueDate = getDueLocalDate();
|
||||
return occursOnDayFromAndIncludingAndUpToAndIncluding(fromNotInclusive, upToAndInclusive, dueDate);
|
||||
}
|
||||
|
||||
private boolean occursOnDayFromAndIncludingAndUpToAndIncluding(final LocalDate fromAndInclusive, final LocalDate upToAndInclusive,
|
||||
final LocalDate target) {
|
||||
return target != null && (target.isEqual(fromAndInclusive) || target.isAfter(fromAndInclusive))
|
||||
&& !target.isAfter(upToAndInclusive);
|
||||
}
|
||||
|
||||
public boolean isFeeCharge() {
|
||||
return !this.penaltyCharge;
|
||||
}
|
||||
|
||||
+4
@@ -894,4 +894,8 @@ public class LoanRepaymentScheduleInstallment extends AbstractAuditableWithUTCDa
|
||||
this.additional = true;
|
||||
}
|
||||
|
||||
public boolean isFirstPeriod() {
|
||||
return (this.installmentNumber == 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -118,6 +118,10 @@ public class LoanRepaymentScheduleProcessingWrapper {
|
||||
cumulative = cumulative.plus(loanChargeAmt);
|
||||
} else if (loanCharge.isDueForCollectionFromAndUpToAndIncluding(periodStart, periodEnd)) {
|
||||
cumulative = cumulative.plus(loanCharge.amount());
|
||||
// Special case for Loan Charges (Due Date) added the same disbursement date
|
||||
} else if (period.isFirstPeriod()
|
||||
&& loanCharge.isDueForCollectionFromIncludingAndUpToAndIncluding(periodStart, periodEnd)) {
|
||||
cumulative = cumulative.plus(loanCharge.amount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user