use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class GroupActionStrutsTest method testFailurePreview_WithDuplicateFee.
@Test
public void testFailurePreview_WithDuplicateFee() throws Exception {
List<FeeDto> feesToRemove = getFees(RecurrenceType.WEEKLY);
createParentCustomer();
StaticHibernateUtil.flushAndClearSession();
setRequestPathInfo("/groupCustAction.do");
addRequestParameter("method", "load");
addRequestParameter("centerSystemId", center.getGlobalCustNum());
actionPerform();
List<ApplicableAccountFeeDto> feeList = getFeesFromSession();
ApplicableAccountFeeDto fee = feeList.get(0);
setRequestPathInfo("/groupCustAction.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));
verifyInputForward();
removeFees(feesToRemove);
center = TestObjectFactory.getCenter(center.getCustomerId());
}
use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class GroupActionStrutsTest method testFailurePreview_WithFee_WithoutFeeAmount.
@Test
public void testFailurePreview_WithFee_WithoutFeeAmount() throws Exception {
List<FeeDto> feesToRemove = getFees(RecurrenceType.WEEKLY);
createParentCustomer();
StaticHibernateUtil.flushAndClearSession();
setRequestPathInfo("/groupCustAction.do");
addRequestParameter("method", "load");
addRequestParameter("centerSystemId", center.getGlobalCustNum());
actionPerform();
List<ApplicableAccountFeeDto> feeList = getFeesFromSession();
ApplicableAccountFeeDto fee = feeList.get(0);
setRequestPathInfo("/groupCustAction.do");
addRequestParameter("method", "preview");
addRequestParameter("selectedFee[0].feeId", fee.getFeeId().toString());
addRequestParameter("selectedFee[0].amount", "");
addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
actionPerform();
Assert.assertEquals("Fee", 1, getErrorSize(CustomerConstants.FEE));
verifyInputForward();
removeFees(feesToRemove);
center = TestObjectFactory.getCenter(center.getCustomerId());
}
use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class PictureFormFile method load.
@TransactionDemarcate(saveToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ClientCustActionForm actionForm = (ClientCustActionForm) form;
UserContext userContext = getUserContext(request);
actionForm.clearMostButNotAllFieldsOnActionForm();
SessionUtils.removeAttribute(CustomerConstants.CUSTOMER_MEETING, request);
Short officeId = actionForm.getOfficeIdValue();
String officeName = actionForm.getOfficeName();
Short groupFlag = actionForm.getGroupFlagValue();
String parentGroupId = actionForm.getParentGroupId();
ClientFormCreationDto clientFormCreationDto = this.clientServiceFacade.retrieveClientFormCreationData(groupFlag, officeId, parentGroupId);
if (clientFormCreationDto.getFormedByPersonnelId() != null) {
actionForm.setFormedByPersonnel(clientFormCreationDto.getFormedByPersonnelId().toString());
MeetingBO groupMeeting = customerDao.findCustomerById(Integer.valueOf(parentGroupId)).getCustomerMeetingValue();
clientFormCreationDto.getParentCustomerMeeting().setMeetingSchedule(CustomerUIHelperFn.getMeetingSchedule(groupMeeting, userContext));
SessionUtils.setAttribute("meeting", clientFormCreationDto.getParentCustomerMeeting(), request);
}
actionForm.setCenterDisplayName(clientFormCreationDto.getCenterDisplayName());
actionForm.setGroupDisplayName(clientFormCreationDto.getGroupDisplayName());
actionForm.setOfficeId(clientFormCreationDto.getOfficeId().toString());
actionForm.setOfficeName(officeName);
if (clientFormCreationDto.getFormedByPersonnelId() != null) {
actionForm.setLoanOfficerId(clientFormCreationDto.getFormedByPersonnelId().toString());
}
actionForm.setLoanOfficerName(clientFormCreationDto.getFormedByPersonnelName());
actionForm.setCustomFields(new ArrayList<CustomFieldDto>());
List<ApplicableAccountFeeDto> defaultFees = clientFormCreationDto.getDefaultFees();
actionForm.setDefaultFees(defaultFees);
List<ApplicableAccountFeeDto> additionalFees = clientFormCreationDto.getAdditionalFees();
SessionUtils.setCollectionAttribute(CustomerConstants.ADDITIONAL_FEES_LIST, additionalFees, request);
List<SpouseFatherLookupEntity> spouseFather = legacyMasterDao.findMasterDataEntitiesWithLocale(SpouseFatherLookupEntity.class);
SessionUtils.setCollectionAttribute(ClientConstants.SPOUSE_FATHER_ENTITY, spouseFather, request);
SessionUtils.setCollectionAttribute(ClientConstants.SALUTATION_ENTITY, clientFormCreationDto.getClientDropdowns().getSalutations(), request);
SessionUtils.setCollectionAttribute(ClientConstants.GENDER_ENTITY, clientFormCreationDto.getClientDropdowns().getGenders(), request);
SessionUtils.setCollectionAttribute(ClientConstants.MARITAL_STATUS_ENTITY, clientFormCreationDto.getClientDropdowns().getMaritalStatuses(), request);
SessionUtils.setCollectionAttribute(ClientConstants.CITIZENSHIP_ENTITY, clientFormCreationDto.getClientDropdowns().getCitizenship(), request);
SessionUtils.setCollectionAttribute(ClientConstants.ETHNICITY_ENTITY, clientFormCreationDto.getClientDropdowns().getEthnicity(), request);
SessionUtils.setCollectionAttribute(ClientConstants.EDUCATION_LEVEL_ENTITY, clientFormCreationDto.getClientDropdowns().getEducationLevels(), request);
SessionUtils.setCollectionAttribute(ClientConstants.BUSINESS_ACTIVITIES_ENTITY, clientFormCreationDto.getClientDropdowns().getBusinessActivity(), request);
SessionUtils.setCollectionAttribute(ClientConstants.POVERTY_STATUS, clientFormCreationDto.getClientDropdowns().getPoverty(), request);
SessionUtils.setCollectionAttribute(ClientConstants.HANDICAPPED_ENTITY, clientFormCreationDto.getClientDropdowns().getHandicapped(), request);
SessionUtils.setCollectionAttribute(CustomerConstants.CUSTOM_FIELDS_LIST, new ArrayList<CustomFieldDto>(), request);
SessionUtils.setCollectionAttribute(CustomerConstants.LOAN_OFFICER_LIST, clientFormCreationDto.getPersonnelList(), request);
SessionUtils.setCollectionAttribute(CustomerConstants.FORMEDBY_LOAN_OFFICER_LIST, clientFormCreationDto.getFormedByPersonnelList(), request);
SessionUtils.setCollectionAttribute(ClientConstants.SAVINGS_OFFERING_LIST, clientFormCreationDto.getSavingsOfferings(), request);
SessionUtils.setAttribute(GroupConstants.CENTER_HIERARCHY_EXIST, ClientRules.getCenterHierarchyExists(), request);
SessionUtils.setAttribute(ClientConstants.MAXIMUM_NUMBER_OF_FAMILY_MEMBERS, ClientRules.getMaximumNumberOfFamilyMembers(), request);
InformationOrderServiceFacade informationOrderServiceFacade = ApplicationContextProvider.getBean(InformationOrderServiceFacade.class);
SessionUtils.setCollectionAttribute("personalInformationOrder", informationOrderServiceFacade.getInformationOrder("CreateClient"), request);
boolean isFamilyDetailsRequired = ClientRules.isFamilyDetailsRequired();
SessionUtils.setAttribute(ClientConstants.ARE_FAMILY_DETAILS_REQUIRED, isFamilyDetailsRequired, request);
if (isFamilyDetailsRequired) {
boolean isFamilyDetailsMandatory = isFamilyDetailsMandatory();
if (!isFamilyDetailsMandatory) {
actionForm.removeFamilyMember(0);
}
SessionUtils.setAttribute(ClientConstants.ARE_FAMILY_DETAILS_MANDATORY, isFamilyDetailsMandatory, request);
SessionUtils.setAttribute(ClientConstants.ARE_FAMILY_DETAILS_HIDDEN, false, request);
} else {
SessionUtils.setAttribute(ClientConstants.ARE_FAMILY_DETAILS_MANDATORY, isSpouseFatherInformationMandatory(), request);
SessionUtils.setAttribute(ClientConstants.ARE_FAMILY_DETAILS_HIDDEN, isSpouseFatherInformationHidden(), request);
}
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class GroupServiceFacadeWebTier method convertFeeViewsToAccountFeeEntities.
private List<AccountFeesEntity> convertFeeViewsToAccountFeeEntities(List<ApplicableAccountFeeDto> feesToApply) {
List<AccountFeesEntity> feesForCustomerAccount = new ArrayList<AccountFeesEntity>();
for (ApplicableAccountFeeDto feeDto : feesToApply) {
FeeBO fee = feeDao.findById(feeDto.getFeeId().shortValue());
Double feeAmount = new LocalizationConverter().getDoubleValueForCurrentLocale(feeDto.getAmount());
AccountBO nullReferenceForNow = null;
AccountFeesEntity accountFee = new AccountFeesEntity(nullReferenceForNow, fee, feeAmount);
feesForCustomerAccount.add(accountFee);
}
return feesForCustomerAccount;
}
use of org.mifos.dto.domain.ApplicableAccountFeeDto in project head by mifos.
the class CreateClientCreationDetail method feeAsAccountFeeDto.
public List<ApplicableAccountFeeDto> feeAsAccountFeeDto(List<CreationFeeDto> feesToApply) {
List<ApplicableAccountFeeDto> feeDto = new ArrayList<ApplicableAccountFeeDto>();
for (CreationFeeDto f : feesToApply) {
ApplicableAccountFeeDto accFee = new ApplicableAccountFeeDto();
accFee.setFeeId(f.getFeeId());
accFee.setAmount(f.getAmount());
feeDto.add(accFee);
}
return feeDto;
}
Aggregations