org.kuali.kfs.sys.document
Class AccountingDocumentBase

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
All Implemented Interfaces:
Serializable, org.apache.ojb.broker.PersistenceBrokerAware, AccountingDocument, FinancialSystemTransactionalDocument, GeneralLedgerPendingEntrySource, GeneralLedgerPostingDocument, LedgerPostingDocument, org.kuali.rice.kns.bo.BusinessObject, org.kuali.rice.kns.bo.PersistableBusinessObject, org.kuali.rice.kns.document.Document, org.kuali.rice.kns.document.SessionDocument, org.kuali.rice.kns.document.TransactionalDocument
Direct Known Subclasses:
AssetPaymentDocument, AuxiliaryVoucherDocument, BudgetAdjustmentDocument, CashReceiptFamilyBase, CustomerInvoiceDocument, DisbursementVoucherDocument, DistributionOfIncomeAndExpenseDocument, GeneralErrorCorrectionDocument, IndirectCostAdjustmentDocument, InternalBillingDocument, JournalVoucherDocument, LaborLedgerPostingDocumentBase, NonCheckDisbursementDocument, PreEncumbranceDocument, ProcurementCardDocument, PurchasingAccountsPayableDocumentBase, TransferOfFundsDocument

public abstract class AccountingDocumentBase
extends GeneralLedgerPostingDocumentBase
implements AccountingDocument, GeneralLedgerPendingEntrySource

Base implementation class for financial edocs.

See Also:
Serialized Form

Field Summary
protected  FinancialSystemTransactionalDocumentEntry dataDictionaryEntry
           
protected static org.apache.log4j.Logger LOG
           
protected  Integer nextSourceLineNumber
           
protected  Integer nextTargetLineNumber
           
protected  Class sourceAccountingLineClass
           
protected  List sourceAccountingLines
           
protected  Class targetAccountingLineClass
           
protected  List 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
AccountingDocumentBase()
          Default constructor.
 
Method Summary
 void addSourceAccountingLine(SourceAccountingLine line)
          This implementation sets the sequence number appropriately for the passed in source accounting line using the value that has been stored in the nextSourceLineNumber variable, adds the accounting line to the list that is aggregated by this object, and then handles incrementing the nextSourceLineNumber variable for you.
 void addTargetAccountingLine(TargetAccountingLine line)
          This implementation sets the sequence number appropriately for the passed in target accounting line using the value that has been stored in the nextTargetLineNumber variable, adds the accounting line to the list that is aggregated by this object, and then handles incrementing the nextTargetLineNumber variable for you.
protected  Map buildAccountingLineMap(List accountingLines)
           
 List buildListOfDeletionAwareLists()
           
protected  void copyAccountingLines(boolean isErrorCorrection)
          Copies accounting lines but sets new document number and version If error correction, reverses line amount.
 void customizeExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntry explicitEntry)
           
 boolean customizeOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail accountingLine, GeneralLedgerPendingEntry explicitEntry, GeneralLedgerPendingEntry offsetEntry)
           
 boolean generateDocumentGeneralLedgerPendingEntries(GeneralLedgerPendingEntrySequenceHelper sequenceHelper)
          Most accounting documents don't need to generate document level GLPE's, so don't do anything in the default implementation
protected  List generateEvents(List persistedLines, List currentLines, String errorPathPrefix, org.kuali.rice.kns.document.TransactionalDocument document)
          Generates a List of instances of AccountingLineEvent subclasses, one for each accountingLine in the union of the persistedLines and currentLines lists.
 boolean generateGeneralLedgerPendingEntries(GeneralLedgerPendingEntrySourceDetail glpeSourceDetail, GeneralLedgerPendingEntrySequenceHelper sequenceHelper)
          Perform business rules common to all transactional documents when generating general ledger pending entries.
 List generateSaveEvents()
           
 AccountingLineParser getAccountingLineParser()
          Used to get the appropriate AccountingLineParser for the Document
 FinancialSystemTransactionalDocumentEntry getDataDictionaryEntry()
           
 Class<? extends AccountingDocument> getDocumentClassForAccountingLineValueAllowedValidation()
          This method returns the Class to use for AccountingLingValuesAllowedValidation.
protected  String getEntryValue(String preferredString, String secondaryString)
          Returns one of the two given String's; if the preferred String is not null and has a length > 0, then it is returned, otherwise the second String is returned
 org.kuali.rice.kns.util.KualiDecimal getGeneralLedgerPendingEntryAmountForDetail(GeneralLedgerPendingEntrySourceDetail postable)
          GLPE amounts are ALWAYS positive, so just take the absolute value of the accounting line's amount.
 List<GeneralLedgerPendingEntrySourceDetail> getGeneralLedgerPendingEntrySourceDetails()
          Returns a list of any GeneralLedgerPostables this helper has, to create GeneralLedgerPendingEntries
 Integer getNextSourceLineNumber()
          Retrieves the next line sequence number for an accounting line in the Source accounting line section on a transactional document.
 Integer getNextTargetLineNumber()
          Retrieves the next line sequence number for an accounting line in the Target accounting line section on a transactional document.
protected  List getPersistedSourceAccountingLinesForComparison()
          This method gets the Persisted Source Accounting Lines that will be used in comparisons
protected  List getPersistedTargetAccountingLinesForComparison()
          This method gets the Persisted Target Accounting Lines that will be used in comparisons
 SourceAccountingLine getSourceAccountingLine(int index)
          This implementation is coupled tightly with some underlying issues that the Struts PojoProcessor plugin has with how objects get instantiated within lists.
 Class getSourceAccountingLineClass()
          Returns the default Source accounting line class.
 String getSourceAccountingLineEntryName()
           
 List getSourceAccountingLines()
          This method returns a list of target accounting lines.
protected  List getSourceAccountingLinesForComparison()
          This method gets the Source Accounting Lines that will be used in comparisons
 String getSourceAccountingLinesSectionTitle()
          This method is used to return the title that a transactional document should give to it's source accounting line section.
 org.kuali.rice.kns.util.KualiDecimal getSourceTotal()
          Sums up the amounts of all of the source accounting lines.
 TargetAccountingLine getTargetAccountingLine(int index)
          This implementation is coupled tightly with some underlying issues that the Struts PojoProcessor plugin has with how objects get instantiated within lists.
 Class getTargetAccountingLineClass()
          Returns the default Target accounting line class.
 String getTargetAccountingLineEntryName()
           
 List getTargetAccountingLines()
          This method retrieves all of the target accounting lines associated with this document.
protected  List getTargetAccountingLinesForComparison()
          This method gets the Target Accounting Lines that will be used in comparisons
 String getTargetAccountingLinesSectionTitle()
          This method is used to return the title that a transactional document should give to it's source accounting line section.
 org.kuali.rice.kns.util.KualiDecimal getTargetTotal()
          Sums up the amounts of all of the target accounting lines.
 org.kuali.rice.kns.util.KualiDecimal getTotalDollarAmount()
          Since one side of the document should match the other and the document should balance, the total dollar amount for the document should either be the expense line or the income line.
abstract  boolean isDebit(GeneralLedgerPendingEntrySourceDetail postable)
          This method determines if the passed in GeneralLedgerPendingEntrySourceDetail is a debit or not.
 void prepareForSave(org.kuali.rice.kns.rule.event.KualiDocumentEvent event)
           
protected  void processExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySequenceHelper sequenceHelper, GeneralLedgerPendingEntrySourceDetail glpeSourceDetail, GeneralLedgerPendingEntry explicitEntry)
          This method processes all necessary information to build an explicit general ledger entry, and then adds that to the document.
protected  boolean processOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySequenceHelper sequenceHelper, GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntry explicitEntry, GeneralLedgerPendingEntry offsetEntry)
          This method processes an accounting line's information to build an offset entry, and then adds that to the document.
 void setNextSourceLineNumber(Integer nextLineNumber)
           
 void setNextTargetLineNumber(Integer nextLineNumber)
           
 void setSourceAccountingLines(List sourceLines)
          This method sets the list of source accounting lines for this document.
 void setTargetAccountingLines(List targetLines)
          This method sets the list of target accounting lines for this document.
 void toCopy()
          If we've copied, we need to update the posting period and year
 void toErrorCorrection()
           
protected  void updatePostingYearForAccountingLines(List<AccountingLine> lines)
          Updates the posting year on accounting lines to be the current posting year
 
Methods inherited from class org.kuali.kfs.sys.document.GeneralLedgerPostingDocumentBase
addPendingEntry, changeGeneralLedgerPendingEntriesApprovedStatusCode, checkSufficientFunds, clearAnyGeneralLedgerPendingEntries, documentPerformsSufficientFundsCheck, doRouteStatusChange, 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.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, doRouteStatusChange, getAdHocRoutePersons, getAdHocRouteWorkgroups, getAllowsCopy, getBasePathToDocumentDuringSerialization, getCustomLockDescriptor, getDocumentBusinessObject, getDocumentNumber, getDocumentPropertySerizabilityEvaluator, getDocumentTitle, getLockClearningMethodNames, getPessimisticLocks, getWorkflowEngineDocumentIdsToLock, getXmlForRouteReport, populateDocumentForRouting, postProcessSave, prepareForSave, processAfterRetrieve, refreshPessimisticLocks, serializeDocumentToXml, setAdHocRoutePersons, setAdHocRouteWorkgroups, setDocumentHeader, setDocumentNumber, useCustomLockDescriptors, validateBusinessRules, wrapDocumentWithMetadataForXmlSerialization
 
Methods inherited from interface org.kuali.rice.kns.bo.PersistableBusinessObject
addNote, 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, getDocumentHeader, getFinancialDocumentTypeCode, getPostingYear
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG

nextSourceLineNumber

protected Integer nextSourceLineNumber

nextTargetLineNumber

protected Integer nextTargetLineNumber

sourceAccountingLines

protected List sourceAccountingLines

targetAccountingLines

protected List targetAccountingLines

dataDictionaryEntry

protected transient FinancialSystemTransactionalDocumentEntry dataDictionaryEntry

sourceAccountingLineClass

protected transient Class sourceAccountingLineClass

targetAccountingLineClass

protected transient Class targetAccountingLineClass
Constructor Detail

AccountingDocumentBase

public AccountingDocumentBase()
Default constructor.

Method Detail

getSourceAccountingLines

public List getSourceAccountingLines()
Description copied from interface: AccountingDocument
This method returns a list of target accounting lines.

Specified by:
getSourceAccountingLines in interface AccountingDocument
Returns:
The list of source accounting lines.
See Also:
AccountingDocument.getSourceAccountingLines()

setSourceAccountingLines

public void setSourceAccountingLines(List sourceLines)
Description copied from interface: AccountingDocument
This method sets the list of source accounting lines for this document.

Specified by:
setSourceAccountingLines in interface AccountingDocument
See Also:
AccountingDocument.setSourceAccountingLines(java.util.List)

getTargetAccountingLines

public List getTargetAccountingLines()
Description copied from interface: AccountingDocument
This method retrieves all of the target accounting lines associated with this document.

Specified by:
getTargetAccountingLines in interface AccountingDocument
See Also:
AccountingDocument.getTargetAccountingLines()

setTargetAccountingLines

public void setTargetAccountingLines(List targetLines)
Description copied from interface: AccountingDocument
This method sets the list of target accounting lines for this document.

Specified by:
setTargetAccountingLines in interface AccountingDocument
See Also:
AccountingDocument.setTargetAccountingLines(java.util.List)

addSourceAccountingLine

public void addSourceAccountingLine(SourceAccountingLine line)
This implementation sets the sequence number appropriately for the passed in source accounting line using the value that has been stored in the nextSourceLineNumber variable, adds the accounting line to the list that is aggregated by this object, and then handles incrementing the nextSourceLineNumber variable for you.

Specified by:
addSourceAccountingLine in interface AccountingDocument
See Also:
AccountingDocument.addSourceAccountingLine(SourceAccountingLine)

addTargetAccountingLine

public void addTargetAccountingLine(TargetAccountingLine line)
This implementation sets the sequence number appropriately for the passed in target accounting line using the value that has been stored in the nextTargetLineNumber variable, adds the accounting line to the list that is aggregated by this object, and then handles incrementing the nextTargetLineNumber variable for you.

Specified by:
addTargetAccountingLine in interface AccountingDocument
See Also:
AccountingDocument.addTargetAccountingLine(TargetAccountingLine)

getSourceAccountingLine

public SourceAccountingLine getSourceAccountingLine(int index)
This implementation is coupled tightly with some underlying issues that the Struts PojoProcessor plugin has with how objects get instantiated within lists. The first three lines are required otherwise when the PojoProcessor tries to automatically inject values into the list, it will get an index out of bounds error if the instance at an index is being called and prior instances at indices before that one are not being instantiated. So changing the code below will cause adding lines to break if you add more than one item to the list.

Specified by:
getSourceAccountingLine in interface AccountingDocument
Returns:
The source accounting line at the specified index.
See Also:
AccountingDocument.getSourceAccountingLine(int)

getTargetAccountingLine

public TargetAccountingLine getTargetAccountingLine(int index)
This implementation is coupled tightly with some underlying issues that the Struts PojoProcessor plugin has with how objects get instantiated within lists. The first three lines are required otherwise when the PojoProcessor tries to automatically inject values into the list, it will get an index out of bounds error if the instance at an index is being called and prior instances at indices before that one are not being instantiated. So changing the code below will cause adding lines to break if you add more than one item to the list.

Specified by:
getTargetAccountingLine in interface AccountingDocument
Returns:
The target accounting line at the passed in index.
See Also:
AccountingDocument.getTargetAccountingLine(int)

getSourceAccountingLinesSectionTitle

public String getSourceAccountingLinesSectionTitle()
Description copied from interface: AccountingDocument
This method is used to return the title that a transactional document should give to it's source accounting line section.

Specified by:
getSourceAccountingLinesSectionTitle in interface AccountingDocument
Returns:
The source accounting line section's title.
See Also:
AccountingDocument.getSourceAccountingLinesSectionTitle()

getTargetAccountingLinesSectionTitle

public String getTargetAccountingLinesSectionTitle()
Description copied from interface: AccountingDocument
This method is used to return the title that a transactional document should give to it's source accounting line section.

Specified by:
getTargetAccountingLinesSectionTitle in interface AccountingDocument
Returns:
The target accounting line section's title.
See Also:
AccountingDocument.getTargetAccountingLinesSectionTitle()

getTotalDollarAmount

public org.kuali.rice.kns.util.KualiDecimal getTotalDollarAmount()
Since one side of the document should match the other and the document should balance, the total dollar amount for the document should either be the expense line or the income line. This is the default implementation of this interface method so it should be overridden appropriately if your document cannot make this assumption.

Returns:
if target total is zero, source total, otherwise target total

getSourceTotal

public org.kuali.rice.kns.util.KualiDecimal getSourceTotal()
Description copied from interface: AccountingDocument
Sums up the amounts of all of the source accounting lines.

Specified by:
getSourceTotal in interface AccountingDocument
See Also:
AccountingDocument.getSourceTotal()

getTargetTotal

public org.kuali.rice.kns.util.KualiDecimal getTargetTotal()
Description copied from interface: AccountingDocument
Sums up the amounts of all of the target accounting lines.

Specified by:
getTargetTotal in interface AccountingDocument
See Also:
AccountingDocument.getTargetTotal()

getNextSourceLineNumber

public Integer getNextSourceLineNumber()
Description copied from interface: AccountingDocument
Retrieves the next line sequence number for an accounting line in the Source accounting line section on a transactional document.

Specified by:
getNextSourceLineNumber in interface AccountingDocument
Returns:
The next available source line number.
See Also:
AccountingDocument.getNextSourceLineNumber()

setNextSourceLineNumber

public void setNextSourceLineNumber(Integer nextLineNumber)
Specified by:
setNextSourceLineNumber in interface AccountingDocument
See Also:
AccountingDocument.setNextSourceLineNumber(java.lang.Integer)

getNextTargetLineNumber

public Integer getNextTargetLineNumber()
Description copied from interface: AccountingDocument
Retrieves the next line sequence number for an accounting line in the Target accounting line section on a transactional document.

Specified by:
getNextTargetLineNumber in interface AccountingDocument
Returns:
The next available target line number.
See Also:
AccountingDocument.getNextTargetLineNumber()

setNextTargetLineNumber

public void setNextTargetLineNumber(Integer nextLineNumber)
Specified by:
setNextTargetLineNumber in interface AccountingDocument
See Also:
AccountingDocument.setNextTargetLineNumber(java.lang.Integer)

getSourceAccountingLineClass

public Class getSourceAccountingLineClass()
Returns the default Source accounting line class.

Specified by:
getSourceAccountingLineClass in interface AccountingDocument
See Also:
AccountingDocument.getSourceAccountingLineClass()

getTargetAccountingLineClass

public Class getTargetAccountingLineClass()
Returns the default Target accounting line class.

Specified by:
getTargetAccountingLineClass in interface AccountingDocument
See Also:
AccountingDocument.getTargetAccountingLineClass()

getAccountingLineParser

public AccountingLineParser getAccountingLineParser()
Used to get the appropriate AccountingLineParser for the Document

Specified by:
getAccountingLineParser in interface AccountingDocument
Returns:
AccountingLineParser

getDataDictionaryEntry

public FinancialSystemTransactionalDocumentEntry getDataDictionaryEntry()
Returns:
the data dictionary entry for this document

getSourceAccountingLineEntryName

public String getSourceAccountingLineEntryName()
Specified by:
getSourceAccountingLineEntryName in interface AccountingDocument

getTargetAccountingLineEntryName

public String getTargetAccountingLineEntryName()
Specified by:
getTargetAccountingLineEntryName in interface AccountingDocument

getGeneralLedgerPendingEntrySourceDetails

public List<GeneralLedgerPendingEntrySourceDetail> getGeneralLedgerPendingEntrySourceDetails()
Description copied from interface: GeneralLedgerPendingEntrySource
Returns a list of any GeneralLedgerPostables this helper has, to create GeneralLedgerPendingEntries

Specified by:
getGeneralLedgerPendingEntrySourceDetails in interface GeneralLedgerPendingEntrySource
Returns:
a list of GeneralLedgerPostables

customizeExplicitGeneralLedgerPendingEntry

public void customizeExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable,
                                                       GeneralLedgerPendingEntry explicitEntry)

customizeOffsetGeneralLedgerPendingEntry

public boolean customizeOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail accountingLine,
                                                        GeneralLedgerPendingEntry explicitEntry,
                                                        GeneralLedgerPendingEntry offsetEntry)

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

Overrides:
toCopy in class GeneralLedgerPostingDocumentBase
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
GeneralLedgerPostingDocumentBase.toCopy()

toErrorCorrection

public void toErrorCorrection()
                       throws org.kuali.rice.kew.exception.WorkflowException
Overrides:
toErrorCorrection in class GeneralLedgerPostingDocumentBase
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
GeneralLedgerPostingDocumentBase.toErrorCorrection()

copyAccountingLines

protected void copyAccountingLines(boolean isErrorCorrection)
Copies accounting lines but sets new document number and version If error correction, reverses line amount.


updatePostingYearForAccountingLines

protected void updatePostingYearForAccountingLines(List<AccountingLine> lines)
Updates the posting year on accounting lines to be the current posting year

Parameters:
lines - a List of accounting lines to update

buildListOfDeletionAwareLists

public List buildListOfDeletionAwareLists()
Specified by:
buildListOfDeletionAwareLists in interface org.kuali.rice.kns.bo.PersistableBusinessObject
Overrides:
buildListOfDeletionAwareLists in class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
See Also:
PersistableBusinessObjectBase.buildListOfDeletionAwareLists()

prepareForSave

public void prepareForSave(org.kuali.rice.kns.rule.event.KualiDocumentEvent event)
Specified by:
prepareForSave in interface org.kuali.rice.kns.document.Document
Overrides:
prepareForSave in class GeneralLedgerPostingDocumentBase

generateSaveEvents

public List generateSaveEvents()
Specified by:
generateSaveEvents in interface org.kuali.rice.kns.document.Document
Overrides:
generateSaveEvents in class org.kuali.rice.kns.document.DocumentBase

getTargetAccountingLinesForComparison

protected List getTargetAccountingLinesForComparison()
This method gets the Target Accounting Lines that will be used in comparisons

Returns:

getPersistedTargetAccountingLinesForComparison

protected List getPersistedTargetAccountingLinesForComparison()
This method gets the Persisted Target Accounting Lines that will be used in comparisons

Returns:

getSourceAccountingLinesForComparison

protected List getSourceAccountingLinesForComparison()
This method gets the Source Accounting Lines that will be used in comparisons

Returns:

getPersistedSourceAccountingLinesForComparison

protected List getPersistedSourceAccountingLinesForComparison()
This method gets the Persisted Source Accounting Lines that will be used in comparisons

Returns:

generateEvents

protected List generateEvents(List persistedLines,
                              List currentLines,
                              String errorPathPrefix,
                              org.kuali.rice.kns.document.TransactionalDocument document)
Generates a List of instances of AccountingLineEvent subclasses, one for each accountingLine in the union of the persistedLines and currentLines lists. Events in the list will be grouped in order by event-type (review, update, add, delete).

Parameters:
persistedLines -
currentLines -
errorPathPrefix -
document -
Returns:
List of AccountingLineEvent subclass instances

buildAccountingLineMap

protected Map buildAccountingLineMap(List accountingLines)
Parameters:
accountingLines -
Returns:
Map containing accountingLines from the given List, indexed by their sequenceNumber

generateGeneralLedgerPendingEntries

public boolean generateGeneralLedgerPendingEntries(GeneralLedgerPendingEntrySourceDetail glpeSourceDetail,
                                                   GeneralLedgerPendingEntrySequenceHelper sequenceHelper)
Perform business rules common to all transactional documents when generating general ledger pending entries.

Specified by:
generateGeneralLedgerPendingEntries in interface GeneralLedgerPendingEntrySource
Parameters:
glpeSourceDetail - the source detail line to generate general ledger pending entries for
sequenceHelper - the sequence helper which will assign sequence number to generated general ledger pending entries
Returns:
true if general ledger pending entry generation was successful; false if an error condition prevented the successful generation of the pending entries
See Also:
org.kuali.rice.kns.rule.GenerateGeneralLedgerPendingEntriesRule#processGenerateGeneralLedgerPendingEntries(org.kuali.rice.kns.document.AccountingDocument, org.kuali.rice.kns.bo.AccountingLine, org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySequenceHelper)

processExplicitGeneralLedgerPendingEntry

protected void processExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySequenceHelper sequenceHelper,
                                                        GeneralLedgerPendingEntrySourceDetail glpeSourceDetail,
                                                        GeneralLedgerPendingEntry explicitEntry)
This method processes all necessary information to build an explicit general ledger entry, and then adds that to the document.

Parameters:
accountingDocument -
sequenceHelper -
accountingLine -
explicitEntry -

processOffsetGeneralLedgerPendingEntry

protected boolean processOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySequenceHelper sequenceHelper,
                                                         GeneralLedgerPendingEntrySourceDetail postable,
                                                         GeneralLedgerPendingEntry explicitEntry,
                                                         GeneralLedgerPendingEntry offsetEntry)
This method processes an accounting line's information to build an offset entry, and then adds that to the document.

Parameters:
accountingDocument -
sequenceHelper -
accountingLine -
explicitEntry -
offsetEntry -
Returns:
boolean True if the offset generation is successful.

getEntryValue

protected String getEntryValue(String preferredString,
                               String secondaryString)
Returns one of the two given String's; if the preferred String is not null and has a length > 0, then it is returned, otherwise the second String is returned

Parameters:
preferredString - the String you're hoping isn't blank so you can get it back
secondaryString - the "rebound" String, which you'll end up with if the preferred String is blank
Returns:
one of the String's

isDebit

public abstract boolean isDebit(GeneralLedgerPendingEntrySourceDetail postable)
Description copied from interface: GeneralLedgerPendingEntrySource
This method determines if the passed in GeneralLedgerPendingEntrySourceDetail is a debit or not.

Specified by:
isDebit in interface GeneralLedgerPendingEntrySource
Returns:
true if the given GeneralLedgerPendingEntrySourceDetail is a debit, false if it is a credit
See Also:
org.kuali.kfs.document.GeneralLedgerPostingHelper#isDebit(org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySourceDetail)

generateDocumentGeneralLedgerPendingEntries

public boolean generateDocumentGeneralLedgerPendingEntries(GeneralLedgerPendingEntrySequenceHelper sequenceHelper)
Most accounting documents don't need to generate document level GLPE's, so don't do anything in the default implementation

Specified by:
generateDocumentGeneralLedgerPendingEntries in interface GeneralLedgerPendingEntrySource
Parameters:
sequenceHelper - a sequence helper for the method to create more general ledger pending entries
Returns:
always true, because we've always successfully not generating anything
See Also:
org.kuali.kfs.document.GeneralLedgerPostingHelper#processGenerateDocumentGeneralLedgerPendingEntries(org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySequenceHelper)

getGeneralLedgerPendingEntryAmountForDetail

public org.kuali.rice.kns.util.KualiDecimal getGeneralLedgerPendingEntryAmountForDetail(GeneralLedgerPendingEntrySourceDetail postable)
GLPE amounts are ALWAYS positive, so just take the absolute value of the accounting line's amount.

Specified by:
getGeneralLedgerPendingEntryAmountForDetail in interface GeneralLedgerPendingEntrySource
Parameters:
accountingLine -
Returns:
KualiDecimal The amount that will be used to populate the GLPE.

getDocumentClassForAccountingLineValueAllowedValidation

public Class<? extends AccountingDocument> getDocumentClassForAccountingLineValueAllowedValidation()
Description copied from interface: AccountingDocument
This method returns the Class to use for AccountingLingValuesAllowedValidation.

Specified by:
getDocumentClassForAccountingLineValueAllowedValidation in interface AccountingDocument


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