org.kuali.kfs.fp.document.validation.impl
Class DisbursementVoucherAccountingLineTotalsValidation

java.lang.Object
  extended by org.kuali.kfs.sys.document.validation.ParameterizedValidation
      extended by org.kuali.kfs.sys.document.validation.GenericValidation
          extended by org.kuali.kfs.sys.document.validation.impl.AccountingLineGroupTotalsUnchangedValidation
              extended by org.kuali.kfs.fp.document.validation.impl.DisbursementVoucherAccountingLineTotalsValidation
All Implemented Interfaces:
Validation

public class DisbursementVoucherAccountingLineTotalsValidation
extends AccountingLineGroupTotalsUnchangedValidation


Field Summary
protected static org.apache.log4j.Logger LOG
           
 
Constructor Summary
DisbursementVoucherAccountingLineTotalsValidation()
           
 
Method Summary
protected  List<String> getCandidateEditModes()
          define the possibly desired edit modes
protected  Set<String> getEditModesFromDocument(AccountingDocument accountingDocument, org.kuali.rice.kim.bo.Person financialSystemUser)
          Retrieves the current edit modes from the document
protected  List<String> getForeignDraftAndWireTransferEditModes(DisbursementVoucherDocument dvDocument)
          get foreign draft And wire transfer edit mode names, as well as tax if the payee is a non-resident alien
protected  boolean hasRequiredEditMode(Set<String> currentEditModes, List<String> candidateEditModes)
          determine whether the give user has permission to any edit mode defined in the given candidate edit modes
protected  boolean includeTaxAsTotalChangingMode(DisbursementVoucherDocument dvDocument)
          Determines whether the tax edit mode should be allowed to change the accounting line totals, based on whether the payee is a non-resident alient or not
 boolean validate(AttributedDocumentEvent event)
          Checks that the source and total amounts on the current version of the accounting document are equal to the persisted source and total totals.
 
Methods inherited from class org.kuali.kfs.sys.document.validation.impl.AccountingLineGroupTotalsUnchangedValidation
buildTotalChangeErrorMessage, getAccountingDocumentForValidation, handleNonExistentDocumentWhenApproving, retrievePersistedDocument, setAccountingDocumentForValidation
 
Methods inherited from class org.kuali.kfs.sys.document.validation.GenericValidation
setQuitOnFail, shouldQuitOnFail, stageValidation
 
Methods inherited from class org.kuali.kfs.sys.document.validation.ParameterizedValidation
getParameterProperties, populateParameterFromEvent, populateParametersFromEvent, setParameterProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG
Constructor Detail

DisbursementVoucherAccountingLineTotalsValidation

public DisbursementVoucherAccountingLineTotalsValidation()
Method Detail

validate

public boolean validate(AttributedDocumentEvent event)
Description copied from class: AccountingLineGroupTotalsUnchangedValidation
Checks that the source and total amounts on the current version of the accounting document are equal to the persisted source and total totals. Expects a document to be sent in as the first parameter

Specified by:
validate in interface Validation
Overrides:
validate in class AccountingLineGroupTotalsUnchangedValidation
Returns:
true if validation should continue, false otherwise
See Also:
AccountingLineGroupTotalsUnchangedValidation.validate(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)

hasRequiredEditMode

protected boolean hasRequiredEditMode(Set<String> currentEditModes,
                                      List<String> candidateEditModes)
determine whether the give user has permission to any edit mode defined in the given candidate edit modes

Parameters:
currentEditModes - the edit modes currently available to the given user on the document
candidateEditEditModes - the given candidate edit modes
Returns:
true if the give user has permission to any edit mode defined in the given candidate edit modes; otherwise, false

getEditModesFromDocument

protected Set<String> getEditModesFromDocument(AccountingDocument accountingDocument,
                                               org.kuali.rice.kim.bo.Person financialSystemUser)
Retrieves the current edit modes from the document

Parameters:
accountingDocument - the document to find edit modes of
financialSystemUser - the user requesting the edit modes
Returns:
the Set of current edit modes

getCandidateEditModes

protected List<String> getCandidateEditModes()
define the possibly desired edit modes

Returns:
the possibly desired edit modes

getForeignDraftAndWireTransferEditModes

protected List<String> getForeignDraftAndWireTransferEditModes(DisbursementVoucherDocument dvDocument)
get foreign draft And wire transfer edit mode names, as well as tax if the payee is a non-resident alien

Parameters:
dvDocument - the document we're validating
Returns:
foreign draft And wire transfer edit mode names

includeTaxAsTotalChangingMode

protected boolean includeTaxAsTotalChangingMode(DisbursementVoucherDocument dvDocument)
Determines whether the tax edit mode should be allowed to change the accounting line totals, based on whether the payee is a non-resident alient or not

Parameters:
dvDocument - the document to check
Returns:
true if the tax entry mode can change accounting line totals, false otherwise


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.