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

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

public class EffortCertificationDocumentRuleUtil
extends Object

Provides a set of facilities to determine whether the given Effort Certification Documents or Effort Certification Detail meet the specified requirements.


Constructor Summary
EffortCertificationDocumentRuleUtil()
           
 
Method Summary
static void applyDefaultValues(EffortCertificationDetail detailLine)
          reset the attribute with the blank value to the default values
static boolean canExpiredAccountBeUsed(EffortCertificationDetail detailLine)
          determine whether the expired account in the detail line can be used.
static boolean hasA21SubAccount(EffortCertificationDetail detailLine)
          determine if the sub account associated with the given detail line is a valid A21 sub account
static boolean hasClosedAccount(EffortCertificationDetail detailLine)
          determine if the given detail line is associated with a closed account
static boolean hasContractGrantAccount(EffortCertificationDetail detailLine)
          determine if the given detail line is associated with a contract grant account
static boolean hasCostShareSubAccount(EffortCertificationDetail detailLine, List<String> designatedCostShareSubAccountTypeCodes)
          determine if the given detail line is associated with a sub account whose type code is in the given list
static boolean hasDetailLine(EffortCertificationDocument document)
          determine if there is a line associated with the given document
static boolean hasNonnegativePayrollAmount(EffortCertificationDetail detailLine)
          determine if the payroll amount of the given detail line is not negative
static boolean hasSameExistingLine(EffortCertificationDocument document, EffortCertificationDetail detailLine, List<String> comparableFields)
          determine if there is a line in the given document that has the same values for the comparable fields as the given detail line
static boolean hasValidEffortPercent(EffortCertificationDetail detailLine)
          determine if the given detail line has a valid effort percentage.
static boolean hasValidFormat(EffortCertificationDetail detailLine)
          determine if the fields in the detail line are in the correct formats defined in the data dictionary
static boolean isEffortPercentChangedFromPersisted(EffortCertificationDetail detailLine)
          determine if there is a change on the payroll amount of the given detail line comparing to its persisted payroll amount
static boolean isEffortPercentChangedFromPersisted(EffortCertificationDocument document)
          determine if there is a change on the payroll amount of the given document
static boolean isOriginalEffortPercentSameAsCurrentEffortPercent(Integer originalEffortPercent, Integer effortPercent)
          determine if original effort percent is same as the current effort percent for the given detail line
static boolean isPayrollAmountChangedFromOriginal(EffortCertificationDetail detailLine)
          determine if there is a change on the payroll amount of the given detail line comparing to its original payroll amount
static boolean isPayrollAmountChangedFromOriginal(EffortCertificationDocument document)
          determine if there is a change on the payroll amount of the given document
static boolean isPayrollAmountChangedFromPersisted(EffortCertificationDetail detailLine)
          determine if there is a change on the payroll amount of the given detail line comparing to its persisted payroll amount
static boolean isPayrollAmountChangedFromPersisted(EffortCertificationDocument document)
          determine if there is a change on the payroll amount of the given document
static boolean isPayrollAmountNonnegative(org.kuali.rice.kns.util.KualiDecimal payrollAmount)
          determine if the given payroll amount is greater than and equal to 0
static boolean isPayrollAmountOverChanged(EffortCertificationDetail detailLine, org.kuali.rice.kns.util.KualiDecimal originalTotalAmount, double limitOfLinePayrollAmountChange)
          determine if the change on the payroll amount of the given detail line exceeds the specified limit
static boolean isPayrollAmountOverChanged(EffortCertificationDocument document, double limitOfLinePayrollAmountChange)
          determine if there is a change on the payroll amount of a detail line that exceeds the specified limit
static boolean isTotalEffortPercentageAs100(EffortCertificationDocument document)
          detrmine if the total effort percent of the given document is 100
static boolean isTotalPayrollAmountOverChanged(EffortCertificationDocument document, double limitOfTotalPayrollAmountChange)
          determine if the change on the total payroll amount exceeds the specified limit
static boolean isValidPercent(Integer percent)
          determine if the given percent is between 0 and 100.
static void updateSourceAccountInformation(EffortCertificationDetail detailLine)
          update the information of the source attributes for the given detail line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EffortCertificationDocumentRuleUtil

public EffortCertificationDocumentRuleUtil()
Method Detail

applyDefaultValues

public static void applyDefaultValues(EffortCertificationDetail detailLine)
reset the attribute with the blank value to the default values

Parameters:
detailLine - the given detail line

canExpiredAccountBeUsed

public static boolean canExpiredAccountBeUsed(EffortCertificationDetail detailLine)
determine whether the expired account in the detail line can be used.

Parameters:
detailLine - the given detail line
Returns:
true if the expired account in the detail line can be used; otherwise, false

hasA21SubAccount

public static boolean hasA21SubAccount(EffortCertificationDetail detailLine)
determine if the sub account associated with the given detail line is a valid A21 sub account

Parameters:
detailLine - the given detail line
Returns:
true if the sub account associated with the given detail line is a valid A21 sub account; otherwise, false

hasClosedAccount

public static boolean hasClosedAccount(EffortCertificationDetail detailLine)
determine if the given detail line is associated with a closed account

Parameters:
detailLine - the given detail line
Returns:
true if the given detail line is associated with a closed account; otherwise, false

hasContractGrantAccount

public static boolean hasContractGrantAccount(EffortCertificationDetail detailLine)
determine if the given detail line is associated with a contract grant account

Parameters:
detailLine - the given detail line
Returns:
true if the given detail line is associated with a contract grant account; otherwise, false

hasCostShareSubAccount

public static boolean hasCostShareSubAccount(EffortCertificationDetail detailLine,
                                             List<String> designatedCostShareSubAccountTypeCodes)
determine if the given detail line is associated with a sub account whose type code is in the given list

Parameters:
detailLine - the given detail line
designatedCostShareSubAccountTypeCode - the designated cost share sub account type codes
Returns:
true if the given detail line is associated with a sub account whose type code is in the given list; otherwise, false

hasNonnegativePayrollAmount

public static boolean hasNonnegativePayrollAmount(EffortCertificationDetail detailLine)
determine if the payroll amount of the given detail line is not negative

Parameters:
detailLine - the given detail line
Returns:
true if the payroll amount of the given detail line is not negative; otherwise, false

hasSameExistingLine

public static boolean hasSameExistingLine(EffortCertificationDocument document,
                                          EffortCertificationDetail detailLine,
                                          List<String> comparableFields)
determine if there is a line in the given document that has the same values for the comparable fields as the given detail line

Parameters:
document - the given effort certification document
detailLine - the given detail line
comparableFields - the comparable fields
Returns:
true if there is a line in the given document that has the same values for the comparable fields as the given detail line; otherwise, false

hasValidEffortPercent

public static boolean hasValidEffortPercent(EffortCertificationDetail detailLine)
determine if the given detail line has a valid effort percentage. The percentage should be between 0 and 100.

Parameters:
detailLine - the given detail line
Returns:
true if the given detail line has a valid effort percentage; otherwise, false

hasValidFormat

public static boolean hasValidFormat(EffortCertificationDetail detailLine)
determine if the fields in the detail line are in the correct formats defined in the data dictionary

Parameters:
detailLine - the given detail line
Returns:
true if the fields in the detail line are in the correct formats defined in the data dictionary; otherwise, false

isPayrollAmountChangedFromOriginal

public static boolean isPayrollAmountChangedFromOriginal(EffortCertificationDetail detailLine)
determine if there is a change on the payroll amount of the given detail line comparing to its original payroll amount

Parameters:
detailLine - the given effort certification detail line
Returns:
true if there is a change on the payroll amount of the given detail line comparing to its original payroll amount

isPayrollAmountChangedFromOriginal

public static boolean isPayrollAmountChangedFromOriginal(EffortCertificationDocument document)
determine if there is a change on the payroll amount of the given document

Parameters:
document - the given effort certification document
Returns:
true if there is the change on the payroll amount of any detail line in the given document

isPayrollAmountChangedFromPersisted

public static boolean isPayrollAmountChangedFromPersisted(EffortCertificationDetail detailLine)
determine if there is a change on the payroll amount of the given detail line comparing to its persisted payroll amount

Parameters:
detailLine - the given effort certification detail line
Returns:
true if there is a change on the payroll amount of the given detail line comparing to its persisted payroll amount

isPayrollAmountChangedFromPersisted

public static boolean isPayrollAmountChangedFromPersisted(EffortCertificationDocument document)
determine if there is a change on the payroll amount of the given document

Parameters:
document - the given effort certification document
Returns:
true if there is the change on the payroll amount of any detail line in the given document

isEffortPercentChangedFromPersisted

public static boolean isEffortPercentChangedFromPersisted(EffortCertificationDetail detailLine)
determine if there is a change on the payroll amount of the given detail line comparing to its persisted payroll amount

Parameters:
detailLine - the given effort certification detail line
Returns:
true if there is a change on the payroll amount of the given detail line comparing to its persisted payroll amount

isEffortPercentChangedFromPersisted

public static boolean isEffortPercentChangedFromPersisted(EffortCertificationDocument document)
determine if there is a change on the payroll amount of the given document

Parameters:
document - the given effort certification document
Returns:
true if there is the change on the payroll amount of any detail line in the given document

isPayrollAmountNonnegative

public static boolean isPayrollAmountNonnegative(org.kuali.rice.kns.util.KualiDecimal payrollAmount)
determine if the given payroll amount is greater than and equal to 0

Parameters:
payrollAmount - the given payroll amount
Returns:
true if the given payroll amount is greater than and equal to 0; otherwise, false

isOriginalEffortPercentSameAsCurrentEffortPercent

public static boolean isOriginalEffortPercentSameAsCurrentEffortPercent(Integer originalEffortPercent,
                                                                        Integer effortPercent)
determine if original effort percent is same as the current effort percent for the given detail line

Parameters:
detailLine - the given effort certification detail line
Returns:
true if original effort percent same as current effort percent

isPayrollAmountOverChanged

public static boolean isPayrollAmountOverChanged(EffortCertificationDetail detailLine,
                                                 org.kuali.rice.kns.util.KualiDecimal originalTotalAmount,
                                                 double limitOfLinePayrollAmountChange)
determine if the change on the payroll amount of the given detail line exceeds the specified limit

Parameters:
detailLine - the given effort certification detail line
limitOfLinePayrollAmountChange - the specified upper bound limit
Returns:
true if the change on the payroll amount of the given detail line exceeds the specified limit; otherwise, false

isPayrollAmountOverChanged

public static boolean isPayrollAmountOverChanged(EffortCertificationDocument document,
                                                 double limitOfLinePayrollAmountChange)
determine if there is a change on the payroll amount of a detail line that exceeds the specified limit

Parameters:
document - the given effort certification document
limitOfLinePayrollAmountChange - the specified upper bound limit
Returns:
true if the change on the payroll amount of any detail line exceeds the specified limit; otherwise, false

isTotalEffortPercentageAs100

public static boolean isTotalEffortPercentageAs100(EffortCertificationDocument document)
detrmine if the total effort percent of the given document is 100

Parameters:
document - the given effort certification document
Returns:
true if the total effort percent of the given document is 100

isTotalPayrollAmountOverChanged

public static boolean isTotalPayrollAmountOverChanged(EffortCertificationDocument document,
                                                      double limitOfTotalPayrollAmountChange)
determine if the change on the total payroll amount exceeds the specified limit

Parameters:
document - the given effort certification document
limitOfTotalPayrollAmountChange - the specified upper bound limit
Returns:
true if the change on the total payroll amount exceeds the specified limit; otherwise, false

isValidPercent

public static boolean isValidPercent(Integer percent)
determine if the given percent is between 0 and 100.

Parameters:
percent - the given percent
Returns:
true if the given percent is between 0 and 100; otherwise, false

updateSourceAccountInformation

public static void updateSourceAccountInformation(EffortCertificationDetail detailLine)
update the information of the source attributes for the given detail line

Parameters:
detailLine - the given detail line

hasDetailLine

public static boolean hasDetailLine(EffortCertificationDocument document)
determine if there is a line associated with the given document

Parameters:
document - the given effort certification document
Returns:
true if there is a line associated with the given document; otherwise, false


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