org.kuali.kfs.fp.document
Class AuxiliaryVoucherDocument

java.lang.Object
  extended by org.kuali.rice.kns.bo.BusinessObjectBase
      extended by org.kuali.rice.kns.bo.PersistableBusinessObjectBase
          extended by org.kuali.rice.kns.document.DocumentBase
              extended by org.kuali.rice.kns.document.TransactionalDocumentBase
                  extended by org.kuali.kfs.sys.document.FinancialSystemTransactionalDocumentBase
                      extended by org.kuali.kfs.sys.document.LedgerPostingDocumentBase
                          extended by org.kuali.kfs.sys.document.GeneralLedgerPostingDocumentBase
                              extended by org.kuali.kfs.sys.document.AccountingDocumentBase
                                  extended by org.kuali.kfs.fp.document.AuxiliaryVoucherDocument
All Implemented Interfaces:
Serializable, org.apache.ojb.broker.PersistenceBrokerAware, VoucherDocument, AccountingDocument, AmountTotaling, Correctable, FinancialSystemTransactionalDocument, GeneralLedgerPendingEntrySource, GeneralLedgerPostingDocument, LedgerPostingDocument, org.kuali.rice.kns.bo.BusinessObject, org.kuali.rice.kns.bo.PersistableBusinessObject, org.kuali.rice.kns.document.Copyable, org.kuali.rice.kns.document.Document, org.kuali.rice.kns.document.SessionDocument, org.kuali.rice.kns.document.TransactionalDocument

public class AuxiliaryVoucherDocument
extends AccountingDocumentBase
implements VoucherDocument, org.kuali.rice.kns.document.Copyable, Correctable, AmountTotaling

This is the business object that represents the AuxiliaryVoucherDocument in Kuali. This is a transactional document that will eventually post transactions to the G/L. It integrates with workflow and also contains two groupings of accounting lines: Expense and target. Expense is the expense and target is the income lines.

See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger LOG
           
protected  Date reversalDate
           
protected  String typeCode
           
 
Fields inherited from class org.kuali.kfs.sys.document.AccountingDocumentBase
dataDictionaryEntry, nextSourceLineNumber, nextTargetLineNumber, sourceAccountingLineClass, sourceAccountingLines, targetAccountingLineClass, targetAccountingLines
 
Fields inherited from class org.kuali.kfs.sys.document.GeneralLedgerPostingDocumentBase
generalLedgerPendingEntries
 
Fields inherited from class org.kuali.kfs.sys.document.LedgerPostingDocumentBase
accountingPeriod, accountingPeriodService, checkPostingYearForCopy, dataDictionaryService, dateTimeService, postingPeriodCode, postingYear
 
Fields inherited from class org.kuali.kfs.sys.document.FinancialSystemTransactionalDocumentBase
documentHeader
 
Fields inherited from class org.kuali.rice.kns.document.DocumentBase
documentBusinessObject, documentNumber
 
Fields inherited from class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
extension, versionNumber
 
Constructor Summary
AuxiliaryVoucherDocument()
          Initializes the array lists and some basic info.
 
Method Summary
 Date calculateFirstDayOfMonth(Date d)
          Given a day, this method calculates what the first day of that month was.
 boolean calculateIfWithinGracePeriod(Date today, AccountingPeriod periodToCheck)
          This method checks if a given moment of time is within an accounting period, or its auxiliary voucher grace period.
 int comparableDateForm(Date d)
          This method returns a date as an approximate count of days since the BCE epoch.
 void customizeExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntry explicitEntry)
          This method sets the appropriate document type and object type codes into the GLPEs based on the type of AV document chosen.
 boolean customizeOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntry explicitEntry, GeneralLedgerPendingEntry offsetEntry)
          Offset entries are created for recodes (AVRC) always, so this method is one of 2 offsets that get created for an AVRC.
 boolean documentPerformsSufficientFundsCheck()
          This method checks to see if SF checking should be done for this document.
 void doRouteStatusChange(org.kuali.rice.kew.dto.DocumentRouteStatusChangeDTO statusChangeEvent)
          Overrides to call super and then change the reversal date if the type is accrual and the date is greater than the set reversal date.
 org.kuali.rice.kns.util.KualiDecimal getCreditTotal()
          This method calculates the credit total for a JV document keying off of the debit/credit code, only summing the accounting lines with a debitCreditCode that matched the debit constant, and returns the results.
 org.kuali.rice.kns.util.KualiDecimal getDebitTotal()
          This method calculates the debit total for a JV document keying off of the debit/debit code, only summing the accounting lines with a debitDebitCode that matched the debit constant, and returns the results.
protected  String getGeneralLedgerPendingEntryOffsetObjectCode()
          Get from APC the offset object code that is used for the GeneralLedgerPendingEntry
protected  String getObjectTypeCode(GeneralLedgerPendingEntrySourceDetail line)
          This method examines the accounting line passed in and returns the appropriate object type code.
protected  String getObjectTypeCodeForRecodeDistributionOfIncomeAndExpenseEntry(GeneralLedgerPendingEntry explicitEntry)
          This method examines the explicit entry's object type and returns the appropriate object type code.
 Date getReversalDate()
          Read Accessor for Reversal Date
 org.kuali.rice.kns.util.KualiDecimal getTotalDollarAmount()
          Same as default implementation but uses debit / credit totals instead.
 String getTypeCode()
          Read Accessor for Auxiliary Voucher Type
 boolean isAccrualType()
          A helper to test whether this document is an accrual type AV.
 boolean isAdjustmentType()
          A helper to test whether this document is an adjustment type AV.
 boolean isDebit(GeneralLedgerPendingEntrySourceDetail postable)
          Returns true if an accounting line is a debit or credit The following are credits (return false) debitCreditCode != 'D' the following are debits (return true) debitCreditCode == 'D' the following are invalid ( throws an IllegalStateException) debitCreditCode isBlank
protected  boolean isDocumentForMultipleAccounts()
          This method is responsible for iterating through all of the accounting lines in the document (source only) and checking to see if they are all for the same account or not.
 boolean isEndOfPreviousFiscalYear(AccountingPeriod acctPeriod)
          This method checks if the given accounting period ends on the last day of the previous fiscal year
 boolean isRecodeType()
          A helper to test whether this document is an recode type AV.
protected  void processAuxiliaryVoucherErrorCorrections()
          KULEDOCS-1700 This method iterates over each source line and flip the sign on the amount to nullify the super's effect, then flip the debit/credit code b/c an error corrected AV flips the debit/credit code.
protected  void processAuxiliaryVoucherRecodeDistributionOfIncomeAndExpenseGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySequenceHelper sequenceHelper, GeneralLedgerPendingEntry explicitEntry)
          This method creates an AV recode specific GLPE with a document type of DI.
 boolean processOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySequenceHelper sequenceHelper, GeneralLedgerPendingEntrySourceDetail glpeSourceDetail, GeneralLedgerPendingEntry explicitEntry, GeneralLedgerPendingEntry offsetEntry)
          An Accrual Voucher only generates offsets if it is a recode (AVRC).
protected  boolean processOffsetGeneralLedgerPendingEntryForAccrualsAndAdjustments(GeneralLedgerPendingEntrySequenceHelper sequenceHelper, AccountingLine accountingLineCopy, GeneralLedgerPendingEntry explicitEntry, GeneralLedgerPendingEntry offsetEntry)
          This method handles generating or not generating the appropriate offsets if the AV type is accrual or adjustment.
protected  boolean processOffsetGeneralLedgerPendingEntryForRecodes(GeneralLedgerPendingEntrySequenceHelper sequenceHelper, AccountingLine accountingLineCopy, GeneralLedgerPendingEntry explicitEntry, GeneralLedgerPendingEntry offsetEntry)
          This method handles generating or not generating the appropriate offsets if the AV type is a recode.
protected  boolean refreshReversalDate()
          If the reversal date on this document is in need of refreshing, refreshes the reveral date.
 void setReversalDate(Date reversalDate)
          Write Accessor for Reversal Date
 void setTypeCode(String typeCode)
          Write Accessor for Auxiliary Voucher Type
 void toCopy()
          If we've copied, we need to update the posting period and year
 void toErrorCorrection()
          Converts this Document instance into an error correction of itself.
protected  void updateReversalDate()
          This method handles updating the reversal data on the document in addition to all of the GLPEs, but only for the accrual and recode types.
 
Methods inherited from class org.kuali.kfs.sys.document.AccountingDocumentBase
addSourceAccountingLine, addTargetAccountingLine, buildAccountingLineMap, buildListOfDeletionAwareLists, copyAccountingLines, generateDocumentGeneralLedgerPendingEntries, generateEvents, generateGeneralLedgerPendingEntries, generateSaveEvents, getAccountingLineParser, getDataDictionaryEntry, getDocumentClassForAccountingLineValueAllowedValidation, getEntryValue, getGeneralLedgerPendingEntryAmountForDetail, getGeneralLedgerPendingEntrySourceDetails, getNextSourceLineNumber, getNextTargetLineNumber, getPersistedSourceAccountingLinesForComparison, getPersistedTargetAccountingLinesForComparison, getSourceAccountingLine, getSourceAccountingLineClass, getSourceAccountingLineEntryName, getSourceAccountingLines, getSourceAccountingLinesForComparison, getSourceAccountingLinesSectionTitle, getSourceTotal, getTargetAccountingLine, getTargetAccountingLineClass, getTargetAccountingLineEntryName, getTargetAccountingLines, getTargetAccountingLinesForComparison, getTargetAccountingLinesSectionTitle, getTargetTotal, prepareForSave, processExplicitGeneralLedgerPendingEntry, setNextSourceLineNumber, setNextTargetLineNumber, setSourceAccountingLines, setTargetAccountingLines, updatePostingYearForAccountingLines
 
Methods inherited from class org.kuali.kfs.sys.document.GeneralLedgerPostingDocumentBase
addPendingEntry, changeGeneralLedgerPendingEntriesApprovedStatusCode, checkSufficientFunds, clearAnyGeneralLedgerPendingEntries, getGeneralLedgerPendingEntries, getGeneralLedgerPendingEntry, getPendingLedgerEntriesForSufficientFundsChecking, removeGeneralLedgerPendingEntries, setGeneralLedgerPendingEntries
 
Methods inherited from class org.kuali.kfs.sys.document.LedgerPostingDocumentBase
createInitialAccountingPeriod, getAccountingPeriod, getAccountingPeriodService, getDataDictionaryService, getDateTimeService, getFinancialDocumentTypeCode, getPostingPeriodCode, getPostingYear, retrieveCurrentAccountingPeriod, setAccountingPeriod, setPostingPeriodCode, setPostingYear
 
Methods inherited from class org.kuali.kfs.sys.document.FinancialSystemTransactionalDocumentBase
answerSplitNodeQuestion, getDocumentHeader, prepareForSave, processAfterRetrieve, setDocumentHeader
 
Methods inherited from class org.kuali.rice.kns.document.TransactionalDocumentBase
getAllowsCopy, isSessionDocument
 
Methods inherited from class org.kuali.rice.kns.document.DocumentBase
addCopyErrorDocumentNote, addPessimisticLock, afterLookup, afterWorkflowEngineProcess, beforeWorkflowEngineProcess, createPropertySerializabilityEvaluator, doActionTaken, doRouteLevelChange, getAdHocRoutePersons, getAdHocRouteWorkgroups, getBasePathToDocumentDuringSerialization, getCustomLockDescriptor, getDocumentBusinessObject, getDocumentNumber, getDocumentPropertySerizabilityEvaluator, getDocumentTitle, getLockClearningMethodNames, getNonLockingActionTakenCodes, getPessimisticLocks, getWorkflowEngineDocumentIdsToLock, getXmlForRouteReport, logErrors, populateDocumentForRouting, postProcessSave, refresh, refreshIfEmpty, refreshPessimisticLocks, refreshReferenceObject, serializeDocumentToXml, setAdHocRoutePersons, setAdHocRouteWorkgroups, setDocumentNumber, setNewDocumentHeader, setPessimisticLocks, toString, toStringBuilder, toStringMapper, useCustomLockDescriptors, validateBusinessRules, wrapDocumentWithMetadataForXmlSerialization
 
Methods inherited from class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
addNote, afterDelete, afterInsert, afterUpdate, beforeDelete, beforeInsert, beforeInsert, beforeUpdate, beforeUpdate, deleteNote, getAttachmentService, getBoNote, getBoNotes, getExtension, getNoteService, getObjectId, getPersistenceService, getPersistenceStructureService, getVersionNumber, isAutoIncrementSet, isBoNotesSupport, isNewCollectionRecord, linkEditableUserFields, refreshNonUpdateableReferences, setAutoIncrementSet, setBoNotes, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber, supportsBoNotes
 
Methods inherited from class org.kuali.rice.kns.bo.BusinessObjectBase
prepareForWorkflow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.kfs.sys.document.AccountingDocument
addSourceAccountingLine, addTargetAccountingLine, getAccountingLineParser, getDocumentClassForAccountingLineValueAllowedValidation, getNextSourceLineNumber, getNextTargetLineNumber, getSourceAccountingLine, getSourceAccountingLineClass, getSourceAccountingLineEntryName, getSourceAccountingLines, getSourceAccountingLinesSectionTitle, getSourceTotal, getTargetAccountingLine, getTargetAccountingLineClass, getTargetAccountingLineEntryName, getTargetAccountingLines, getTargetAccountingLinesSectionTitle, getTargetTotal, setNextSourceLineNumber, setNextTargetLineNumber, setSourceAccountingLines, setTargetAccountingLines
 
Methods inherited from interface org.kuali.kfs.sys.document.GeneralLedgerPostingDocument
checkSufficientFunds, getGeneralLedgerPendingEntries, getGeneralLedgerPendingEntry, getPendingLedgerEntriesForSufficientFundsChecking, setGeneralLedgerPendingEntries
 
Methods inherited from interface org.kuali.kfs.sys.document.LedgerPostingDocument
getAccountingPeriod, getPostingPeriodCode, getPostingYear, setAccountingPeriod, setPostingPeriodCode, setPostingYear
 
Methods inherited from interface org.kuali.kfs.sys.document.FinancialSystemTransactionalDocument
answerSplitNodeQuestion, getDocumentHeader
 
Methods inherited from interface org.kuali.rice.kns.document.Document
addPessimisticLock, afterWorkflowEngineProcess, beforeWorkflowEngineProcess, doActionTaken, doRouteLevelChange, generateSaveEvents, getAdHocRoutePersons, getAdHocRouteWorkgroups, getAllowsCopy, getBasePathToDocumentDuringSerialization, getCustomLockDescriptor, getDocumentBusinessObject, getDocumentNumber, getDocumentPropertySerizabilityEvaluator, getDocumentTitle, getLockClearningMethodNames, getPessimisticLocks, getWorkflowEngineDocumentIdsToLock, getXmlForRouteReport, populateDocumentForRouting, postProcessSave, prepareForSave, prepareForSave, processAfterRetrieve, refreshPessimisticLocks, serializeDocumentToXml, setAdHocRoutePersons, setAdHocRouteWorkgroups, setDocumentHeader, setDocumentNumber, useCustomLockDescriptors, validateBusinessRules, wrapDocumentWithMetadataForXmlSerialization
 
Methods inherited from interface org.kuali.rice.kns.bo.PersistableBusinessObject
addNote, buildListOfDeletionAwareLists, deleteNote, getBoNote, getBoNotes, getExtension, getObjectId, getVersionNumber, isBoNotesSupport, isNewCollectionRecord, linkEditableUserFields, refreshNonUpdateableReferences, refreshReferenceObject, setAutoIncrementSet, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber
 
Methods inherited from interface org.kuali.rice.kns.bo.BusinessObject
prepareForWorkflow, refresh
 
Methods inherited from interface org.apache.ojb.broker.PersistenceBrokerAware
afterDelete, afterInsert, afterLookup, afterUpdate, beforeDelete, beforeInsert, beforeUpdate
 
Methods inherited from interface org.kuali.kfs.sys.document.GeneralLedgerPendingEntrySource
addPendingEntry, clearAnyGeneralLedgerPendingEntries, generateDocumentGeneralLedgerPendingEntries, generateGeneralLedgerPendingEntries, getDocumentHeader, getFinancialDocumentTypeCode, getGeneralLedgerPendingEntryAmountForDetail, getGeneralLedgerPendingEntrySourceDetails, getPostingYear
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG

typeCode

protected String typeCode

reversalDate

protected Date reversalDate
Constructor Detail

AuxiliaryVoucherDocument

public AuxiliaryVoucherDocument()
Initializes the array lists and some basic info.

Method Detail

documentPerformsSufficientFundsCheck

public boolean documentPerformsSufficientFundsCheck()
Description copied from class: GeneralLedgerPostingDocumentBase
This method checks to see if SF checking should be done for this document. This was originally part of SufficientFundsService.checkSufficientFunds() but was externalized so documents that need to override any of the SF methods can still explicitly check this

Overrides:
documentPerformsSufficientFundsCheck in class GeneralLedgerPostingDocumentBase
Returns:
See Also:
GeneralLedgerPostingDocumentBase.documentPerformsSufficientFundsCheck()

getReversalDate

public Date getReversalDate()
Read Accessor for Reversal Date

Specified by:
getReversalDate in interface VoucherDocument
Returns:
java.sql.Date

setReversalDate

public void setReversalDate(Date reversalDate)
Write Accessor for Reversal Date

Specified by:
setReversalDate in interface VoucherDocument
Parameters:
reversalDate -

getTypeCode

public String getTypeCode()
Read Accessor for Auxiliary Voucher Type

Returns:
String

setTypeCode

public void setTypeCode(String typeCode)
Write Accessor for Auxiliary Voucher Type

Parameters:
typeCode -

isAdjustmentType

public boolean isAdjustmentType()
A helper to test whether this document is an adjustment type AV.

Returns:
boolean

isRecodeType

public boolean isRecodeType()
A helper to test whether this document is an recode type AV.

Returns:
boolean

isAccrualType

public boolean isAccrualType()
A helper to test whether this document is an accrual type AV.

Returns:
boolean

getDebitTotal

public org.kuali.rice.kns.util.KualiDecimal getDebitTotal()
This method calculates the debit total for a JV document keying off of the debit/debit code, only summing the accounting lines with a debitDebitCode that matched the debit constant, and returns the results.

Specified by:
getDebitTotal in interface VoucherDocument
Returns:
KualiDecimal

getCreditTotal

public org.kuali.rice.kns.util.KualiDecimal getCreditTotal()
This method calculates the credit total for a JV document keying off of the debit/credit code, only summing the accounting lines with a debitCreditCode that matched the debit constant, and returns the results.

Specified by:
getCreditTotal in interface VoucherDocument
Returns:
KualiDecimal

getTotalDollarAmount

public org.kuali.rice.kns.util.KualiDecimal getTotalDollarAmount()
Same as default implementation but uses debit / credit totals instead. Meaning it returns either credit or if 0, debit.

Specified by:
getTotalDollarAmount in interface AmountTotaling
Overrides:
getTotalDollarAmount in class AccountingDocumentBase
Returns:
KualiDecimal
See Also:
AccountingDocumentBase.getTotalDollarAmount()

toCopy

public void toCopy()
            throws org.kuali.rice.kew.exception.WorkflowException
Description copied from class: LedgerPostingDocumentBase
If we've copied, we need to update the posting period and year

Specified by:
toCopy in interface org.kuali.rice.kns.document.Copyable
Overrides:
toCopy in class AccountingDocumentBase
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
AccountingDocumentBase.toCopy()

doRouteStatusChange

public void doRouteStatusChange(org.kuali.rice.kew.dto.DocumentRouteStatusChangeDTO statusChangeEvent)
Overrides to call super and then change the reversal date if the type is accrual and the date is greater than the set reversal date.

Specified by:
doRouteStatusChange in interface org.kuali.rice.kns.document.Document
Overrides:
doRouteStatusChange in class GeneralLedgerPostingDocumentBase
See Also:
Document#doRouteStatusChange()

updateReversalDate

protected void updateReversalDate()
This method handles updating the reversal data on the document in addition to all of the GLPEs, but only for the accrual and recode types.


refreshReversalDate

protected boolean refreshReversalDate()
If the reversal date on this document is in need of refreshing, refreshes the reveral date. THIS METHOD MAY CHANGE DOCUMENT STATE!

Returns:
true if the reversal date ended up getting refreshed, false otherwise

toErrorCorrection

public void toErrorCorrection()
                       throws org.kuali.rice.kew.exception.WorkflowException
Description copied from interface: Correctable
Converts this Document instance into an error correction of itself.

Specified by:
toErrorCorrection in interface Correctable
Overrides:
toErrorCorrection in class AccountingDocumentBase
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
AccountingDocumentBase.toErrorCorrection()

processAuxiliaryVoucherErrorCorrections

protected void processAuxiliaryVoucherErrorCorrections()
KULEDOCS-1700 This method iterates over each source line and flip the sign on the amount to nullify the super's effect, then flip the debit/credit code b/c an error corrected AV flips the debit/credit code.


isDebit

public boolean isDebit(GeneralLedgerPendingEntrySourceDetail postable)
                throws IllegalStateException
Returns true if an accounting line is a debit or credit The following are credits (return false)
  1. debitCreditCode != 'D'
the following are debits (return true)
  1. debitCreditCode == 'D'
the following are invalid ( throws an IllegalStateException)
  1. debitCreditCode isBlank

Specified by:
isDebit in interface GeneralLedgerPendingEntrySource
Specified by:
isDebit in class AccountingDocumentBase
Parameters:
financialDocument - submitted accounting document
accounttingLine - accounting line being tested if it is a debit or not
Returns:
true if the given GeneralLedgerPendingEntrySourceDetail is a debit, false if it is a credit
Throws:
IllegalStateException
See Also:
org.kuali.rice.kns.rule.AccountingLineRule#isDebit(org.kuali.rice.kns.document.FinancialDocument, org.kuali.rice.kns.bo.AccountingLine)

customizeExplicitGeneralLedgerPendingEntry

public void customizeExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable,
                                                       GeneralLedgerPendingEntry explicitEntry)
This method sets the appropriate document type and object type codes into the GLPEs based on the type of AV document chosen.

Overrides:
customizeExplicitGeneralLedgerPendingEntry in class AccountingDocumentBase
Parameters:
document - submitted AccountingDocument
accountingLine - represents accounting line where object type code is retrieved from
explicitEntry - GeneralPendingLedgerEntry object that has its document type, object type, period code, and fiscal year set
See Also:
FinancialDocumentRuleBase#customizeExplicitGeneralLedgerPendingEntry(FinancialDocument, AccountingLine, GeneralLedgerPendingEntry), org.kuali.module.financial.rules.FinancialDocumentRuleBase#processExplicitGeneralLedgerPendingEntry(org.kuali.rice.kns.document.FinancialDocument, org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySequenceHelper, org.kuali.rice.kns.bo.AccountingLine, org.kuali.module.gl.bo.GeneralLedgerPendingEntry)

customizeOffsetGeneralLedgerPendingEntry

public boolean customizeOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable,
                                                        GeneralLedgerPendingEntry explicitEntry,
                                                        GeneralLedgerPendingEntry offsetEntry)
Offset entries are created for recodes (AVRC) always, so this method is one of 2 offsets that get created for an AVRC. Its document type is set to DI. This uses the explicit entry as its model. In addition, an offset is generated for accruals (AVAE) and adjustments (AVAD), but only if the document contains accounting lines for more than one account.

Overrides:
customizeOffsetGeneralLedgerPendingEntry in class AccountingDocumentBase
Parameters:
financialDocument - submitted accounting document
accountingLine - accounting line from accounting document
explicitEntry - represents explicit entry
offsetEntry - represents offset entry
See Also:
org.kuali.module.financial.rules.FinancialDocumentRuleBase#customizeOffsetGeneralLedgerPendingEntry(org.kuali.rice.kns.document.FinancialDocument, org.kuali.rice.kns.bo.AccountingLine, org.kuali.module.gl.bo.GeneralLedgerPendingEntry, org.kuali.module.gl.bo.GeneralLedgerPendingEntry)

getObjectTypeCode

protected String getObjectTypeCode(GeneralLedgerPendingEntrySourceDetail line)
This method examines the accounting line passed in and returns the appropriate object type code. This rule converts specific objects types from an object code on an accounting line to more general values. This is specific to the AV document.

Parameters:
line - accounting line where object type code is retrieved from
Returns:
object type from a accounting line ((either financial object type code, financial object type not expenditure code, or financial object type income not cash code))

getGeneralLedgerPendingEntryOffsetObjectCode

protected String getGeneralLedgerPendingEntryOffsetObjectCode()
Get from APC the offset object code that is used for the GeneralLedgerPendingEntry

Returns:
String returns GLPE parameter name

processOffsetGeneralLedgerPendingEntry

public boolean processOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySequenceHelper sequenceHelper,
                                                      GeneralLedgerPendingEntrySourceDetail glpeSourceDetail,
                                                      GeneralLedgerPendingEntry explicitEntry,
                                                      GeneralLedgerPendingEntry offsetEntry)
An Accrual Voucher only generates offsets if it is a recode (AVRC). So this method overrides to do nothing more than return true if it's not a recode. If it is a recode, then it is responsible for generating two offsets with a document type of DI.

Overrides:
processOffsetGeneralLedgerPendingEntry in class AccountingDocumentBase
Parameters:
financialDocument - submitted accounting document
sequenceHelper - helper class which will allows us to increment a reference without using an Integer
accountingLineCopy - accounting line from accounting document
explicitEntry - represents explicit entry
offsetEntry - represents offset entry
Returns:
true if general ledger pending entry is processed successfully for accurals, adjustments, and recodes
See Also:
org.kuali.module.financial.rules.FinancialDocumentRuleBase#processOffsetGeneralLedgerPendingEntry(org.kuali.rice.kns.document.FinancialDocument, org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySequenceHelper, org.kuali.rice.kns.bo.AccountingLine, org.kuali.module.gl.bo.GeneralLedgerPendingEntry, org.kuali.module.gl.bo.GeneralLedgerPendingEntry)

processOffsetGeneralLedgerPendingEntryForRecodes

protected boolean processOffsetGeneralLedgerPendingEntryForRecodes(GeneralLedgerPendingEntrySequenceHelper sequenceHelper,
                                                                   AccountingLine accountingLineCopy,
                                                                   GeneralLedgerPendingEntry explicitEntry,
                                                                   GeneralLedgerPendingEntry offsetEntry)
This method handles generating or not generating the appropriate offsets if the AV type is a recode.

Parameters:
financialDocument - submitted accounting document
sequenceHelper - helper class which will allows us to increment a reference without using an Integer
accountingLineCopy - accounting line from accounting document
explicitEntry - represents explicit entry
offsetEntry - represents offset entry
Returns:
true if offset general ledger pending entry is processed

processOffsetGeneralLedgerPendingEntryForAccrualsAndAdjustments

protected boolean processOffsetGeneralLedgerPendingEntryForAccrualsAndAdjustments(GeneralLedgerPendingEntrySequenceHelper sequenceHelper,
                                                                                  AccountingLine accountingLineCopy,
                                                                                  GeneralLedgerPendingEntry explicitEntry,
                                                                                  GeneralLedgerPendingEntry offsetEntry)
This method handles generating or not generating the appropriate offsets if the AV type is accrual or adjustment.

Parameters:
financialDocument - submitted accounting document
sequenceHelper - helper class which will allows us to increment a reference without using an Integer
accountingLineCopy - accounting line from accounting document
explicitEntry - represents explicit entry
offsetEntry - represents offset entry
Returns:
true if offset general ledger pending entry is processed successfully

isDocumentForMultipleAccounts

protected boolean isDocumentForMultipleAccounts()
This method is responsible for iterating through all of the accounting lines in the document (source only) and checking to see if they are all for the same account or not. It recognizes the first account element as the base, and then it iterates through the rest. If it comes across one that doesn't match, then we know it's for multiple accounts.

Parameters:
financialDocument - submitted accounting document
Returns:
true if multiple accounts are being used

processAuxiliaryVoucherRecodeDistributionOfIncomeAndExpenseGeneralLedgerPendingEntry

protected void processAuxiliaryVoucherRecodeDistributionOfIncomeAndExpenseGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySequenceHelper sequenceHelper,
                                                                                                    GeneralLedgerPendingEntry explicitEntry)
This method creates an AV recode specific GLPE with a document type of DI. The sequence is managed outside of this method. It uses the explicit entry as its model and then tweaks values appropriately.

Parameters:
financialDocument - submitted accounting document
sequenceHelper - helper class which will allows us to increment a reference without using an Integer
explicitEntry - represents explicit entry

getObjectTypeCodeForRecodeDistributionOfIncomeAndExpenseEntry

protected String getObjectTypeCodeForRecodeDistributionOfIncomeAndExpenseEntry(GeneralLedgerPendingEntry explicitEntry)
This method examines the explicit entry's object type and returns the appropriate object type code. This is specific to AV recodes (AVRCs).

Parameters:
explicitEntry -
Returns:
object type code from explicit entry (either financial object type code, financial object type expenditure code, or financial object type income cash code)

calculateIfWithinGracePeriod

public boolean calculateIfWithinGracePeriod(Date today,
                                            AccountingPeriod periodToCheck)
This method checks if a given moment of time is within an accounting period, or its auxiliary voucher grace period.

Parameters:
today - a date to check if it is within the period
periodToCheck - the account period to check against
Returns:
true if a given moment in time is within an accounting period or an auxiliary voucher grace period

comparableDateForm

public int comparableDateForm(Date d)
This method returns a date as an approximate count of days since the BCE epoch.

Parameters:
d - the date to convert
Returns:
an integer count of days, very approximate

calculateFirstDayOfMonth

public Date calculateFirstDayOfMonth(Date d)
Given a day, this method calculates what the first day of that month was.

Parameters:
d - date to find first of month for
Returns:
date of the first day of the month

isEndOfPreviousFiscalYear

public boolean isEndOfPreviousFiscalYear(AccountingPeriod acctPeriod)
This method checks if the given accounting period ends on the last day of the previous fiscal year

Parameters:
acctPeriod - accounting period to check
Returns:
true if the accounting period ends with the fiscal year, false if otherwise


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