use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class ClientCustActionForm method clearMostButNotAllFieldsOnActionForm.
public void clearMostButNotAllFieldsOnActionForm() {
setDefaultFees(new ArrayList<ApplicableAccountFeeDto>());
setAdditionalFees(new ArrayList<ApplicableAccountFeeDto>());
setCustomFields(new ArrayList<CustomFieldDto>());
setFamilyNames(new ArrayList<ClientNameDetailDto>());
setFamilyDetails(new ArrayList<ClientFamilyDetailDto>());
setFamilyRelationship(new ArrayList<Short>());
setFamilyFirstName(new ArrayList<String>());
setFamilyMiddleName(new ArrayList<String>());
setFamilyLastName(new ArrayList<String>());
setFamilySecondLastName(new ArrayList<String>());
setFamilyDateOfBirthDD(new ArrayList<String>());
setFamilyDateOfBirthMM(new ArrayList<String>());
setFamilyDateOfBirthYY(new ArrayList<String>());
setFamilyGender(new ArrayList<Short>());
setFamilyLivingStatus(new ArrayList<Short>());
initializeFamilyMember();
addFamilyMember();
setAddress(new Address());
setDisplayName(null);
setDateOfBirthDD(null);
setDateOfBirthMM(null);
setDateOfBirthYY(null);
setGovernmentId(null);
setMfiJoiningDate(null);
setGlobalCustNum(null);
setCustomerId(null);
setExternalId(null);
setLoanOfficerId(null);
setLoanOfficerName("");
setFormedByPersonnel(null);
setTrained(null);
setTrainedDate(null);
setClientName(new ClientNameDetailDto());
setSpouseName(new ClientNameDetailDto());
setClientDetailView(new ClientPersonalDetailDto());
setNextOrPreview("next");
setQuestionGroups(null);
for (int i = 0; i < getSelectedOfferings().size(); i++) {
getSelectedOfferings().set(i, null);
}
setFiles(new ArrayList<FormFile>());
setFilesMetadata(new ArrayList<UploadedFileDto>());
}
use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class CenterCustAction method create.
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CenterCustActionForm actionForm = (CenterCustActionForm) form;
MeetingBO meeting = (MeetingBO) SessionUtils.getAttribute(CustomerConstants.CUSTOMER_MEETING, request);
LocalDate mfiJoiningDate = new LocalDate(CalendarUtils.getDateFromString(actionForm.getMfiJoiningDate(), getUserContext(request).getPreferredLocale()));
Address address = actionForm.getAddress();
AddressDto addressDto = Address.toDto(address);
MeetingDto meetingDto = meeting.toDto();
List<CreateAccountFeeDto> accountFeesToBeApplied = new ArrayList<CreateAccountFeeDto>();
List<ApplicableAccountFeeDto> feesToBeApplied = actionForm.getFeesToApply();
for (ApplicableAccountFeeDto feeDto : feesToBeApplied) {
accountFeesToBeApplied.add(new CreateAccountFeeDto(feeDto.getFeeId(), feeDto.getAmount()));
}
try {
CenterCreationDetail centerCreationDetail = new CenterCreationDetail(mfiJoiningDate, actionForm.getDisplayName(), actionForm.getExternalId(), addressDto, actionForm.getLoanOfficerIdValue(), actionForm.getOfficeIdValue(), accountFeesToBeApplied);
CustomerDetailsDto centerDetails = this.centerServiceFacade.createNewCenter(centerCreationDetail, meetingDto);
createCenterQuestionnaire.saveResponses(request, actionForm, centerDetails.getId());
actionForm.setCustomerId(centerDetails.getId().toString());
actionForm.setGlobalCustNum(centerDetails.getGlobalCustNum());
} catch (BusinessRuleException e) {
throw new ApplicationException(e.getMessageKey(), e.getMessageValues());
}
return mapping.findForward(ActionForwards.create_success.toString());
}
use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class CenterActionStrutsTest method testSuccessfulPreview.
@Test
public void testSuccessfulPreview() throws Exception {
List<FeeDto> feesToRemove = getFees(RecurrenceType.MONTHLY);
setRequestPathInfo("/centerCustAction.do");
addRequestParameter("method", "load");
addRequestParameter("officeId", "3");
actionPerform();
SessionUtils.setAttribute(CustomerConstants.CUSTOMER_MEETING, new MeetingBO(RecurrenceType.MONTHLY, Short.valueOf("2"), new Date(), MeetingType.CUSTOMER_MEETING), request);
List<ApplicableAccountFeeDto> feeList = retrieveAdditionalFeesFromSession();
ApplicableAccountFeeDto fee = feeList.get(0);
setRequestPathInfo("/centerCustAction.do");
addRequestParameter("method", "preview");
addRequestParameter("displayName", "center");
addRequestParameter("loanOfficerId", "1");
addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
addRequestParameter("selectedFee[0].feeId", fee.getFeeId().toString());
addRequestParameter("selectedFee[0].amount", fee.getAmount());
actionPerform();
Assert.assertEquals(0, getErrorSize());
verifyForward(ActionForwards.preview_success.toString());
verifyNoActionErrors();
verifyNoActionMessages();
}
use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class CenterActionStrutsTest method testFailurePreview_WithDuplicateFee.
@Test
public void testFailurePreview_WithDuplicateFee() throws Exception {
List<FeeDto> feesToRemove = getFees(RecurrenceType.MONTHLY);
setRequestPathInfo("/centerCustAction.do");
addRequestParameter("method", "load");
addRequestParameter("officeId", "3");
actionPerform();
List<ApplicableAccountFeeDto> feeList = retrieveAdditionalFeesFromSession();
ApplicableAccountFeeDto fee = feeList.get(0);
setRequestPathInfo("/centerCustAction.do");
addRequestParameter("method", "preview");
addRequestParameter("selectedFee[0].feeId", fee.getFeeId().toString());
addRequestParameter("selectedFee[0].amount", "100");
addRequestParameter("selectedFee[1].feeId", fee.getFeeId().toString());
addRequestParameter("selectedFee[1].amount", "150");
addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
actionPerform();
Assert.assertEquals("Fee", 1, getErrorSize(CustomerConstants.FEE));
}
use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class ClientCustActionStrutsTest method testFailurePreview_WithFee_WithoutFeeAmount.
@Test
public void testFailurePreview_WithFee_WithoutFeeAmount() throws Exception {
List<FeeDto> feesToRemove = getFees(RecurrenceType.WEEKLY);
setRequestPathInfo("/clientCustAction.do");
addRequestParameter("method", "load");
addRequestParameter("officeId", "3");
addRequestParameter("groupFlag", "0");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
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("gender", "1");
addRequestParameter("input", "personalInfo");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
List<ApplicableAccountFeeDto> feeList = (List<ApplicableAccountFeeDto>) SessionUtils.getAttribute(CustomerConstants.ADDITIONAL_FEES_LIST, request);
ApplicableAccountFeeDto fee = feeList.get(0);
setRequestPathInfo("/clientCustAction.do");
addRequestParameter("input", "mfiInfo");
addRequestParameter("method", "preview");
addRequestParameter("selectedFee[0].feeId", fee.getFeeId().toString());
addRequestParameter("selectedFee[0].amount", "");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
Assert.assertEquals("Fee", 1, getErrorSize(CustomerConstants.FEE));
removeFees(feesToRemove);
}
Aggregations