org.kuali.kfs.sys.document
Class GeneralLedgerPostingDocumentBase

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
All Implemented Interfaces:
Serializable, org.apache.ojb.broker.PersistenceBrokerAware, FinancialSystemTransactionalDocument, 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:
AccountingDocumentBase, AssetDepreciationDocument, AssetTransferDocument, CashControlDocument, CashManagementDocument, CustomerCreditMemoDocument, CustomerInvoiceWriteoffDocument, PaymentApplicationDocument

public class GeneralLedgerPostingDocumentBase
extends LedgerPostingDocumentBase
implements GeneralLedgerPostingDocument

Base implementation for a general ledger posting document.

See Also:
Serialized Form

Field Summary
protected  List<GeneralLedgerPendingEntry> generalLedgerPendingEntries
           
protected static org.apache.log4j.Logger LOG
           
 
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
GeneralLedgerPostingDocumentBase()
          Default constructor.
 
Method Summary
 void addPendingEntry(GeneralLedgerPendingEntry pendingEntry)
          Adds a GeneralLedgerPendingEntry to this document's list of pending entries
protected  void changeGeneralLedgerPendingEntriesApprovedStatusCode()
          This method iterates over all of the GLPEs for a document and sets their approved status code to APPROVED "A".
 List<SufficientFundsItem> checkSufficientFunds()
          This method will check sufficient funds for the document
 void clearAnyGeneralLedgerPendingEntries()
          This resets this document's list of general ledger pending etnries, though it does not delete those entries (however, the GeneralLedgerPendingEntryService will in most cases when this method is called).
 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)
          Override to call super and then iterate over all GLPEs and update the approved code appropriately.
 List<GeneralLedgerPendingEntry> getGeneralLedgerPendingEntries()
          This method retrieves the list of GLPEs for the document.
 GeneralLedgerPendingEntry getGeneralLedgerPendingEntry(int index)
          This method retrieves a particular pending entry instance, automatically instantiating any missing intervening instances.
 List<GeneralLedgerPendingEntry> getPendingLedgerEntriesForSufficientFundsChecking()
          This method will return only PLEs that should be checked for SF.
 void prepareForSave(org.kuali.rice.kns.rule.event.KualiDocumentEvent event)
           
protected  void removeGeneralLedgerPendingEntries()
          This method calls the service to remove all of the GLPE's associated with this document
 void setGeneralLedgerPendingEntries(List<GeneralLedgerPendingEntry> generalLedgerPendingEntries)
          This method sets the list of pending entries for this document.
 void toCopy()
          If we've copied, we need to update the posting period and year
 void toErrorCorrection()
           
 
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, generateSaveEvents, 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, buildListOfDeletionAwareLists, 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.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, 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
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG

generalLedgerPendingEntries

protected List<GeneralLedgerPendingEntry> generalLedgerPendingEntries
Constructor Detail

GeneralLedgerPostingDocumentBase

public GeneralLedgerPostingDocumentBase()
Default constructor.

Method Detail

getGeneralLedgerPendingEntries

public List<GeneralLedgerPendingEntry> getGeneralLedgerPendingEntries()
Description copied from interface: GeneralLedgerPostingDocument
This method retrieves the list of GLPEs for the document.

Specified by:
getGeneralLedgerPendingEntries in interface GeneralLedgerPostingDocument
Returns:
A list of pending entries.
See Also:
GeneralLedgerPostingDocument.getGeneralLedgerPendingEntries()

getGeneralLedgerPendingEntry

public GeneralLedgerPendingEntry getGeneralLedgerPendingEntry(int index)
Description copied from interface: GeneralLedgerPostingDocument
This method retrieves a particular pending entry instance, automatically instantiating any missing intervening instances. This behavior is coupled tightly with some underlying issues that the Struts PojoProcessor plugin has with how objects get instantiated within lists. This behavior is required because 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.

Specified by:
getGeneralLedgerPendingEntry in interface GeneralLedgerPostingDocument
Returns:
The GLPE instance at the passed in index.
See Also:
GeneralLedgerPostingDocument.getGeneralLedgerPendingEntry(int)

setGeneralLedgerPendingEntries

public void setGeneralLedgerPendingEntries(List<GeneralLedgerPendingEntry> generalLedgerPendingEntries)
Description copied from interface: GeneralLedgerPostingDocument
This method sets the list of pending entries for this document.

Specified by:
setGeneralLedgerPendingEntries in interface GeneralLedgerPostingDocument
See Also:
GeneralLedgerPostingDocument.setGeneralLedgerPendingEntries(java.util.List)

checkSufficientFunds

public List<SufficientFundsItem> checkSufficientFunds()
Description copied from interface: GeneralLedgerPostingDocument
This method will check sufficient funds for the document

Specified by:
checkSufficientFunds in interface GeneralLedgerPostingDocument
Returns:
a list of sufficientfundsitems that do not have sufficient funds. It returns an empty list if there is sufficient funds for the entire document
See Also:
GeneralLedgerPostingDocument.checkSufficientFunds()

documentPerformsSufficientFundsCheck

public boolean documentPerformsSufficientFundsCheck()
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

Returns:

getPendingLedgerEntriesForSufficientFundsChecking

public List<GeneralLedgerPendingEntry> getPendingLedgerEntriesForSufficientFundsChecking()
Description copied from interface: GeneralLedgerPostingDocument
This method will return only PLEs that should be checked for SF. Normally this will be all PLEs, but some docs (such as BA) have additional requirements.

Specified by:
getPendingLedgerEntriesForSufficientFundsChecking in interface GeneralLedgerPostingDocument
Returns:
a list of sufficientfundsitems that do not have sufficient funds. It returns an empty list if there is sufficient funds for the entire document
See Also:
GeneralLedgerPostingDocument.getPendingLedgerEntriesForSufficientFundsChecking()

doRouteStatusChange

public void doRouteStatusChange(org.kuali.rice.kew.dto.DocumentRouteStatusChangeDTO statusChangeEvent)
Override to call super and then iterate over all GLPEs and update the approved code appropriately.

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

changeGeneralLedgerPendingEntriesApprovedStatusCode

protected void changeGeneralLedgerPendingEntriesApprovedStatusCode()
This method iterates over all of the GLPEs for a document and sets their approved status code to APPROVED "A".


removeGeneralLedgerPendingEntries

protected void removeGeneralLedgerPendingEntries()
This method calls the service to remove all of the GLPE's associated with this document


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 LedgerPostingDocumentBase
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
DocumentBase.toCopy()

toErrorCorrection

public void toErrorCorrection()
                       throws org.kuali.rice.kew.exception.WorkflowException
Overrides:
toErrorCorrection in class FinancialSystemTransactionalDocumentBase
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
org.kuali.rice.kns.document.TransactionalDocumentBase#toErrorCorrection()

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 org.kuali.rice.kns.document.DocumentBase

addPendingEntry

public void addPendingEntry(GeneralLedgerPendingEntry pendingEntry)
Adds a GeneralLedgerPendingEntry to this document's list of pending entries

Parameters:
pendingEntry - a pending entry to add

clearAnyGeneralLedgerPendingEntries

public void clearAnyGeneralLedgerPendingEntries()
This resets this document's list of general ledger pending etnries, though it does not delete those entries (however, the GeneralLedgerPendingEntryService will in most cases when this method is called).



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