Search in sources :

Example 46 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class LoanBusinessServiceIntegrationTest method getLoanAccount.

private AccountBO getLoanAccount() {
    Date startDate = new Date(System.currentTimeMillis());
    MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
    center = TestObjectFactory.createWeeklyFeeCenter(this.getClass().getSimpleName() + "_Center", meeting);
    group = TestObjectFactory.createWeeklyFeeGroupUnderCenter(this.getClass().getSimpleName() + "_Group", CustomerStatus.GROUP_ACTIVE, center);
    LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(startDate, meeting);
    return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, startDate, loanOffering);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) Date(java.util.Date)

Example 47 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class LoanAccountActionStrutsTest method getLoanAccountFromLastLoanAmount.

private AccountBO getLoanAccountFromLastLoanAmount() {
    Date startDate = new Date(System.currentTimeMillis());
    MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeetingForToday(WEEKLY, EVERY_WEEK, CUSTOMER_MEETING));
    LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(startDate, meeting);
    return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, startDate, loanOffering);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) Date(java.util.Date)

Example 48 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class AbstractLoanActionTestCase method getLoanOffering.

protected LoanOfferingBO getLoanOffering(String name, String shortName, ApplicableTo applicableTo, RecurrenceType meetingFrequency, short recurAfter) {
    MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeeting(meetingFrequency, recurAfter, CUSTOMER_MEETING, MONDAY));
    Date currentDate = new Date(System.currentTimeMillis());
    return TestObjectFactory.createLoanOffering(name, shortName, applicableTo, currentDate, PrdStatus.LOAN_ACTIVE, 300.0, 1.2, 3, InterestType.FLAT, meeting);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date)

Example 49 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class AbstractLoanActionTestCase method getLoanOffering.

protected LoanOfferingBO getLoanOffering(String name, String shortName, ApplicableTo applicableTo, RecurrenceType meetingFrequency, short recurAfter, VariableInstallmentDetailsBO variableInstallmentDetailsBO) {
    MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeeting(meetingFrequency, recurAfter, CUSTOMER_MEETING, MONDAY));
    Date currentDate = new Date(System.currentTimeMillis());
    return TestObjectFactory.createLoanOffering(name, shortName, applicableTo, currentDate, PrdStatus.LOAN_ACTIVE, 300.0, 1.2, 3, InterestType.FLAT, meeting, variableInstallmentDetailsBO);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date)

Example 50 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class SavingsBOIntegrationTest method testMaxWithdrawAmount.

@Test
public void testMaxWithdrawAmount() throws AccountException, Exception {
    MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeetingForToday(WEEKLY, EVERY_WEEK, CUSTOMER_MEETING));
    center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
    group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
    client1 = TestObjectFactory.createClient("Client", CustomerStatus.CLIENT_ACTIVE, group);
    savingsOffering = helper.createSavingsOffering("dfasdasd1", "sad1");
    savings = TestObjectFactory.createSavingsAccount("43245434", client1, Short.valueOf("16"), new Date(System.currentTimeMillis()), savingsOffering);
    savings = (SavingsBO) legacyAccountDao.getAccount(savings.getAccountId());
    savings.setSavingsBalance(TestUtils.createMoney("100.0"));
    Money enteredAmount = new Money(currency, "300.0");
    PaymentData paymentData = PaymentData.createPaymentData(enteredAmount, savings.getPersonnel(), Short.valueOf("1"), new Date(System.currentTimeMillis()));
    paymentData.setCustomer(client1);
    paymentData.setReceiptDate(new Date(System.currentTimeMillis()));
    paymentData.setReceiptNum("34244");
    try {
        boolean persist = true;
        savings.withdraw(paymentData, persist);
        Assert.assertTrue("No Exception is thrown. Even amount greater than max withdrawal allowed to be withdrawn", false);
    } catch (AccountException ae) {
        Assert.assertTrue("Exception is thrown. Amount greater than max withdrawal not allowed to be withdrawn", true);
    }
    savings.getAccountPayments().clear();
}
Also used : Money(org.mifos.framework.util.helpers.Money) PaymentData(org.mifos.accounts.util.helpers.PaymentData) SavingsPaymentData(org.mifos.accounts.util.helpers.SavingsPaymentData) AccountException(org.mifos.accounts.exceptions.AccountException) MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date) Test(org.junit.Test)

Aggregations

MeetingBO (org.mifos.application.meeting.business.MeetingBO)355 Test (org.junit.Test)176 Date (java.util.Date)91 ArrayList (java.util.ArrayList)84 MeetingBuilder (org.mifos.domain.builders.MeetingBuilder)74 DateTime (org.joda.time.DateTime)68 LocalDate (org.joda.time.LocalDate)56 Money (org.mifos.framework.util.helpers.Money)56 CenterBuilder (org.mifos.domain.builders.CenterBuilder)54 CenterBO (org.mifos.customers.center.business.CenterBO)46 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)44 AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)42 Date (java.sql.Date)40 UserContext (org.mifos.security.util.UserContext)34 AccountActionDateEntity (org.mifos.accounts.business.AccountActionDateEntity)33 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)30 OfficeBO (org.mifos.customers.office.business.OfficeBO)27 CustomerBO (org.mifos.customers.business.CustomerBO)23 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)22 MifosUser (org.mifos.security.MifosUser)20