Пример #1
0
  @Override
  public boolean processRunAuditBusinessRules(Document document) {
    boolean retval = true;

    retval &= new KcDocumentBaseAuditRule().processRunAuditBusinessRules(document);

    retval &= new BudgetPeriodAuditRule().processRunAuditBusinessRules(document);

    retval &= new BudgetExpensesAuditRule().processRunAuditBusinessRules(document);

    retval &= new BudgetPersonnelAuditRule().processRunPersonnelAuditBusinessRules(document);

    retval &= new BudgetRateAuditRule().processRunAuditBusinessRules(document);

    // Skipping D and I audits for Awards Budgets since we've temporarily removed the Award D&I tab
    if (!(document instanceof AwardBudgetDocument)) {

      retval &= new BudgetUnrecoveredFandAAuditRule().processRunAuditBusinessRules(document);

      retval &= new BudgetCostShareAuditRule().processRunAuditBusinessRules(document);
    }

    retval &= new ActivityTypeAuditRule().processRunAuditBusinessRules(document);

    if (!Boolean.valueOf(((BudgetDocument) document).getParentDocument().getProposalBudgetFlag())) {
      retval &= new AwardBudgetBudgetTypeAuditRule().processRunAuditBusinessRules(document);
      retval &= new AwardBudgeCostTotalAuditRule().processRunAuditBusinessRules(document);
      retval &= new AwardBudgetCostLimitAuditRule().processRunAuditBusinessRules(document);
    }
    if (retval) {
      processRunAuditBudgetVersionRule(((BudgetDocument) document).getParentDocument());
    }

    return retval;
  }
Пример #2
0
  @Override
  protected boolean processCustomSaveDocumentBusinessRules(Document document) {
    if (!(document instanceof BudgetDocument)) {
      return false;
    }

    boolean valid = true;

    BudgetDocument budgetDocument = (BudgetDocument) document;

    GlobalVariables.getMessageMap().addToErrorPath("document");
    GlobalVariables.getMessageMap().addToErrorPath("parentDocument");
    if (ObjectUtils.isNull(budgetDocument.getParentDocument())) {
      budgetDocument.refreshReferenceObject("parentDocument");
    }
    if (Boolean.valueOf(budgetDocument.getParentDocument().getProposalBudgetFlag())) {
      valid &= processBudgetVersionsBusinessRule(budgetDocument.getParentDocument(), true);
    }
    //        else {
    //            valid &= processBudgetTypeBusinessRules(budgetDocument);
    //        }
    GlobalVariables.getMessageMap().removeFromErrorPath("parentDocument");

    GlobalVariables.getMessageMap().addToErrorPath("budget");
    valid &= processBudgetPersonnelBusinessRules(budgetDocument);

    valid &= processBudgetExpenseBusinessRules(budgetDocument);

    valid &= processBudgetPersonnelBudgetBusinessRules(budgetDocument);

    valid &= processBudgetRatesBusinessRule(budgetDocument);

    valid &= processBudgetProjectIncomeBusinessRule(budgetDocument);

    GlobalVariables.getMessageMap().removeFromErrorPath("budget");
    GlobalVariables.getMessageMap().removeFromErrorPath("document");

    return valid;
  }