use of org.mifos.dto.screen.ClientDetailDto 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.ClientDetailDto in project head by mifos.
the class ClientServiceFacadeWebTier method retrieveFamilyInfoForEdit.
@Override
public ClientFamilyInfoDto retrieveFamilyInfoForEdit(String clientGlobalCustNum) {
ClientBO client = this.customerDao.findClientBySystemId(clientGlobalCustNum);
ClientDropdownsDto clientDropdowns = retrieveClientDropdownData();
ClientRulesDto clientRules = retrieveClientRules();
CustomerDetailDto customerDetail = client.toCustomerDetailDto();
ClientDetailDto clientDetail = client.toClientDetailDto(clientRules.isFamilyDetailsRequired());
List<ClientNameDetailDto> familyMembers = new ArrayList<ClientNameDetailDto>();
Map<Integer, List<ClientFamilyDetailDto>> clientFamilyDetails = new HashMap<Integer, List<ClientFamilyDetailDto>>();
int familyMemberCount = 0;
for (ClientNameDetailEntity clientNameDetailEntity : client.getNameDetailSet()) {
if (clientNameDetailEntity.isNotClientNameType()) {
ClientNameDetailDto nameView1 = clientNameDetailEntity.toDto();
familyMembers.add(nameView1);
for (ClientFamilyDetailEntity clientFamilyDetailEntity : client.getFamilyDetailSet()) {
if (clientNameDetailEntity.matchesCustomerId(clientFamilyDetailEntity.getClientName().getCustomerNameId())) {
ClientFamilyDetailDto clientFamilyDetail = clientFamilyDetailEntity.toDto();
addFamilyDetailsDtoToMap(clientFamilyDetails, familyMemberCount, clientFamilyDetail);
}
}
familyMemberCount++;
}
}
return new ClientFamilyInfoDto(clientDropdowns, customerDetail, clientDetail, familyMembers, clientFamilyDetails);
}
use of org.mifos.dto.screen.ClientDetailDto in project head by mifos.
the class ClientBO method toClientDetailDto.
public ClientDetailDto toClientDetailDto(boolean isFamilyDetailsRequired) {
ClientPersonalDetailDto customerDetailView = this.getCustomerDetail().toDto();
String dateOfBirthAsString = "";
if (this.dateOfBirth != null) {
dateOfBirthAsString = DateUtils.makeDateAsSentFromBrowser(this.dateOfBirth);
}
List<ClientNameDetailDto> clientNameViews = toClientNameDetailViews();
ClientNameDetailDto clientName = null;
ClientNameDetailDto spouseName = null;
for (ClientNameDetailDto nameView : clientNameViews) {
if (nameView.getNameType() != null) {
if (nameView.getNameType().equals(ClientConstants.CLIENT_NAME_TYPE)) {
clientName = nameView;
} else if (!isFamilyDetailsRequired) {
spouseName = nameView;
}
} else {
spouseName = new ClientNameDetailDto();
}
}
boolean groupFlagIsSet = false;
Integer parentGroupId = Integer.valueOf(0);
if (isClientUnderGroup()) {
groupFlagIsSet = true;
parentGroupId = getParentCustomer().getCustomerId();
}
boolean trained = isTrained();
String trainedDate = "";
if (getTrainedDate() != null) {
trainedDate = DateUtils.makeDateAsSentFromBrowser(getTrainedDate());
}
return new ClientDetailDto(this.governmentId, dateOfBirthAsString, customerDetailView, clientName, spouseName, groupFlagIsSet, parentGroupId, trained, trainedDate);
}
use of org.mifos.dto.screen.ClientDetailDto in project head by mifos.
the class ClientServiceFacadeWebTier method retrieveClientPersonalInfoForUpdate.
@Override
public ClientPersonalInfoDto retrieveClientPersonalInfoForUpdate(String clientSystemId, String clientStatus, short loanOfficerId) {
ClientDropdownsDto clientDropdowns = retrieveClientDropdownData();
ClientRulesDto clientRules = retrieveClientRules();
ClientBO client = this.customerDao.findClientBySystemId(clientSystemId);
CustomerDetailDto customerDetailDto = client.toCustomerDetailDto();
ClientDetailDto clientDetailDto = client.toClientDetailDto(clientRules.isFamilyDetailsRequired());
return new ClientPersonalInfoDto(clientDropdowns, clientRules, customerDetailDto, clientDetailDto);
}
Aggregations