fix for repayment intervals recalculation

This commit is contained in:
Vishwas Babu A J
2013-09-04 13:37:55 +05:30
parent d93f630c9b
commit 0e1c55f349
2 changed files with 13 additions and 19 deletions
@@ -26,8 +26,8 @@ public interface CalendarInstanceRepository extends JpaRepository<CalendarInstan
Collection<CalendarInstance> findByCalendarIdAndEntityTypeId(Long calendarId, Integer entityTypeId);
/**Should use in clause, can I do it without creating a new class?**/
/** Should use in clause, can I do it without creating a new class? **/
@Query("from CalendarInstance ci where ci.entityId in (select id from Loan loan where loan.client.id = :clientId and loan.group.id = :groupId and (loan.loanStatus = 100 or loan.loanStatus = 200 or loan.loanStatus = 300)) and ci.entityTypeId = 3")
List<CalendarInstance> findCalendarInstancesForActiveLoansByGroupIdAndClientId(@Param("clientId") Long clientId,
@Param("groupId") Long groupId);
List<CalendarInstance> findCalendarInstancesForActiveLoansByGroupIdAndClientId(@Param("groupId") Long groupId,
@Param("clientId") Long clientId);
}
@@ -2485,10 +2485,6 @@ public class Loan extends AbstractPersistable<Long> {
loanRepaymentInterval, frequency, workingDays);
}
if (isHolidayEnabled) {
// reset repayment date with new meeting date
newRepaymentDate = CalendarUtils.getNewRepaymentMeetingDate(recuringRule, meetingStartDate, oldDueDate,
loanRepaymentInterval, frequency, workingDays);
if (isHolidayEnabled) {
newRepaymentDate = HolidayUtil.getRepaymentRescheduleDateToIfHoliday(newRepaymentDate, holidays);
}
@@ -2498,11 +2494,9 @@ public class Loan extends AbstractPersistable<Long> {
loanRepaymentScheduleInstallment.updateFromDate(tmpFromDate);
tmpFromDate = newRepaymentDate;// update with new repayment
// date
} else {
}else {
tmpFromDate = oldDueDate;
}
}
}
}