org.kuali.kfs.gl.service.impl
Class ScrubberValidatorImpl

java.lang.Object
  extended by org.kuali.kfs.gl.service.impl.ScrubberValidatorImpl
All Implemented Interfaces:
ScrubberValidator
Direct Known Subclasses:
LaborGLScrubberValidatorImpl

public class ScrubberValidatorImpl
extends Object
implements ScrubberValidator

The default GL implementation of ScrubberValidator


Field Summary
static String DATE_FORMAT_STRING
           
protected static String[] debitOrCredit
           
 
Constructor Summary
ScrubberValidatorImpl()
           
 
Method Summary
protected  Message continuationAccountLogic(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, UniversityDate universityRunDate, AccountingCycleCachingService accountingCycleCachingService)
          Called when the account of the origin entry is expired or closed, this validates the continuation account
protected  long getAdjustedAccountExpirationDate(Account account)
          Calculates the expiration date of an adjusted account
 boolean isAccountExpired(Account account, UniversityDate universityRunDate)
          Performs logic to determine whether an account is expired
 void setAccountService(AccountService as)
           
 void setBalanceTypService(BalanceTypeService balanceTypService)
           
 void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService service)
           
 void setOriginationCodeService(OriginationCodeService ocs)
           
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 void setPersistenceService(org.kuali.rice.kns.service.PersistenceService ps)
           
 void setPersistenceStructureService(org.kuali.rice.kns.service.PersistenceStructureService persistenceStructureService)
           
 void setUniversityDateDao(UniversityDateDao udd)
           
protected  Message validateAccount(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, UniversityDate universityRunDate, AccountingCycleCachingService accountingCycleCachingService)
          Validates the account of an origin entry
protected  Message validateBalanceType(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the balance type of the origin entry
protected  Message validateChart(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the chart of the origin entry
protected  Message validateDescription(OriginEntryInformation originEntry)
           
protected  Message validateDocumentNumber(OriginEntryInformation originEntry, OriginEntryInformation workingEntry)
          Validates the document number of the origin entry
protected  Message validateDocumentType(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the document type of an origin entry
protected  Message validateFiscalYear(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, UniversityDate universityRunDate, AccountingCycleCachingService accountingCycleCachingService)
          Validates the fiscal year of the origin entry
 void validateForInquiry(GeneralLedgerPendingEntry entry)
          Validate a transaction for use in balance inquiry
protected  Message validateObjectCode(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the object code of the origin entry
protected  Message validateObjectType(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Assuming that the object code has been validated first, validates the object type of the entry
protected  Message validateOrigination(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the origination code of the origin entry
protected  Message validateProjectCode(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the project code of the origin entry
protected  List<Message> validateReferenceDocumentFields(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          If the encumbrance update code = R, ref doc number must exist, ref doc type must be valid and ref origin code must be valid.
protected  Message validateReferenceOrigination(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
           
protected  Message validateReversalDate(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the reversal date of the origin entry
protected  Message validateSubAccount(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the sub account of the origin entry
protected  Message validateSubObjectCode(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the sub object code of the origin entry
 List<Message> validateTransaction(OriginEntryInformation originEntry, OriginEntryInformation scrubbedEntry, UniversityDate universityRunDate, boolean laborIndicator, AccountingCycleCachingService accountingCycleCachingService)
          Validate a transaction in the scrubber
protected  Message validateTransactionAmount(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService)
          Validates the entry's transaction amount
protected  Message validateTransactionDate(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, UniversityDate universityRunDate, AccountingCycleCachingService accountingCycleCachingService)
          Validates the transaction date of the origin entry, make sure it is a valid university date
protected  Message validateUniversityFiscalPeriodCode(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, UniversityDate universityRunDate, AccountingCycleCachingService accountingCycleCachingService)
          Validates the period code of the origin entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_FORMAT_STRING

public static final String DATE_FORMAT_STRING
See Also:
Constant Field Values

debitOrCredit

protected static String[] debitOrCredit
Constructor Detail

ScrubberValidatorImpl

public ScrubberValidatorImpl()
Method Detail

validateForInquiry

public void validateForInquiry(GeneralLedgerPendingEntry entry)
Validate a transaction for use in balance inquiry

Specified by:
validateForInquiry in interface ScrubberValidator
Parameters:
entry - Input transaction
See Also:
org.kuali.module.gl.service.ScrubberValidator#validateForInquiry(org.kuali.kfs.bo.GeneralLedgerPendingEntry)

validateTransaction

public List<Message> validateTransaction(OriginEntryInformation originEntry,
                                         OriginEntryInformation scrubbedEntry,
                                         UniversityDate universityRunDate,
                                         boolean laborIndicator,
                                         AccountingCycleCachingService accountingCycleCachingService)
Validate a transaction in the scrubber

Specified by:
validateTransaction in interface ScrubberValidator
Parameters:
originEntry - Input transaction (never changed)
scrubbedEntry - Output transaction (scrubbed version of input transaction)
universityRunDate - Date of scrubber run
Returns:
List of Message objects based for warnings or errors that happened when validating the transaction
See Also:
org.kuali.module.gl.service.ScrubberValidator#validateTransaction(org.kuali.module.gl.bo.OriginEntry, org.kuali.module.gl.bo.OriginEntry, org.kuali.module.gl.bo.UniversityDate, boolean)

validateAccount

protected Message validateAccount(OriginEntryInformation originEntry,
                                  OriginEntryInformation workingEntry,
                                  UniversityDate universityRunDate,
                                  AccountingCycleCachingService accountingCycleCachingService)
Validates the account of an origin entry

Parameters:
originEntry - the origin entry to find the account of
workingEntry - the copy of the entry to move the account over to if it is valid
universityRunDate - the run date of the scrubber process
Returns:
a Message if the account was invalid, or null if no error was encountered

continuationAccountLogic

protected Message continuationAccountLogic(OriginEntryInformation originEntry,
                                           OriginEntryInformation workingEntry,
                                           UniversityDate universityRunDate,
                                           AccountingCycleCachingService accountingCycleCachingService)
Called when the account of the origin entry is expired or closed, this validates the continuation account

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
universityRunDate - the run date of the scrubber (to test against expiration dates)
Returns:
a Message if an error was encountered, otherwise null

getAdjustedAccountExpirationDate

protected long getAdjustedAccountExpirationDate(Account account)
Calculates the expiration date of an adjusted account

Parameters:
account - the expired account
Returns:
the timestamp of the adjusted date

validateReversalDate

protected Message validateReversalDate(OriginEntryInformation originEntry,
                                       OriginEntryInformation workingEntry,
                                       AccountingCycleCachingService accountingCycleCachingService)
Validates the reversal date of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateSubAccount

protected Message validateSubAccount(OriginEntryInformation originEntry,
                                     OriginEntryInformation workingEntry,
                                     AccountingCycleCachingService accountingCycleCachingService)
Validates the sub account of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateProjectCode

protected Message validateProjectCode(OriginEntryInformation originEntry,
                                      OriginEntryInformation workingEntry,
                                      AccountingCycleCachingService accountingCycleCachingService)
Validates the project code of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateFiscalYear

protected Message validateFiscalYear(OriginEntryInformation originEntry,
                                     OriginEntryInformation workingEntry,
                                     UniversityDate universityRunDate,
                                     AccountingCycleCachingService accountingCycleCachingService)
Validates the fiscal year of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
universityRunDate - the university date when this scrubber process is being run
Returns:
a Message if an error was encountered, otherwise null

validateTransactionDate

protected Message validateTransactionDate(OriginEntryInformation originEntry,
                                          OriginEntryInformation workingEntry,
                                          UniversityDate universityRunDate,
                                          AccountingCycleCachingService accountingCycleCachingService)
Validates the transaction date of the origin entry, make sure it is a valid university date

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
universityRunDate - the university date when this scrubber process is being run
Returns:
a Message if an error was encountered, otherwise null

validateDocumentType

protected Message validateDocumentType(OriginEntryInformation originEntry,
                                       OriginEntryInformation workingEntry,
                                       AccountingCycleCachingService accountingCycleCachingService)
Validates the document type of an origin entry

Parameters:
originEntry - the origin entry to check
workingEntryInfo - the copy of that entry to move good data over to
Returns:
a Message if the document type is invalid, otherwise if valid, null

validateOrigination

protected Message validateOrigination(OriginEntryInformation originEntry,
                                      OriginEntryInformation workingEntry,
                                      AccountingCycleCachingService accountingCycleCachingService)
Validates the origination code of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateReferenceOrigination

protected Message validateReferenceOrigination(OriginEntryInformation originEntry,
                                               OriginEntryInformation workingEntry,
                                               AccountingCycleCachingService accountingCycleCachingService)

validateDocumentNumber

protected Message validateDocumentNumber(OriginEntryInformation originEntry,
                                         OriginEntryInformation workingEntry)
Validates the document number of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateChart

protected Message validateChart(OriginEntryInformation originEntry,
                                OriginEntryInformation workingEntry,
                                AccountingCycleCachingService accountingCycleCachingService)
Validates the chart of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateObjectCode

protected Message validateObjectCode(OriginEntryInformation originEntry,
                                     OriginEntryInformation workingEntry,
                                     AccountingCycleCachingService accountingCycleCachingService)
Validates the object code of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateObjectType

protected Message validateObjectType(OriginEntryInformation originEntry,
                                     OriginEntryInformation workingEntry,
                                     AccountingCycleCachingService accountingCycleCachingService)
Assuming that the object code has been validated first, validates the object type of the entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null
See Also:
org.kuali.module.gl.service.ScrubberValidator#validateObjectType(org.kuali.module.gl.bo.OriginEntryFull, org.kuali.module.gl.bo.OriginEntryFull)

validateSubObjectCode

protected Message validateSubObjectCode(OriginEntryInformation originEntry,
                                        OriginEntryInformation workingEntry,
                                        AccountingCycleCachingService accountingCycleCachingService)
Validates the sub object code of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateBalanceType

protected Message validateBalanceType(OriginEntryInformation originEntry,
                                      OriginEntryInformation workingEntry,
                                      AccountingCycleCachingService accountingCycleCachingService)
Validates the balance type of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateUniversityFiscalPeriodCode

protected Message validateUniversityFiscalPeriodCode(OriginEntryInformation originEntry,
                                                     OriginEntryInformation workingEntry,
                                                     UniversityDate universityRunDate,
                                                     AccountingCycleCachingService accountingCycleCachingService)
Validates the period code of the origin entry

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
universityRunDate - the university date when this scrubber process is being run
Returns:
a Message if an error was encountered, otherwise null

validateReferenceDocumentFields

protected List<Message> validateReferenceDocumentFields(OriginEntryInformation originEntry,
                                                        OriginEntryInformation workingEntry,
                                                        AccountingCycleCachingService accountingCycleCachingService)
If the encumbrance update code = R, ref doc number must exist, ref doc type must be valid and ref origin code must be valid. If encumbrance update code is not R, and ref doc number is empty, make sure ref doc number, ref doc type and ref origin code are null. If encumbrance update code is not R and the ref doc number has a value, ref doc type must be valid and ref origin code must be valid.

Parameters:
originEntry - the origin entry to check
workingEntryInfo - the copy of the entry to move valid data into
Returns:
a Message if an error was encountered, otherwise null

validateTransactionAmount

protected Message validateTransactionAmount(OriginEntryInformation originEntry,
                                            OriginEntryInformation workingEntry,
                                            AccountingCycleCachingService accountingCycleCachingService)
Validates the entry's transaction amount

Parameters:
originEntry - the origin entry being scrubbed
workingEntry - the scrubbed version of the origin entry
Returns:
a Message if an error was encountered, otherwise null

validateDescription

protected Message validateDescription(OriginEntryInformation originEntry)

isAccountExpired

public boolean isAccountExpired(Account account,
                                UniversityDate universityRunDate)
Description copied from interface: ScrubberValidator
Performs logic to determine whether an account is expired

Specified by:
isAccountExpired in interface ScrubberValidator
Parameters:
account - Account to validate
universityRunDate - Run date of process
Returns:
true if account is expired, false if not
See Also:
ScrubberValidator.isAccountExpired(org.kuali.kfs.coa.businessobject.Account, org.kuali.kfs.sys.businessobject.UniversityDate)

setUniversityDateDao

public void setUniversityDateDao(UniversityDateDao udd)

setKualiConfigurationService

public void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService service)

setPersistenceService

public void setPersistenceService(org.kuali.rice.kns.service.PersistenceService ps)

setAccountService

public void setAccountService(AccountService as)

setOriginationCodeService

public void setOriginationCodeService(OriginationCodeService ocs)

setPersistenceStructureService

public void setPersistenceStructureService(org.kuali.rice.kns.service.PersistenceStructureService persistenceStructureService)

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)

setBalanceTypService

public void setBalanceTypService(BalanceTypeService balanceTypService)


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