org.kuali.kfs.sys.document.validation.impl
Class AccountingLineGroupTotalsUnchangedValidation

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
All Implemented Interfaces:
Validation
Direct Known Subclasses:
BudgetAdjustmentAccountingLineTotalsUnchangedValidation, DisbursementVoucherAccountingLineTotalsValidation

public class AccountingLineGroupTotalsUnchangedValidation
extends GenericValidation

A validation, used on accounting document approval, that accounting line totals are unchanged


Constructor Summary
AccountingLineGroupTotalsUnchangedValidation()
           
 
Method Summary
protected  void buildTotalChangeErrorMessage(String propertyName, org.kuali.rice.kns.util.KualiDecimal persistedSourceLineTotal, org.kuali.rice.kns.util.KualiDecimal currentSourceLineTotal)
          This method builds out the error message for when totals have changed.
 AccountingDocument getAccountingDocumentForValidation()
          Gets the accountingDocumentForValidation attribute.
protected  void handleNonExistentDocumentWhenApproving(AccountingDocument accountingDocument)
          Handles the case when a non existent document is attempted to be retrieve and that if it's in an initiated state, it's ok.
protected  AccountingDocument retrievePersistedDocument(AccountingDocument accountingDocument)
          attempt to retrieve the document from the DB for comparison
 void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)
          Sets the accountingDocumentForValidation attribute value.
 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.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
 

Constructor Detail

AccountingLineGroupTotalsUnchangedValidation

public AccountingLineGroupTotalsUnchangedValidation()
Method Detail

validate

public 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. Expects a document to be sent in as the first parameter

Returns:
true if validation should continue, false otherwise
See Also:
org.kuali.kfs.sys.document.validation.GenericValidation#validate(java.lang.Object[])

retrievePersistedDocument

protected AccountingDocument retrievePersistedDocument(AccountingDocument accountingDocument)
attempt to retrieve the document from the DB for comparison

Parameters:
accountingDocument -
Returns:
AccountingDocument

buildTotalChangeErrorMessage

protected void buildTotalChangeErrorMessage(String propertyName,
                                            org.kuali.rice.kns.util.KualiDecimal persistedSourceLineTotal,
                                            org.kuali.rice.kns.util.KualiDecimal currentSourceLineTotal)
This method builds out the error message for when totals have changed.

Parameters:
propertyName -
persistedSourceLineTotal -
currentSourceLineTotal -

handleNonExistentDocumentWhenApproving

protected final void handleNonExistentDocumentWhenApproving(AccountingDocument accountingDocument)
Handles the case when a non existent document is attempted to be retrieve and that if it's in an initiated state, it's ok.

Parameters:
accountingDocument -

getAccountingDocumentForValidation

public AccountingDocument getAccountingDocumentForValidation()
Gets the accountingDocumentForValidation attribute.

Returns:
Returns the accountingDocumentForValidation.

setAccountingDocumentForValidation

public void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)
Sets the accountingDocumentForValidation attribute value.

Parameters:
accountingDocumentForValidation - The accountingDocumentForValidation to set.


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