use of org.mifos.dto.screen.ClientMfiInfoDto in project head by mifos.
the class ClientServiceFacadeWebTier method retrieveMfiInfoForEdit.
@Override
public ClientMfiInfoDto retrieveMfiInfoForEdit(String clientSystemId) {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserContext userContext = toUserContext(user);
ClientBO client = this.customerDao.findClientBySystemId(clientSystemId);
String groupDisplayName = "";
String centerDisplayName = "";
if (client.getParentCustomer() != null) {
groupDisplayName = client.getParentCustomer().getDisplayName();
if (client.getParentCustomer().getParentCustomer() != null) {
centerDisplayName = client.getParentCustomer().getParentCustomer().getDisplayName();
}
}
List<PersonnelDto> loanOfficersList = new ArrayList<PersonnelDto>();
if (!client.isClientUnderGroup()) {
CenterCreation centerCreation = new CenterCreation(client.getOffice().getOfficeId(), userContext.getId(), userContext.getLevelId(), userContext.getPreferredLocale());
loanOfficersList = this.personnelDao.findActiveLoanOfficersForOffice(centerCreation);
}
CustomerDetailDto customerDetail = client.toCustomerDetailDto();
ClientDetailDto clientDetail = client.toClientDetailDto(ClientRules.isFamilyDetailsRequired());
return new ClientMfiInfoDto(groupDisplayName, centerDisplayName, loanOfficersList, customerDetail, clientDetail);
}
use of org.mifos.dto.screen.ClientMfiInfoDto in project head by mifos.
the class PictureFormFile method editMfiInfo.
@TransactionDemarcate(joinToken = true)
public ActionForward editMfiInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ClientCustActionForm actionForm = (ClientCustActionForm) form;
actionForm.clearMostButNotAllFieldsOnActionForm();
ClientBO clientFromSession = getClientFromSession(request);
String clientSystemId = clientFromSession.getGlobalCustNum();
ClientMfiInfoDto mfiInfoDto = this.clientServiceFacade.retrieveMfiInfoForEdit(clientSystemId);
SessionUtils.setAttribute(GroupConstants.CENTER_HIERARCHY_EXIST, ClientRules.getCenterHierarchyExists(), request);
SessionUtils.setCollectionAttribute(CustomerConstants.LOAN_OFFICER_LIST, mfiInfoDto.getLoanOfficersList(), request);
actionForm.setGroupDisplayName(mfiInfoDto.getGroupDisplayName());
actionForm.setCenterDisplayName(mfiInfoDto.getCenterDisplayName());
actionForm.setLoanOfficerId(mfiInfoDto.getCustomerDetail().getLoanOfficerIdAsString());
actionForm.setCustomerId(mfiInfoDto.getCustomerDetail().getCustomerId().toString());
actionForm.setGlobalCustNum(mfiInfoDto.getCustomerDetail().getGlobalCustNum());
actionForm.setExternalId(mfiInfoDto.getCustomerDetail().getExternalId());
actionForm.setGroupFlag(mfiInfoDto.getClientDetail().getGroupFlagAsString());
actionForm.setParentGroupId(mfiInfoDto.getClientDetail().getParentGroupId().toString());
actionForm.setTrained(mfiInfoDto.getClientDetail().getTrainedAsString());
actionForm.setTrainedDate(mfiInfoDto.getClientDetail().getTrainedDate());
actionForm.setDateOfBirth(clientFromSession.getDateOfBirth());
ClientBO client = this.customerDao.findClientBySystemId(clientSystemId);
SessionUtils.removeThenSetAttribute(Constants.BUSINESS_KEY, client, request);
return mapping.findForward(ActionForwards.editMfiInfo_success.toString());
}
Aggregations