org.kuali.kfs.module.ec.document.validation.impl
Class LedgerBalanceFieldValidator

java.lang.Object
  extended by org.kuali.kfs.module.ec.document.validation.impl.LedgerBalanceFieldValidator

public class LedgerBalanceFieldValidator
extends Object

The validator provides a set of facilities to determine whether the given ledger balances meet the specified requirements. As a pattern, null would be returned if the requirements are met; otherwise, return an error message.


Constructor Summary
LedgerBalanceFieldValidator()
           
 
Method Summary
static SubFundGroup getSubFundGroup(LaborLedgerBalance ledgerBalance)
          get the sub fund group associated with the given ledger balance
static Message hasFederalFunds(Collection<LaborLedgerBalance> ledgerBalances, List<String> federalAgencyTypeCodes)
          determine whether there is at least one account of the given ledger balances that is funded by a federal grant.
static Message hasGrantAccount(Collection<LaborLedgerBalance> ledgerBalances)
          check if there is at least one account of the given ledger balances that has a fund group code or subfund group code that is in the specifed group codes.
static Message hasValidAccount(LaborLedgerBalance ledgerBalance)
          check if the given ledger balance has an account qualified for effort reporting
static Message isFromSingleOrganization(Collection<LaborLedgerBalance> ledgerBalances)
          determine if the given ledger balances have the accounts that belong to multiple organizations
static Message isInFundGroups(LaborLedgerBalance ledgerBalance, List<String> fundGroupCodes)
          detetermine if the fund group code associated with the given ledger balance is in the given fund group codes
static Message isInSubFundGroups(LaborLedgerBalance ledgerBalance, List<String> subFundGroupCodes)
          detetermine if the sub fund group code associated with the given ledger balance is in the given sub fund group codes
static Message isNonZeroAmountBalanceWithinReportPeriod(LaborLedgerBalance ledgerBalance, Map<Integer,Set<String>> reportPeriods)
          determine if the total amount within the specified periods of the given ledger balance is ZERO
static Message isTotalAmountPositive(Collection<LaborLedgerBalance> ledgerBalances, Map<Integer,Set<String>> reportPeriods)
          determine if the total amount within the specified periods of the given ledger balances is positive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LedgerBalanceFieldValidator

public LedgerBalanceFieldValidator()
Method Detail

hasValidAccount

public static Message hasValidAccount(LaborLedgerBalance ledgerBalance)
check if the given ledger balance has an account qualified for effort reporting

Parameters:
ledgerBalance - the given ledger balance
Returns:
null if the given ledger balance has an account qualified for effort reporting; otherwise, a message

isInFundGroups

public static Message isInFundGroups(LaborLedgerBalance ledgerBalance,
                                     List<String> fundGroupCodes)
detetermine if the fund group code associated with the given ledger balance is in the given fund group codes

Parameters:
ledgerBalance - the given ledger balance
fundGroupCodes - the given fund group codes
Returns:
null if the fund group code associated with the given ledger balance is in the given fund group codes; otherwise, a message

isInSubFundGroups

public static Message isInSubFundGroups(LaborLedgerBalance ledgerBalance,
                                        List<String> subFundGroupCodes)
detetermine if the sub fund group code associated with the given ledger balance is in the given sub fund group codes

Parameters:
ledgerBalance - the given ledger balance
subFundGroupCodes - the given sub fund group codes
Returns:
null if the sub fund group code associated with the given ledger balance is in the given sub fund group codes; otherwise, an error message

isNonZeroAmountBalanceWithinReportPeriod

public static Message isNonZeroAmountBalanceWithinReportPeriod(LaborLedgerBalance ledgerBalance,
                                                               Map<Integer,Set<String>> reportPeriods)
determine if the total amount within the specified periods of the given ledger balance is ZERO

Parameters:
ledgerBalance - the given ledger balance
reportPeriods - the specified periods
Returns:
null the total amount within the specified periods of the given ledger balance is NOT ZERO; otherwise, a message message

isTotalAmountPositive

public static Message isTotalAmountPositive(Collection<LaborLedgerBalance> ledgerBalances,
                                            Map<Integer,Set<String>> reportPeriods)
determine if the total amount within the specified periods of the given ledger balances is positive

Parameters:
ledgerBalance - the given ledger balance
reportPeriods - the specified periods
Returns:
null the total amount within the specified periods of the given ledger balance is positive; otherwise, a message message

hasGrantAccount

public static Message hasGrantAccount(Collection<LaborLedgerBalance> ledgerBalances)
check if there is at least one account of the given ledger balances that has a fund group code or subfund group code that is in the specifed group codes. If fundGroupDenotesCGIndictor is ture, only examine the fund group code associated with the ledger balances; otherwise, the sub fund group code.

Parameters:
ledgerBalances - the given ledger balances
Returns:
null if one of the group codes associated with the ledger balances is in the specified codes; otherwise, a message message

hasFederalFunds

public static Message hasFederalFunds(Collection<LaborLedgerBalance> ledgerBalances,
                                      List<String> federalAgencyTypeCodes)
determine whether there is at least one account of the given ledger balances that is funded by a federal grant. The award associated with the account must be one of the given federal agency types or have an enabled federal pass through flag.

Parameters:
the - given labor ledger balances
federalAgencyTypeCodes - the given federal agency type codes
Returns:
null if there is at least one account with federal funding; otherwise, a message

isFromSingleOrganization

public static Message isFromSingleOrganization(Collection<LaborLedgerBalance> ledgerBalances)
determine if the given ledger balances have the accounts that belong to multiple organizations

Parameters:
ledgerBalance - the given ledger balance
Returns:
null if the given ledger balances have the accounts that belong to a single organization; otherwise, a message

getSubFundGroup

public static SubFundGroup getSubFundGroup(LaborLedgerBalance ledgerBalance)
get the sub fund group associated with the given ledger balance

Parameters:
ledgerBalance - the given ledger balance
Returns:
the sub fund group associated with the given ledger balance


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