@Override public List<ApplicableCharge> getApplicableFees(Integer accountId) { try { MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); UserContext userContext = toUserContext(user); AccountBO account = this.accountBusinessService.getAccount(accountId); try { personnelDao.checkAccessPermission( userContext, account.getOfficeId(), account.getCustomer().getLoanOfficerId()); } catch (AccountException e) { throw new MifosRuntimeException(e.getMessage(), e); } return new AccountBusinessService().getAppllicableFees(accountId, userContext); } catch (ServiceException e) { throw new MifosRuntimeException(e); } }
@Override public CenterInformationDto getCenterInformationDto(String globalCustNum) { MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); UserContext userContext = toUserContext(user); CenterBO center = customerDao.findCenterBySystemId(globalCustNum); if (center == null) { throw new MifosRuntimeException("Center not found for globalCustNum" + globalCustNum); } try { personnelDao.checkAccessPermission( userContext, center.getOfficeId(), center.getLoanOfficerId()); } catch (AccountException e) { throw new MifosRuntimeException("Access denied!", e); } CenterDisplayDto centerDisplay = customerDao.getCenterDisplayDto(center.getCustomerId(), userContext); Integer centerId = center.getCustomerId(); String searchId = center.getSearchId(); Short branchId = centerDisplay.getBranchId(); CustomerAccountSummaryDto customerAccountSummary = customerDao.getCustomerAccountSummaryDto(centerId); CenterPerformanceHistoryDto centerPerformanceHistory = customerDao.getCenterPerformanceHistory(searchId, branchId); CustomerAddressDto centerAddress = customerDao.getCustomerAddressDto(center); List<CustomerDetailDto> groups = customerDao.getGroupsOtherThanClosedAndCancelledForGroup(searchId, branchId); List<CustomerNoteDto> recentCustomerNotes = customerDao.getRecentCustomerNoteDto(centerId); List<CustomerPositionOtherDto> customerPositions = customerDao.getCustomerPositionDto(centerId, userContext); List<SavingsDetailDto> savingsDetail = customerDao.getSavingsDetailDto(centerId, userContext); CustomerMeetingDto customerMeeting = customerDao.getCustomerMeetingDto(center.getCustomerMeeting(), userContext); Boolean activeSurveys = Boolean.FALSE; // new SurveysPersistence().isActiveSurveysForSurveyType(SurveyType.CENTER); List<SurveyDto> customerSurveys = new ArrayList<SurveyDto>(); List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>(); return new CenterInformationDto( centerDisplay, customerAccountSummary, centerPerformanceHistory, centerAddress, groups, recentCustomerNotes, customerPositions, savingsDetail, customerMeeting, activeSurveys, customerSurveys, customFields); }