Ejemplo n.º 1
0
  /**
   * Gets the fieldInfo attribute.
   *
   * @return Returns the fieldInfo.
   */
  protected List<Map<String, String>> getFieldInfo(List<EffortCertificationDetail> detailLines) {
    LOG.debug("getFieldInfo(List<EffortCertificationDetail>) start");

    List<Map<String, String>> fieldInfo = new ArrayList<Map<String, String>>();
    EffortCertificationDocument document = (EffortCertificationDocument) this.getDocument();
    KualiDecimal totalOriginalPayrollAmount = document.getTotalOriginalPayrollAmount();

    for (EffortCertificationDetail detailLine : detailLines) {
      detailLine.refreshNonUpdateableReferences();

      Map<String, String> fieldInfoForAttribute = new HashMap<String, String>();

      fieldInfoForAttribute.put(
          KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE,
          detailLine.getChartOfAccounts().getFinChartOfAccountDescription());

      String accountInfo = buildAccountInfo(detailLine.getAccount());
      fieldInfoForAttribute.put(KFSPropertyConstants.ACCOUNT_NUMBER, accountInfo);

      SubAccount subAccount = detailLine.getSubAccount();
      if (ObjectUtils.isNotNull(subAccount)) {
        fieldInfoForAttribute.put(
            KFSPropertyConstants.SUB_ACCOUNT_NUMBER, subAccount.getSubAccountName());
      }

      ObjectCode objectCode = detailLine.getFinancialObject();
      if (ObjectUtils.isNotNull(objectCode)) {
        fieldInfoForAttribute.put(
            KFSPropertyConstants.FINANCIAL_OBJECT_CODE, objectCode.getFinancialObjectCodeName());
      }

      Account sourceAccount = detailLine.getSourceAccount();
      if (ObjectUtils.isNotNull(sourceAccount)) {
        fieldInfoForAttribute.put(
            EffortPropertyConstants.SOURCE_ACCOUNT_NUMBER, sourceAccount.getAccountName());
      }

      Chart sourceChart = detailLine.getSourceChartOfAccounts();
      if (ObjectUtils.isNotNull(sourceChart)) {
        fieldInfoForAttribute.put(
            EffortPropertyConstants.SOURCE_CHART_OF_ACCOUNTS_CODE,
            sourceChart.getFinChartOfAccountDescription());
      }

      KualiDecimal originalPayrollAmount = detailLine.getEffortCertificationOriginalPayrollAmount();
      String actualOriginalPercent =
          PayrollAmountHolder.recalculateEffortPercentAsString(
              totalOriginalPayrollAmount, originalPayrollAmount);
      fieldInfoForAttribute.put(
          EffortPropertyConstants.EFFORT_CERTIFICATION_CALCULATED_OVERALL_PERCENT,
          actualOriginalPercent);

      fieldInfo.add(fieldInfoForAttribute);
    }

    return fieldInfo;
  }
Ejemplo n.º 2
0
  /**
   * append the extract query string into the given base URL
   *
   * @param baseURL the given base URL. If the parameter is blank, the base URL won't be changed
   * @return the complete URL built from the given base URL and extra query strings
   */
  protected String getCompleteURL(String baseURL) {
    if (StringUtils.isBlank(baseURL)) {
      return baseURL;
    }

    String completeURL = baseURL;
    EffortCertificationDocument document = (EffortCertificationDocument) this.getDocument();
    Properties properties = new Properties();

    properties.put(KFSPropertyConstants.EMPLID, document.getEmplid());
    properties.put(
        EffortPropertyConstants.EFFORT_CERTIFICATION_REPORT_NUMBER,
        document.getEffortCertificationReportNumber());
    properties.put(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, document.getUniversityFiscalYear());

    StringBuilder queryString = new StringBuilder();
    for (Object key : properties.keySet()) {
      queryString.append("&").append(key).append("=").append(properties.get(key));
    }

    return completeURL.concat(queryString.toString());
  }
Ejemplo n.º 3
0
 /**
  * Gets the detailLines attribute.
  *
  * @return Returns the detailLines.
  */
 public List<EffortCertificationDetail> getDetailLines() {
   EffortCertificationDocument effortCertificationDocument =
       (EffortCertificationDocument) this.getDocument();
   return effortCertificationDocument.getEffortCertificationDetailLines();
 }