use of org.mifos.customers.business.CustomerScheduleEntity in project head by mifos.
the class GenerateMeetingsForCustomerAndSavingsBatchJobIntegrationTest method assertThatEachScheduleHasFeesDueOf.
private void assertThatEachScheduleHasFeesDueOf(Set<AccountActionDateEntity> customerSchedules, double feesDue) {
for (AccountActionDateEntity accountActionDateEntity : customerSchedules) {
CustomerScheduleEntity customerSchedule = (CustomerScheduleEntity) center.getCustomerAccount().getAccountActionDate(accountActionDateEntity.getInstallmentId());
assertThat(customerSchedule.getTotalFees().getAmountDoubleValue(), is(feesDue));
}
}
use of org.mifos.customers.business.CustomerScheduleEntity in project head by mifos.
the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method validateOnePeriodicFeeAndOneOneTimeFee.
private void validateOnePeriodicFeeAndOneOneTimeFee(String centerSystemId, String expectedPeriodicFeeName, String expectedOneTimeFeeName, double expectedOneTimeFee, double... expectedFees) {
CenterBO retrievedCenter = customerDao.findCenterBySystemId(centerSystemId);
for (AccountActionDateEntity accountActionDate : getActionDatesSortedByDate(retrievedCenter.getCustomerAccount())) {
CustomerScheduleEntity scheduleEntity = (CustomerScheduleEntity) accountActionDate;
if (scheduleEntity.getInstallmentId() == 1) {
assertThat(scheduleEntity.getAccountFeesActionDetails().size(), is(2));
assertThat(scheduleEntity.getAccountFeesActionDetailsSortedByFeeId().get(1).getFee().getFeeName(), is(expectedOneTimeFeeName));
assertThat(scheduleEntity.getAccountFeesActionDetailsSortedByFeeId().get(1).getFeeAmount().getAmountDoubleValue(), is(expectedOneTimeFee));
} else {
assertThat(scheduleEntity.getAccountFeesActionDetails().size(), is(1));
}
assertThat(scheduleEntity.getAccountFeesActionDetailsSortedByFeeId().get(0).getFee().getFeeName(), is(expectedPeriodicFeeName));
assertThat(scheduleEntity.getAccountFeesActionDetailsSortedByFeeId().get(0).getFeeAmount().getAmountDoubleValue(), is(expectedFees[scheduleEntity.getInstallmentId() - 1]));
}
}
use of org.mifos.customers.business.CustomerScheduleEntity in project head by mifos.
the class TestObjectFactory method getDueActionDatesForAccount.
public static List<AccountActionDateEntity> getDueActionDatesForAccount(final Integer accountId, final java.sql.Date transactionDate) throws Exception {
List<AccountActionDateEntity> dueActionDates = new CustomerPersistence().retrieveCustomerAccountActionDetails(accountId, transactionDate);
for (AccountActionDateEntity accountActionDate : dueActionDates) {
Hibernate.initialize(accountActionDate);
if (accountActionDate instanceof LoanScheduleEntity) {
LoanScheduleEntity loanScheduleEntity = (LoanScheduleEntity) accountActionDate;
for (AccountFeesActionDetailEntity accountFeesActionDetail : loanScheduleEntity.getAccountFeesActionDetails()) {
Hibernate.initialize(accountFeesActionDetail);
}
}
if (accountActionDate instanceof CustomerScheduleEntity) {
CustomerScheduleEntity customerScheduleEntity = (CustomerScheduleEntity) accountActionDate;
for (AccountFeesActionDetailEntity accountFeesActionDetail : customerScheduleEntity.getAccountFeesActionDetails()) {
Hibernate.initialize(accountFeesActionDetail);
}
}
}
StaticHibernateUtil.flushSession();
return dueActionDates;
}
Aggregations