Merge pull request #563 from vishwasbabu/mifosx-436

Mifosx 436
This commit is contained in:
Vishwas Babu A J
2013-09-04 01:16:37 -07:00
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); 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") @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, List<CalendarInstance> findCalendarInstancesForActiveLoansByGroupIdAndClientId(@Param("groupId") Long groupId,
@Param("groupId") Long groupId); @Param("clientId") Long clientId);
} }
@@ -2485,10 +2485,6 @@ public class Loan extends AbstractPersistable<Long> {
loanRepaymentInterval, frequency, workingDays); loanRepaymentInterval, frequency, workingDays);
} }
if (isHolidayEnabled) {
// reset repayment date with new meeting date
newRepaymentDate = CalendarUtils.getNewRepaymentMeetingDate(recuringRule, meetingStartDate, oldDueDate,
loanRepaymentInterval, frequency, workingDays);
if (isHolidayEnabled) { if (isHolidayEnabled) {
newRepaymentDate = HolidayUtil.getRepaymentRescheduleDateToIfHoliday(newRepaymentDate, holidays); newRepaymentDate = HolidayUtil.getRepaymentRescheduleDateToIfHoliday(newRepaymentDate, holidays);
} }
@@ -2498,11 +2494,9 @@ public class Loan extends AbstractPersistable<Long> {
loanRepaymentScheduleInstallment.updateFromDate(tmpFromDate); loanRepaymentScheduleInstallment.updateFromDate(tmpFromDate);
tmpFromDate = newRepaymentDate;// update with new repayment tmpFromDate = newRepaymentDate;// update with new repayment
// date // date
} else { }else {
tmpFromDate = oldDueDate; tmpFromDate = oldDueDate;
} }
}
} }
} }