Merge pull request #1558 from Musoni/MIFOSX-2371
MIFOSX-2371 fixed days in year issue
This commit is contained in:
Regular → Executable
+9
-2
@@ -786,10 +786,17 @@ public final class LoanApplicationTerms {
|
|||||||
|
|
||||||
private long calculatePeriodsInOneYear(final PaymentPeriodsInOneYearCalculator calculator) {
|
private long calculatePeriodsInOneYear(final PaymentPeriodsInOneYearCalculator calculator) {
|
||||||
|
|
||||||
long periodsInOneYear = calculator.calculate(this.repaymentPeriodFrequencyType).longValue();
|
//check if daysInYears is set if so change periodsInOneYear to days set in db
|
||||||
|
long periodsInOneYear;
|
||||||
|
boolean daysInYearToUse = (this.repaymentPeriodFrequencyType.getCode().equalsIgnoreCase("periodFrequencyType.days") && !this.daysInYearType.getCode().equalsIgnoreCase("DaysInYearType.actual"));
|
||||||
|
if(daysInYearToUse){
|
||||||
|
periodsInOneYear = this.daysInYearType.getValue().longValue();
|
||||||
|
}else{
|
||||||
|
periodsInOneYear = calculator.calculate(this.repaymentPeriodFrequencyType).longValue();
|
||||||
|
}
|
||||||
switch (this.interestCalculationPeriodMethod) {
|
switch (this.interestCalculationPeriodMethod) {
|
||||||
case DAILY:
|
case DAILY:
|
||||||
periodsInOneYear = calculator.calculate(PeriodFrequencyType.DAYS).longValue();
|
periodsInOneYear = (!this.daysInYearType.getCode().equalsIgnoreCase("DaysInYearType.actual")) ? this.daysInYearType.getValue().longValue() : calculator.calculate(PeriodFrequencyType.DAYS).longValue();
|
||||||
break;
|
break;
|
||||||
case INVALID:
|
case INVALID:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user