use of org.mifos.accounts.business.AccountActionDateEntity in project head by mifos.
the class LoanScheduleEntityIntegrationTest method testIsPricipalZero.
@Test
public void testIsPricipalZero() {
for (AccountActionDateEntity accountAction : groupLoan.getAccountActionDates()) {
LoanScheduleEntity accountActionDateEntity = (LoanScheduleEntity) accountAction;
if (accountActionDateEntity.getInstallmentId() == 1) {
accountActionDateEntity.setPrincipal(new Money(getCurrency()));
Assert.assertTrue(accountActionDateEntity.isPrincipalZero());
} else {
Assert.assertFalse(accountActionDateEntity.isPrincipalZero());
}
}
}
use of org.mifos.accounts.business.AccountActionDateEntity in project head by mifos.
the class SavingsBOIntegrationTest method testGetTotalAmountInArrearsForSingleInstallmentDue.
@Test
public void testGetTotalAmountInArrearsForSingleInstallmentDue() throws Exception {
savings = getSavingsAccount();
AccountActionDateEntity accountActionDateEntity = savings.getAccountActionDate((short) 1);
((SavingsScheduleEntity) accountActionDateEntity).setActionDate(offSetCurrentDate(1));
savings = (SavingsBO) saveAndFetch(savings);
Assert.assertEquals(TestUtils.createMoney(200.0), savings.getTotalAmountInArrears());
}
use of org.mifos.accounts.business.AccountActionDateEntity in project head by mifos.
the class SavingsBOIntegrationTest method testGetDetailsOfInstallmentsInArrearsForTwoInstallmentsDue.
@Test
public void testGetDetailsOfInstallmentsInArrearsForTwoInstallmentsDue() throws Exception {
savings = getSavingsAccount();
AccountActionDateEntity accountActionDateEntity = savings.getAccountActionDate((short) 1);
((SavingsScheduleEntity) accountActionDateEntity).setActionDate(offSetCurrentDate(2));
AccountActionDateEntity accountActionDateEntity2 = savings.getAccountActionDate((short) 2);
((SavingsScheduleEntity) accountActionDateEntity2).setActionDate(offSetCurrentDate(1));
savings = (SavingsBO) saveAndFetch(savings);
Assert.assertEquals(savings.getDetailsOfInstallmentsInArrears().size(), 2);
}
use of org.mifos.accounts.business.AccountActionDateEntity in project head by mifos.
the class SavingsAccountSchedulesIntegrationTest method shouldGenerateSavingsAccountSchedulesForActiveClientsOfGroupWhenUsingPerIndividualSetting.
@Test
public void shouldGenerateSavingsAccountSchedulesForActiveClientsOfGroupWhenUsingPerIndividualSetting() throws Exception {
createCenterGroupClientHierarchy(aWeeklyMeeting);
SavingsOfferingBO savingsProduct = new SavingsProductBuilder().mandatory().withMandatoryAmount("33.0").appliesToGroupsOnly().trackedPerIndividual().buildForIntegrationTests();
SavingsBO savingsAccount = new SavingsAccountBuilder().active().withActivationDate(mondayTwoWeeksAgo()).withSavingsProduct(savingsProduct).withCustomer(group).withMember(client).withCreatedBy(IntegrationTestObjectMother.testUser()).buildJointSavingsAccount();
IntegrationTestObjectMother.saveSavingsProductAndAssociatedSavingsAccounts(savingsProduct, savingsAccount);
List<AccountActionDateEntity> savingSchedules = savingsAccount.getAccountActionDatesSortedByInstallmentId();
for (AccountActionDateEntity savingSchedule : savingSchedules) {
assertThat("saving schedule should be generated for active client belong to group savings account", savingSchedule.getCustomer().getCustomerId(), is(client.getCustomerId()));
}
}
use of org.mifos.accounts.business.AccountActionDateEntity in project head by mifos.
the class SavingsAccountSchedulesIntegrationTest method shouldNotGenerateSavingsAccountSchedulesForCenterWithoutActiveClients.
@Test
public void shouldNotGenerateSavingsAccountSchedulesForCenterWithoutActiveClients() throws Exception {
createCenterAndGroupHierarchyWithNoClients(aWeeklyMeeting);
SavingsOfferingBO savingsProduct = new SavingsProductBuilder().mandatory().withMandatoryAmount("33.0").appliesToCentersOnly().buildForIntegrationTests();
SavingsBO savingsAccount = new SavingsAccountBuilder().active().withActivationDate(mondayTwoWeeksAgo()).withSavingsProduct(savingsProduct).withCustomer(center).withCreatedBy(IntegrationTestObjectMother.testUser()).buildJointSavingsAccount();
IntegrationTestObjectMother.saveSavingsProductAndAssociatedSavingsAccounts(savingsProduct, savingsAccount);
List<AccountActionDateEntity> savingSchedules = savingsAccount.getAccountActionDatesSortedByInstallmentId();
assertTrue(savingSchedules.isEmpty());
}
Aggregations