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

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.LaborExpenseTransferAccountingLineTotalsMatchByPayFYAndPayPeriodValidation
All Implemented Interfaces:
Validation

public class LaborExpenseTransferAccountingLineTotalsMatchByPayFYAndPayPeriodValidation
extends GenericValidation

check to ensure totals of accounting lines in source and target sections match by pay FY + pay period


Constructor Summary
LaborExpenseTransferAccountingLineTotalsMatchByPayFYAndPayPeriodValidation()
           
 
Method Summary
protected  boolean compareAccountingLineTotalsByPayFYAndPayPeriod(Map sourceLinesMap, Map targetLinesMap)
          This method checks that the total amount of labor ledger accounting lines in the document's FROM section is equal to the total amount on the labor ledger accounting lines TO section for each unique combination of pay fiscal year and pay period.
protected  String createPayFYPeriodKey(Integer payFiscalYear, String payPeriodCode)
          This method returns a String that is a concatenation of pay fiscal year and pay period code.
 org.kuali.rice.kns.document.Document getDocumentForValidation()
          Gets the documentForValidation attribute.
 boolean isAccountingLineTotalsMatchByPayFYAndPayPeriod(List sourceLines, List targetLines)
          This method calls other methods to check if all source and target accounting lines match between each set by pay fiscal year and pay period, returning true if the totals match, false otherwise.
 void setDocumentForValidation(org.kuali.rice.kns.document.Document documentForValidation)
          Sets the documentForValidation attribute value.
protected  Map sumAccountingLineAmountsByPayFYAndPayPeriod(List accountingLines)
          This method sums the totals of each accounting line, making an entry in a map for each unique pay fiscal year and pay period.
 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

LaborExpenseTransferAccountingLineTotalsMatchByPayFYAndPayPeriodValidation

public LaborExpenseTransferAccountingLineTotalsMatchByPayFYAndPayPeriodValidation()
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[])

isAccountingLineTotalsMatchByPayFYAndPayPeriod

public boolean isAccountingLineTotalsMatchByPayFYAndPayPeriod(List sourceLines,
                                                              List targetLines)
This method calls other methods to check if all source and target accounting lines match between each set by pay fiscal year and pay period, returning true if the totals match, false otherwise.

Parameters:
sourceLines -
targetLines -
Returns:

sumAccountingLineAmountsByPayFYAndPayPeriod

protected Map sumAccountingLineAmountsByPayFYAndPayPeriod(List accountingLines)
This method sums the totals of each accounting line, making an entry in a map for each unique pay fiscal year and pay period.

Parameters:
accountingLines -
Returns:

createPayFYPeriodKey

protected String createPayFYPeriodKey(Integer payFiscalYear,
                                      String payPeriodCode)
This method returns a String that is a concatenation of pay fiscal year and pay period code.

Parameters:
payFiscalYear -
payPeriodCode -
Returns:

compareAccountingLineTotalsByPayFYAndPayPeriod

protected boolean compareAccountingLineTotalsByPayFYAndPayPeriod(Map sourceLinesMap,
                                                                 Map targetLinesMap)
This method checks that the total amount of labor ledger accounting lines in the document's FROM section is equal to the total amount on the labor ledger accounting lines TO section for each unique combination of pay fiscal year and pay period. A value of true is returned if all amounts for each unique combination between source and target accounting lines match, false otherwise.

Parameters:
sourceLinesMap -
targetLinesMap -
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 documentForValidation attribute value.

Parameters:
documentForValidation - The documentForValidation to set.


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