use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class SavingsOfferingBOIntegrationTest method testBuildSavingsOfferingWithNoRecommendedAmountForMandatoryOffering.
@Test
public void testBuildSavingsOfferingWithNoRecommendedAmountForMandatoryOffering() throws SystemException {
PrdApplicableMasterEntity prdApplicableMaster = new PrdApplicableMasterEntity(ApplicableTo.CLIENTS);
SavingsTypeEntity savingsType = new SavingsTypeEntity(SavingsType.MANDATORY);
InterestCalcTypeEntity intCalType = new InterestCalcTypeEntity(InterestCalcType.AVERAGE_BALANCE);
MeetingBO intCalcMeeting = getMeeting();
MeetingBO intPostMeeting = getMeeting();
GLCodeEntity depglCodeEntity = (GLCodeEntity) StaticHibernateUtil.getSessionTL().get(GLCodeEntity.class, (short) 7);
GLCodeEntity intglCodeEntity = (GLCodeEntity) StaticHibernateUtil.getSessionTL().get(GLCodeEntity.class, (short) 7);
ProductCategoryBO productCategory = (ProductCategoryBO) TestObjectFactory.getObject(ProductCategoryBO.class, (short) 2);
Date startDate = offSetCurrentDate(-2);
try {
new SavingsOfferingBO(TestUtils.makeUser(), "Savings Product1", "SAVP", productCategory, prdApplicableMaster, startDate, savingsType, intCalType, intCalcMeeting, intPostMeeting, null, 10.0, depglCodeEntity, intglCodeEntity);
Assert.fail();
} catch (ProductDefinitionException e) {
Assert.assertTrue(true);
}
}
use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class LoanPrdBusinessServiceIntegrationTest method createLoanOfferingBO.
private LoanOfferingBO createLoanOfferingBO(String prdOfferingName, String shortName) {
Date startDate = new Date(System.currentTimeMillis());
MeetingBO frequency = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
return TestObjectFactory.createLoanOffering(prdOfferingName, shortName, ApplicableTo.GROUPS, startDate, PrdStatus.LOAN_ACTIVE, 300.0, 1.2, 3, InterestType.FLAT, frequency);
}
use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class AccountBO method getFeeDates.
public final List<Date> getFeeDates(final MeetingBO feeMeetingFrequency, final List<InstallmentDate> installmentDates, final boolean adjustForHolidays) {
MeetingBO customerMeeting = getCustomer().getCustomerMeetingValue();
List<Days> workingDays = new FiscalCalendarRules().getWorkingDaysAsJodaTimeDays();
HolidayDao holidayDao = ApplicationContextProvider.getBean(HolidayDao.class);
List<Holiday> holidays;
if (adjustForHolidays) {
holidays = holidayDao.findAllHolidaysThisYearAndNext(getOffice().getOfficeId());
} else {
holidays = new ArrayList<Holiday>();
}
DateTime startFromMeetingDate = new DateTime(installmentDates.get(0).getInstallmentDueDate());
DateTime repaymentEndDatetime = new DateTime(installmentDates.get(installmentDates.size() - 1).getInstallmentDueDate());
ScheduledEvent scheduledEvent = ScheduledEventFactory.createScheduledEventFrom(customerMeeting, feeMeetingFrequency);
ScheduledDateGeneration dateGeneration = new HolidayAndWorkingDaysAndMoratoriaScheduledDateGeneration(workingDays, holidays);
List<DateTime> feeScheduleDates = dateGeneration.generateScheduledDatesThrough(startFromMeetingDate, repaymentEndDatetime, scheduledEvent, true);
List<Date> feeSchedulesAsJavaDates = new ArrayList<Date>();
for (DateTime feeSchedule : feeScheduleDates) {
feeSchedulesAsJavaDates.add(feeSchedule.toDate());
}
return feeSchedulesAsJavaDates;
}
use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class MeetingActionStrutsTest method testSuccessfulCancelCreate.
@Test
public void testSuccessfulCancelCreate() throws Exception {
loadMeetingPage();
setRequestPathInfo("/meetingAction.do");
addRequestParameter("method", "cancelCreate");
actionPerform();
verifyForward(ActionForwards.loadCreateCenter.toString());
MeetingBO meeting = (MeetingBO) SessionUtils.getAttribute(CustomerConstants.CUSTOMER_MEETING, request);
Assert.assertNull(meeting);
}
use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class MeetingHelperIntegrationTest method testGetWeekMessage.
@Test
public void testGetWeekMessage() throws Exception {
String expected = "Recur every 5 Week(s) on Monday";
MeetingBO meeting = new MeetingBO(WeekDay.MONDAY, (short) 5, new Date(), MeetingType.CUSTOMER_MEETING, "Delhi");
IntegrationTestObjectMother.saveMeeting(meeting);
meeting = IntegrationTestObjectMother.getMeeting(meeting.getMeetingId());
Assert.assertEquals(expected, helper.getMessage(meeting, TestUtils.makeUser()));
}
Aggregations