예제 #1
0
 public EffortCertificationDetail(EffortCertificationDetail effortCertificationDetail) {
   super();
   if (effortCertificationDetail != null) {
     this.chartOfAccountsCode = effortCertificationDetail.getChartOfAccountsCode();
     this.accountNumber = effortCertificationDetail.getAccountNumber();
     this.subAccountNumber = effortCertificationDetail.getSubAccountNumber();
     this.positionNumber = effortCertificationDetail.getPositionNumber();
     this.financialObjectCode = effortCertificationDetail.getFinancialObjectCode();
     this.sourceChartOfAccountsCode = effortCertificationDetail.getSourceChartOfAccountsCode();
     this.sourceAccountNumber = effortCertificationDetail.getSourceAccountNumber();
     this.effortCertificationPayrollAmount =
         effortCertificationDetail.getEffortCertificationPayrollAmount();
     this.effortCertificationCalculatedOverallPercent =
         effortCertificationDetail.getEffortCertificationCalculatedOverallPercent();
     this.effortCertificationUpdatedOverallPercent =
         effortCertificationDetail.getEffortCertificationUpdatedOverallPercent();
     this.universityFiscalYear = effortCertificationDetail.getUniversityFiscalYear();
     this.costShareSourceSubAccountNumber =
         effortCertificationDetail.getCostShareSourceSubAccountNumber();
     this.effortCertificationOriginalPayrollAmount =
         effortCertificationDetail.getEffortCertificationOriginalPayrollAmount();
     this.originalFringeBenefitAmount = effortCertificationDetail.getOriginalFringeBenefitAmount();
     this.effectiveDate = effortCertificationDetail.getEffectiveDate();
   }
 }
예제 #2
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;
  }
예제 #3
0
  /**
   * calculate the total original payroll amount of the given detail lines
   *
   * @param the given detail lines
   * @return Returns the total original payroll amount
   */
  public static KualiDecimal getTotalOriginalPayrollAmount(
      List<EffortCertificationDetail> effortCertificationDetailLines) {
    KualiDecimal totalOriginalPayrollAmount = KualiDecimal.ZERO;

    for (EffortCertificationDetail detailLine : effortCertificationDetailLines) {
      totalOriginalPayrollAmount =
          totalOriginalPayrollAmount.add(detailLine.getEffortCertificationOriginalPayrollAmount());
    }

    return totalOriginalPayrollAmount;
  }