/**
   * @see
   *     org.kuali.kfs.sys.document.validation.impl.AccountingLineAmountPositiveValidation#validate(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)
   */
  @Override
  public boolean validate(AttributedDocumentEvent event) {
    LOG.debug("validate start");
    boolean isValid = true;

    if (!parameterService.getParameterValueAsBoolean(
        DisbursementVoucherDocument.class,
        KFSParameterKeyConstants.FpParameterConstants.NEGATIVE_ACCOUNTING_LINES_IND)) {

      DisbursementVoucherDocument document =
          (DisbursementVoucherDocument) this.getAccountingDocumentForValidation();
      DisbursementVoucherNonResidentAlienTax nonResidentAlienTax =
          document.getDvNonResidentAlienTax();

      // tax accounting lines can have negative amounts
      if (nonResidentAlienTax != null) {
        List<String> taxLineNumbers =
            SpringContext.getBean(DisbursementVoucherTaxService.class)
                .getNRATaxLineNumbers(nonResidentAlienTax.getFinancialDocumentAccountingLineText());

        if (taxLineNumbers.contains(this.getAccountingLineForValidation().getSequenceNumber())) {
          return true;
        }
      }
      isValid = super.validate(event);
    }

    return isValid;
  }
 /**
  * Total amount to be paid to Vendor
  *
  * @return
  */
 public KualiDecimal getTotalPaidAmountToVendor() {
   KualiDecimal totalPaidAmountToVendor = KualiDecimal.ZERO;
   List<Document> relatedDisbursementList =
       getTravelDocumentService().getDocumentsRelatedTo(this, DISBURSEMENT_VOUCHER_DOCTYPE);
   for (Document document : relatedDisbursementList) {
     if (document instanceof DisbursementVoucherDocument) {
       DisbursementVoucherDocument dv = (DisbursementVoucherDocument) document;
       if (dv.getDocumentHeader().getWorkflowDocument().isFinal()) {
         totalPaidAmountToVendor = totalPaidAmountToVendor.add(dv.getDisbVchrCheckTotalAmount());
       }
     }
   }
   return totalPaidAmountToVendor;
 }