@Override
  public CenterDto retrieveCenterDetailsForUpdate(Integer centerId) {

    MifosUser user =
        (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    UserContext userContext = toUserContext(user);

    CustomerBO center = customerDao.findCustomerById(centerId);

    Short officeId = center.getOffice().getOfficeId();
    String searchId = center.getSearchId();
    Short loanOfficerId = extractLoanOfficerId(center);

    CenterCreation centerCreation =
        new CenterCreation(
            officeId,
            userContext.getId(),
            userContext.getLevelId(),
            userContext.getPreferredLocale());
    List<PersonnelDto> activeLoanOfficersForBranch =
        personnelDao.findActiveLoanOfficersForOffice(centerCreation);

    List<CustomerDto> customerList =
        customerDao.findClientsThatAreNotCancelledOrClosed(searchId, officeId);

    List<CustomerPositionDto> customerPositionDtos =
        generateCustomerPositionViews(center, userContext.getLocaleId());

    DateTime mfiJoiningDate = new DateTime();
    String mfiJoiningDateAsString = "";
    if (center.getMfiJoiningDate() != null) {
      mfiJoiningDate = new DateTime(center.getMfiJoiningDate());
      mfiJoiningDateAsString =
          DateUtils.getUserLocaleDate(
              userContext.getPreferredLocale(), center.getMfiJoiningDate().toString());
    }

    AddressDto address = null;
    if (center.getAddress() != null) {
      address = Address.toDto(center.getAddress());
    }
    return new CenterDto(
        loanOfficerId,
        center.getCustomerId(),
        center.getGlobalCustNum(),
        mfiJoiningDate,
        mfiJoiningDateAsString,
        center.getExternalId(),
        address,
        customerPositionDtos,
        customerList,
        activeLoanOfficersForBranch,
        true);
  }