Merge pull request #1118 from pramodn02/develop

Develop
This commit is contained in:
Vishwas Babu A J
2014-10-31 00:49:05 -07:00
5 changed files with 10 additions and 10 deletions
@@ -867,7 +867,7 @@ public class AccountingScenarioIntegrationTest {
runOndate = dateFormat.format(todayDate.getTime());
this.periodicAccrualAccountingHelper.runPeriodicAccrualAccounting(runOndate);
float interestPerDay = totalInterest / totalDaysInPeriod;
float interestPerDay = (totalInterest / totalDaysInPeriod *4) - INTEREST_3_DAYS ;
interestPerDay = new Float(numberFormat.format(interestPerDay));
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(runOndate), interestPerDay, NEXT_FEE_PORTION,
NEXT_PENALTY_PORTION, loanID);
@@ -569,7 +569,7 @@ public class SchedulerJobsTestResults {
DateFormat monthDayFormat = new SimpleDateFormat("dd MMMM", Locale.US);
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -1);
todaysDate.add(Calendar.WEEK_OF_YEAR, -1);
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
@@ -77,7 +77,7 @@ public class StandingInstructionsHelper {
map.put("validTill", validTo);
map.put("recurrenceType", RECURRENCE_TYPE_PERIODIC);
map.put("recurrenceInterval", "1");
map.put("recurrenceFrequency", RECURRENCE_FREQUENCY_MONTHS);
map.put("recurrenceFrequency", RECURRENCE_FREQUENCY_WEEKS);
map.put("recurrenceOnMonthDay", monthDay);
String savingsApplicationJSON = new Gson().toJson(map);
System.out.println(savingsApplicationJSON);
@@ -152,7 +152,7 @@ public class LoanAccrualWritePlatformServiceImpl implements LoanAccrualWritePlat
updateCharges(loanChargeMap.get(accrualData.getLoanId()), accrualData, accrualData.getFromDateAsLocaldate(),
tilldate);
updateInterestIncome(accrualData, loanWaiverTansactions, loanWaiverSchedules, tilldate);
addAccrualTillSpecificDate(tilldate, accrualData, accruredTill);
addAccrualTillSpecificDate(tilldate, accrualData);
}
} else {
updateCharges(loanChargeMap.get(accrualData.getLoanId()), accrualData, accrualData.getFromDateAsLocaldate(),
@@ -176,8 +176,7 @@ public class LoanAccrualWritePlatformServiceImpl implements LoanAccrualWritePlat
return sb.toString();
}
private void addAccrualTillSpecificDate(final LocalDate tilldate, final LoanScheduleAccrualData accrualData,
final LocalDate accruredTill) throws Exception {
private void addAccrualTillSpecificDate(final LocalDate tilldate, final LoanScheduleAccrualData accrualData) throws Exception {
LocalDate interestStartDate = accrualData.getFromDateAsLocaldate();
if (accrualData.getInterestCalculatedFrom() != null
&& accrualData.getFromDateAsLocaldate().isBefore(accrualData.getInterestCalculatedFrom())) {
@@ -189,10 +188,7 @@ public class LoanAccrualWritePlatformServiceImpl implements LoanAccrualWritePlat
}
int totalNumberOfDays = Days.daysBetween(interestStartDate, accrualData.getDueDateAsLocaldate()).getDays();
LocalDate startDate = accruredTill;
if (startDate == null) {
startDate = accrualData.getFromDateAsLocaldate();
}
LocalDate startDate = accrualData.getFromDateAsLocaldate();
if (accrualData.getInterestCalculatedFrom() != null && startDate.isBefore(accrualData.getInterestCalculatedFrom())) {
if (accrualData.getInterestCalculatedFrom().isBefore(tilldate)) {
startDate = accrualData.getInterestCalculatedFrom();
@@ -222,6 +218,7 @@ public class LoanAccrualWritePlatformServiceImpl implements LoanAccrualWritePlat
if (totalAccInterest == null) {
totalAccInterest = BigDecimal.ZERO;
}
interestportion = interestportion.subtract(totalAccInterest);
amount = amount.add(interestportion);
totalAccInterest = totalAccInterest.add(interestportion);
if (interestportion.compareTo(BigDecimal.ZERO) == 0) {
@@ -1183,6 +1183,9 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final String defaultUserMessage = "Installment charge cannot be added to the loan.";
throw new LoanChargeCannotBeAddedException("loanCharge", "overdue.charge", defaultUserMessage, null, chargeDefinition.getName());
} else if(loanCharge.getDueLocalDate() != null && loanCharge.getDueLocalDate().isBefore(loan.getLastUserTransactionForChargeCalc())){
final String defaultUserMessage = "charge after last transaction date can not be added to loan.";
throw new LoanChargeCannotBeAddedException("loanCharge", "date.is.after.last.transaction.date", defaultUserMessage, null, chargeDefinition.getName());
}
final List<Long> existingTransactionIds = new ArrayList<>(loan.findExistingTransactionIds());