use of org.mifos.dto.screen.ClientDropdownsDto 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.ClientDropdownsDto in project head by mifos.
the class ClientServiceFacadeWebTier method retrieveClientFormCreationData.
@Override
public ClientFormCreationDto retrieveClientFormCreationData(Short groupFlag, Short officeId, String parentGroupId) {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserContext userContext = toUserContext(user);
List<PersonnelDto> personnelList = new ArrayList<PersonnelDto>();
MeetingBO parentCustomerMeeting = null;
Short formedByPersonnelId = null;
String formedByPersonnelName = "";
String centerDisplayName = "";
String groupDisplayName = "";
String officeName = "";
List<FeeBO> fees = new ArrayList<FeeBO>();
Short applicableOfficeId = officeId;
if (YesNoFlag.YES.getValue().equals(groupFlag)) {
Integer parentCustomerId = Integer.valueOf(parentGroupId);
CustomerBO parentCustomer = this.customerDao.findCustomerById(parentCustomerId);
groupDisplayName = parentCustomer.getDisplayName();
if (parentCustomer.getPersonnel() != null) {
formedByPersonnelId = parentCustomer.getPersonnel().getPersonnelId();
formedByPersonnelName = parentCustomer.getPersonnel().getDisplayName();
}
if (parentCustomer.getParentCustomer() != null) {
centerDisplayName = parentCustomer.getParentCustomer().getDisplayName();
}
applicableOfficeId = parentCustomer.getOffice().getOfficeId();
officeName = parentCustomer.getOffice().getOfficeName();
if (parentCustomer.getCustomerMeeting() != null) {
parentCustomerMeeting = parentCustomer.getCustomerMeetingValue();
fees = this.customerDao.retrieveFeesApplicableToClientsRefinedBy(parentCustomer.getCustomerMeetingValue());
} else {
fees = this.customerDao.retrieveFeesApplicableToClients();
}
} else if (YesNoFlag.NO.getValue().equals(groupFlag)) {
CenterCreation centerCreation = new CenterCreation(applicableOfficeId, userContext.getId(), userContext.getLevelId(), userContext.getPreferredLocale());
personnelList = this.personnelDao.findActiveLoanOfficersForOffice(centerCreation);
fees = this.customerDao.retrieveFeesApplicableToClients();
}
CustomerApplicableFeesDto applicableFees = CustomerApplicableFeesDto.toDto(fees, userContext);
List<ApplicableAccountFeeDto> defaultFees = new ArrayList<ApplicableAccountFeeDto>();
for (FeeDto fee : applicableFees.getDefaultFees()) {
defaultFees.add(new ApplicableAccountFeeDto(fee.getFeeIdValue().intValue(), fee.getFeeName(), fee.getAmount(), fee.isRemoved(), fee.isWeekly(), fee.isMonthly(), fee.isPeriodic(), fee.getFeeSchedule()));
}
List<ApplicableAccountFeeDto> additionalFees = new ArrayList<ApplicableAccountFeeDto>();
for (FeeDto fee : applicableFees.getAdditionalFees()) {
additionalFees.add(new ApplicableAccountFeeDto(fee.getFeeIdValue().intValue(), fee.getFeeName(), fee.getAmount(), fee.isRemoved(), fee.isWeekly(), fee.isMonthly(), fee.isPeriodic(), fee.getFeeSchedule()));
}
List<SavingsDetailDto> savingsOfferings = this.customerDao.retrieveSavingOfferingsApplicableToClient();
ClientRulesDto clientRules = retrieveClientRules();
ClientDropdownsDto clientDropdowns = retrieveClientDropdownData();
List<PersonnelDto> formedByPersonnel = this.customerDao.findLoanOfficerThatFormedOffice(applicableOfficeId);
MeetingDto parentMeeting = null;
if (parentCustomerMeeting != null) {
parentMeeting = parentCustomerMeeting.toDto();
}
return new ClientFormCreationDto(clientDropdowns, clientRules, applicableOfficeId, officeName, formedByPersonnelId, formedByPersonnelName, personnelList, formedByPersonnel, savingsOfferings, parentMeeting, centerDisplayName, groupDisplayName, additionalFees, defaultFees);
}
use of org.mifos.dto.screen.ClientDropdownsDto in project head by mifos.
the class ClientServiceFacadeWebTier method retrieveClientDropdownData.
private ClientDropdownsDto retrieveClientDropdownData() {
List<ValueListElement> salutations = this.customerDao.retrieveSalutations();
List<ValueListElement> genders = this.customerDao.retrieveGenders();
List<ValueListElement> maritalStatuses = this.customerDao.retrieveMaritalStatuses();
List<ValueListElement> citizenship = this.customerDao.retrieveCitizenship();
List<ValueListElement> ethnicity = this.customerDao.retrieveEthnicity();
List<ValueListElement> educationLevels = this.customerDao.retrieveEducationLevels();
List<ValueListElement> businessActivity = this.customerDao.retrieveBusinessActivities();
List<ValueListElement> poverty = this.customerDao.retrievePoverty();
List<ValueListElement> handicapped = this.customerDao.retrieveHandicapped();
List<ValueListElement> livingStatus = this.customerDao.retrieveLivingStatus();
ClientDropdownsDto clientDropdowns = new ClientDropdownsDto(salutations, genders, maritalStatuses, citizenship, ethnicity, educationLevels, businessActivity, poverty, handicapped, livingStatus);
return clientDropdowns;
}
use of org.mifos.dto.screen.ClientDropdownsDto 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