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

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.fp.document.validation.impl.JournalVoucherAccountingLineAmountValidation
All Implemented Interfaces:
Validation

public class JournalVoucherAccountingLineAmountValidation
extends GenericValidation

The Journal Voucher's version of the accounting line amount validation


Constructor Summary
JournalVoucherAccountingLineAmountValidation()
           
 
Method Summary
protected  String buildErrorMapKeyPathForDebitCreditAmount(boolean isDebit)
          This method looks at the current full key path that exists in the ErrorMap structure to determine how to build the error map for the special journal voucher credit and debit fields since they don't conform to the standard pattern of accounting lines.
 AccountingLine getAccountingLineForValidation()
          Gets the accountingLineForValidation attribute.
 JournalVoucherDocument getJournalVoucherForValidation()
          Gets the journalVoucherForValidation attribute.
 void setAccountingLineForValidation(AccountingLine accountingLineForValidation)
          Sets the accountingLineForValidation attribute value.
 void setJournalVoucherForValidation(JournalVoucherDocument journalVoucherForValidation)
          Sets the journalVoucherForValidation attribute value.
 boolean validate(AttributedDocumentEvent event)
          Accounting lines for Journal Vouchers can be positive or negative, just not "$0.00".
 
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

JournalVoucherAccountingLineAmountValidation

public JournalVoucherAccountingLineAmountValidation()
Method Detail

validate

public boolean validate(AttributedDocumentEvent event)
Accounting lines for Journal Vouchers can be positive or negative, just not "$0.00". Additionally, accounting lines cannot have negative dollar amounts if the balance type of the journal voucher allows for general ledger pending entry offset generation or the balance type is not a budget type code.

Returns:
true if validation should continue, false otherwise
See Also:
Validation.validate(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)

buildErrorMapKeyPathForDebitCreditAmount

protected String buildErrorMapKeyPathForDebitCreditAmount(boolean isDebit)
This method looks at the current full key path that exists in the ErrorMap structure to determine how to build the error map for the special journal voucher credit and debit fields since they don't conform to the standard pattern of accounting lines. The error map key path is also dependent on whether or not the accounting line containing an error is a new accounting line or an existing line that is being updated. This determination is made by searching for NEW_SOURCE_ACCT_LINE_PROPERTY_NAME in the error path of the global error map.

Parameters:
isDebit - Identifies whether or not the line we are returning an error path for is a debit accounting line or not.
Returns:
The full error map key path for the appropriate amount type.

getAccountingLineForValidation

public AccountingLine getAccountingLineForValidation()
Gets the accountingLineForValidation attribute.

Returns:
Returns the accountingLineForValidation.

setAccountingLineForValidation

public void setAccountingLineForValidation(AccountingLine accountingLineForValidation)
Sets the accountingLineForValidation attribute value.

Parameters:
accountingLineForValidation - The accountingLineForValidation to set.

getJournalVoucherForValidation

public JournalVoucherDocument getJournalVoucherForValidation()
Gets the journalVoucherForValidation attribute.

Returns:
Returns the journalVoucherForValidation.

setJournalVoucherForValidation

public void setJournalVoucherForValidation(JournalVoucherDocument journalVoucherForValidation)
Sets the journalVoucherForValidation attribute value.

Parameters:
journalVoucherForValidation - The journalVoucherForValidation to set.


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