public void testForMandatoryAccountWithNoPreviousPayments() throws Exception {

    savings = createSavingsAccount(SavingsType.MANDATORY);
    CollSheetSavingsDetailsEntity collSheetSavingsDetail = new CollSheetSavingsDetailsEntity();
    // obtaining the last installment
    // Scenario: Mandatory savings Account: None of the previous
    // installments have been paid and hence with a deposit
    // of 200, total overdue amount is 400 and due amount for next meeting
    // date is 200
    collSheetSavingsDetail.addAccountDetails(savings.getAccountActionDate((short) 3));
    Assert.assertEquals(TestUtils.createMoney(400.00), collSheetSavingsDetail.getAmntOverDue());
    Assert.assertEquals(
        TestUtils.createMoney(200.00), collSheetSavingsDetail.getRecommendedAmntDue());

    SavingsScheduleEntity accountActionDate =
        (SavingsScheduleEntity) savings.getAccountActionDate((short) 1);
    SavingBOTestUtils.setDepositPaid(accountActionDate, new Money(getCurrency(), "100.00"));
    collSheetSavingsDetail.addAccountDetails(savings.getAccountActionDate((short) 3));
    Assert.assertEquals(TestUtils.createMoney(300.00), collSheetSavingsDetail.getAmntOverDue());
    Assert.assertEquals(
        TestUtils.createMoney(200.00), collSheetSavingsDetail.getRecommendedAmntDue());
    accountActionDate = (SavingsScheduleEntity) savings.getAccountActionDate((short) 1);
    SavingBOTestUtils.setDepositPaid(accountActionDate, new Money(getCurrency(), "200.00"));
    accountActionDate.setPaymentStatus(PaymentStatus.PAID);
    collSheetSavingsDetail.addAccountDetails(savings.getAccountActionDate((short) 3));
    Assert.assertEquals(TestUtils.createMoney(200.00), collSheetSavingsDetail.getAmntOverDue());
    Assert.assertEquals(
        TestUtils.createMoney(200.00), collSheetSavingsDetail.getRecommendedAmntDue());
  }
  public void testTotalSavingsAmountDueForMandatoryAccount() throws Exception {

    savings = createSavingsAccount(SavingsType.MANDATORY);
    CollSheetSavingsDetailsEntity collSheetSavingsDetail = new CollSheetSavingsDetailsEntity();
    SavingsScheduleEntity accountActionDate =
        (SavingsScheduleEntity) savings.getAccountActionDate((short) 1);
    SavingBOTestUtils.setDepositPaid(accountActionDate, new Money(getCurrency(), "200.00"));
    accountActionDate.setPaymentStatus(PaymentStatus.PAID);
    collSheetSavingsDetail.addAccountDetails(savings.getAccountActionDate((short) 3));
    Assert.assertEquals(
        TestUtils.createMoney(400.00), collSheetSavingsDetail.getTotalSavingsAmntDue());
  }
  public void testForVoluntaryAccountWithPartialPayment() throws Exception {

    savings = createSavingsAccount(SavingsType.VOLUNTARY);
    CollSheetSavingsDetailsEntity collSheetSavingsDetail = new CollSheetSavingsDetailsEntity();
    // obtaining the last installment
    // Scenario: Voluntary savings Account: For the first installment a full
    // payment of Rs 200 has been done and hence with a deposit
    // of 200, total overdue amount is Rs 0 and due amount for next meeting
    // date is Rs 200
    SavingsScheduleEntity accountActionDate =
        (SavingsScheduleEntity) savings.getAccountActionDate((short) 1);
    SavingBOTestUtils.setDepositPaid(accountActionDate, new Money(getCurrency(), "100.00"));
    collSheetSavingsDetail.addAccountDetails(savings.getAccountActionDate((short) 3));
    Assert.assertEquals(TestUtils.createMoney(), collSheetSavingsDetail.getAmntOverDue());
    Assert.assertEquals(
        TestUtils.createMoney(200.00), collSheetSavingsDetail.getRecommendedAmntDue());
  }