org.kuali.kfs.module.ld.document.validation.impl
Class LaborExpenseTransferNegtiveAmountBeTransferredValidation

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.module.ld.document.validation.impl.LaborExpenseTransferNegtiveAmountBeTransferredValidation
All Implemented Interfaces:
Validation

public class LaborExpenseTransferNegtiveAmountBeTransferredValidation
extends GenericValidation

Determines whether a negtive amount can be transferred from one account to another


Constructor Summary
LaborExpenseTransferNegtiveAmountBeTransferredValidation()
           
 
Method Summary
protected  Map<String,Object> buildFieldValueMap(ExpenseTransferAccountingLine accountingLine)
          build the field-value maps throught the given accouting line
protected  boolean canNegtiveAmountBeTransferred(Map<String,ExpenseTransferAccountingLine> accountingLineGroupMap)
          Determines whether a negtive amount can be transferred from one account to another
protected  List<String> defaultKeyOfExpenseTransferAccountingLine()
          Gets the default key of ExpenseTransferAccountingLine
protected  Map<String,ExpenseTransferAccountingLine> getAccountingLineGroupMap(List<ExpenseTransferAccountingLine> accountingLines, Class clazz)
          Groups the accounting lines by the specified key fields
protected  org.kuali.rice.kns.util.KualiDecimal getBalanceAmount(Map<String,Object> fieldValues, String periodCode)
          get the amount for a given period from a ledger balance that has the given values for specified fileds
protected  org.kuali.rice.kns.util.KualiDecimal getBalanceAmountOfGivenPeriod(Map<String,Object> fieldValues, String periodCode)
          Gets the balance amount of a given period
 org.kuali.rice.kns.document.Document getDocumentForValidation()
          Gets the documentForValidation attribute.
 void setDocumentForValidation(org.kuali.rice.kns.document.Document documentForValidation)
          Sets the accountingDocumentForValidation attribute value.
 boolean validate(AttributedDocumentEvent event)
          Validates before the document routes
 
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

LaborExpenseTransferNegtiveAmountBeTransferredValidation

public LaborExpenseTransferNegtiveAmountBeTransferredValidation()
Method Detail

validate

public boolean validate(AttributedDocumentEvent event)
Validates before the document routes

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

canNegtiveAmountBeTransferred

protected boolean canNegtiveAmountBeTransferred(Map<String,ExpenseTransferAccountingLine> accountingLineGroupMap)
Determines whether a negtive amount can be transferred from one account to another

Parameters:
accountingLineGroupMap - the givenaccountingLineGroupMap
Returns:
true if a negtive amount can be transferred from one account to another; otherwise, false

buildFieldValueMap

protected Map<String,Object> buildFieldValueMap(ExpenseTransferAccountingLine accountingLine)
build the field-value maps throught the given accouting line

Parameters:
accountingLine - the given accounting line
Returns:
the field-value maps built from the given accouting line

getAccountingLineGroupMap

protected Map<String,ExpenseTransferAccountingLine> getAccountingLineGroupMap(List<ExpenseTransferAccountingLine> accountingLines,
                                                                              Class clazz)
Groups the accounting lines by the specified key fields

Parameters:
accountingLines - the given accounting lines that are stored in a list
clazz - the class type of given accounting lines
Returns:
the accounting line groups

defaultKeyOfExpenseTransferAccountingLine

protected List<String> defaultKeyOfExpenseTransferAccountingLine()
Gets the default key of ExpenseTransferAccountingLine

Returns:
the default key of ExpenseTransferAccountingLine

getBalanceAmount

protected org.kuali.rice.kns.util.KualiDecimal getBalanceAmount(Map<String,Object> fieldValues,
                                                                String periodCode)
get the amount for a given period from a ledger balance that has the given values for specified fileds

Parameters:
fieldValues - the given fields and their values
periodCode - the given period
Returns:
the amount for a given period from the qualified ledger balance

getBalanceAmountOfGivenPeriod

protected org.kuali.rice.kns.util.KualiDecimal getBalanceAmountOfGivenPeriod(Map<String,Object> fieldValues,
                                                                             String periodCode)
Gets the balance amount of a given period

Parameters:
fieldValues -
periodCode -
Returns:

getDocumentForValidation

public org.kuali.rice.kns.document.Document getDocumentForValidation()
Gets the documentForValidation attribute.

Returns:
Returns the documentForValidation.

setDocumentForValidation

public void setDocumentForValidation(org.kuali.rice.kns.document.Document documentForValidation)
Sets the accountingDocumentForValidation attribute value.

Parameters:
documentForValidation - The documentForValidation to set.


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