Search in sources :

Example 61 with CustomFieldDto

use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.

the class PersonActionForm method clear.

public void clear() {
    this.personnelId = null;
    this.level = null;
    this.globalPersonnelNum = null;
    this.officeId = null;
    this.title = null;
    this.firstName = null;
    this.middleName = null;
    this.secondLastName = null;
    this.lastName = null;
    this.status = null;
    this.preferredLocale = null;
    this.searchId = null;
    this.loginName = null;
    this.userPassword = null;
    this.emailId = null;
    this.governmentIdNumber = null;
    this.dobDD = null;
    this.dobMM = null;
    this.dobYY = null;
    this.passwordExpirationDateDD = null;
    this.passwordExpirationDateMM = null;
    this.passwordExpirationDateYY = null;
    this.maritalStatus = null;
    this.gender = null;
    this.dateOfJoiningMFIDD = null;
    this.dateOfJoiningMFIMM = null;
    this.dateOfJoiningMFIYY = null;
    this.dateOfJoiningBranch = null;
    this.personnelRoles = new String[10];
    this.input = null;
    this.searchString = null;
    address = new Address();
    customFields = new ArrayList<CustomFieldDto>();
    this.setQuestionGroups(null);
}
Also used : Address(org.mifos.framework.business.util.Address) CustomFieldDto(org.mifos.dto.domain.CustomFieldDto)

Example 62 with CustomFieldDto

use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.

the class ClientCustActionStrutsTest method testPreviewFailure_DuplicateOfferingsSelected.

@Test
public void testPreviewFailure_DuplicateOfferingsSelected() throws Exception {
    savingsOffering1 = TestObjectFactory.createSavingsProduct("savingsPrd1", "s1", SavingsType.MANDATORY, ApplicableTo.CLIENTS, new Date(System.currentTimeMillis()));
    setRequestPathInfo("/clientCustAction.do");
    addRequestParameter("method", "load");
    addRequestParameter("officeId", "3");
    addRequestParameter("groupFlag", "0");
    addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
    actionPerform();
    flowKey = (String) request.getAttribute(Constants.CURRENTFLOWKEY);
    List<CustomFieldDto> customFieldDefs = getCustomFieldFromSession();
    List<BusinessActivityEntity> povertyStatus = (List<BusinessActivityEntity>) SessionUtils.getAttribute(ClientConstants.POVERTY_STATUS, request);
    setRequestPathInfo("/clientCustAction.do");
    addRequestParameter("method", "next");
    addRequestParameter("officeId", "3");
    addRequestParameter("clientName.salutation", "1");
    addRequestParameter("clientName.firstName", "Client");
    addRequestParameter("clientName.lastName", "LastName");
    addRequestParameter("spouseName.firstName", "Spouse");
    addRequestParameter("spouseName.lastName", "LastName");
    addRequestParameter("spouseName.nameType", "1");
    addRequestDateParameter("dateOfBirth", "20/3/1987");
    addRequestParameter("clientDetailView.gender", "1");
    addRequestParameter("input", "personalInfo");
    addRequestParameter("customerDetail.povertyStatus", povertyStatus.get(0).getId().toString());
    int i = 0;
    for (CustomFieldDto customFieldDef : customFieldDefs) {
        addRequestParameter("customField[" + i + "].fieldId", customFieldDef.getFieldId().toString());
        addRequestParameter("customField[" + i + "].fieldValue", "11");
        i++;
    }
    addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
    actionPerform();
    List<SavingsDetailDto> savingsOfferingList = getSavingsOfferingsFromSession();
    SavingsDetailDto savingsOffering = savingsOfferingList.get(0);
    setRequestPathInfo("/clientCustAction.do");
    addRequestParameter("method", "preview");
    addRequestParameter("input", "mfiInfo");
    addRequestParameter("formedByPersonnel", "1");
    addRequestParameter("savingsOffering[0]", savingsOffering.getPrdOfferingId().toString());
    addRequestParameter("savingsOffering[1]", savingsOffering.getPrdOfferingId().toString());
    request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
    SessionUtils.setAttribute(CustomerConstants.CUSTOMER_MEETING, new MeetingBO(RecurrenceType.MONTHLY, Short.valueOf("2"), new Date(), MeetingType.CUSTOMER_MEETING), request);
    addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
    actionPerform();
    Assert.assertEquals("Duplicate Offerings", 1, getErrorSize(ClientConstants.ERRORS_DUPLICATE_OFFERING_SELECTED));
}
Also used : BusinessActivityEntity(org.mifos.application.master.business.BusinessActivityEntity) SavingsDetailDto(org.mifos.dto.domain.SavingsDetailDto) MeetingBO(org.mifos.application.meeting.business.MeetingBO) CustomFieldDto(org.mifos.dto.domain.CustomFieldDto) List(java.util.List) ArrayList(java.util.ArrayList) Date(java.util.Date) Test(org.junit.Test)

Example 63 with CustomFieldDto

use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.

the class GroupActionStrutsTest method testPreviewManageFailureForTrained.

@Test
public void testPreviewManageFailureForTrained() throws Exception {
    request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
    createGroupWithCenterAndSetInSession();
    setRequestPathInfo("/groupCustAction.do");
    addRequestParameter("method", "manage");
    addRequestParameter("officeId", "3");
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    actionPerform();
    List<CustomFieldDto> customFieldDefs = getCustomFieldsFromSession();
    setRequestPathInfo("/groupCustAction.do");
    addRequestParameter("method", "previewManage");
    addRequestParameter("officeId", "3");
    addRequestParameter("displayName", "group");
    int i = 0;
    for (CustomFieldDto customFieldDef : customFieldDefs) {
        addRequestParameter("customField[" + i + "].fieldId", customFieldDef.getFieldId().toString());
        addRequestParameter("customField[" + i + "].fieldValue", "Req");
        i++;
    }
    addRequestParameter("trainedDate", "20/03/2006");
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    actionPerform();
    Assert.assertEquals(1, getErrorSize());
    Assert.assertEquals("Group Trained checkbox not checked ", 1, getErrorSize(CustomerConstants.TRAINED_CHECKED));
}
Also used : CustomFieldDto(org.mifos.dto.domain.CustomFieldDto) Test(org.junit.Test)

Example 64 with CustomFieldDto

use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.

the class GroupActionStrutsTest method testSuccessfulCreate_UnderCenter.

@Test
public void testSuccessfulCreate_UnderCenter() throws Exception {
    createParentCustomer();
    StaticHibernateUtil.flushAndClearSession();
    setRequestPathInfo("/groupCustAction.do");
    addRequestParameter("method", "load");
    addRequestParameter("centerSystemId", center.getGlobalCustNum());
    actionPerform();
    List<CustomFieldDto> customFieldDefs = getCustomFieldsFromSession();
    setRequestPathInfo("/groupCustAction.do");
    addRequestParameter("method", "preview");
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    addRequestParameter("displayName", "groupUnderCenter");
    addRequestParameter("status", CustomerStatus.GROUP_PENDING.getValue().toString());
    addRequestParameter("formedByPersonnel", center.getPersonnel().getPersonnelId().toString());
    int i = 0;
    for (CustomFieldDto customFieldDef : customFieldDefs) {
        addRequestParameter("customField[" + i + "].fieldId", customFieldDef.getFieldId().toString());
        addRequestParameter("customField[" + i + "].fieldValue", "11");
        i++;
    }
    actionPerform();
    setRequestPathInfo("/groupCustAction.do");
    addRequestParameter("method", "create");
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    actionPerform();
    verifyNoActionErrors();
    verifyForward(ActionForwards.create_success.toString());
    GroupCustActionForm actionForm = (GroupCustActionForm) request.getSession().getAttribute("groupCustActionForm");
    group = TestObjectFactory.getGroup(actionForm.getCustomerIdAsInt());
    center = TestObjectFactory.getCenter(center.getCustomerId());
    actionForm.setParentCustomer(null);
}
Also used : CustomFieldDto(org.mifos.dto.domain.CustomFieldDto) GroupCustActionForm(org.mifos.customers.group.struts.actionforms.GroupCustActionForm) Test(org.junit.Test)

Example 65 with CustomFieldDto

use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.

the class GroupActionStrutsTest method testPreviewManageSuccess.

@Test
public void testPreviewManageSuccess() throws Exception {
    request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
    createGroupWithCenterAndSetInSession();
    setRequestPathInfo("/groupCustAction.do");
    addRequestParameter("method", "manage");
    addRequestParameter("officeId", "3");
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    actionPerform();
    List<CustomFieldDto> customFieldDefs = getCustomFieldsFromSession();
    setRequestPathInfo("/groupCustAction.do");
    addRequestParameter("method", "previewManage");
    addRequestParameter("officeId", "3");
    addRequestParameter("displayName", "group");
    int i = 0;
    for (CustomFieldDto customFieldDef : customFieldDefs) {
        addRequestParameter("customField[" + i + "].fieldId", customFieldDef.getFieldId().toString());
        addRequestParameter("customField[" + i + "].fieldValue", "Req");
        i++;
    }
    addRequestParameter("trained", "1");
    addRequestParameter("trainedDate", "20/3/2006");
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    actionPerform();
    verifyNoActionErrors();
    verifyNoActionMessages();
    verifyForward(ActionForwards.previewManage_success.toString());
}
Also used : CustomFieldDto(org.mifos.dto.domain.CustomFieldDto) Test(org.junit.Test)

Aggregations

CustomFieldDto (org.mifos.dto.domain.CustomFieldDto)86 ArrayList (java.util.ArrayList)48 Test (org.junit.Test)36 UserContext (org.mifos.security.util.UserContext)16 Date (java.util.Date)14 Address (org.mifos.framework.business.util.Address)14 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)13 AddressDto (org.mifos.dto.domain.AddressDto)12 List (java.util.List)10 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)10 SimpleDateFormat (java.text.SimpleDateFormat)9 BusinessActivityEntity (org.mifos.application.master.business.BusinessActivityEntity)9 ClientCustActionForm (org.mifos.customers.client.struts.actionforms.ClientCustActionForm)8 ApplicableAccountFeeDto (org.mifos.dto.domain.ApplicableAccountFeeDto)8 CustomerPositionDto (org.mifos.dto.domain.CustomerPositionDto)8 CustomFieldDefinitionEntity (org.mifos.application.master.business.CustomFieldDefinitionEntity)7 MeetingBO (org.mifos.application.meeting.business.MeetingBO)7 MifosRuntimeException (org.mifos.core.MifosRuntimeException)6 GroupCustActionForm (org.mifos.customers.group.struts.actionforms.GroupCustActionForm)6 OfficeBO (org.mifos.customers.office.business.OfficeBO)6