001/*
002 * Copyright 2007 The Kuali Foundation
003 * 
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 * http://www.opensource.org/licenses/ecl2.php
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.ole.sys.document;
017
018import java.util.List;
019
020import org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntry;
021import org.kuali.ole.sys.businessobject.SufficientFundsItem;
022
023/**
024 * Defines methods that must be implements for a general ledger posting document.
025 */
026public interface GeneralLedgerPostingDocument extends LedgerPostingDocument {
027    /**
028     * This method retrieves the list of GLPEs for the document.
029     * 
030     * @return A list of pending entries.
031     */
032    List<GeneralLedgerPendingEntry> getGeneralLedgerPendingEntries();
033
034    /**
035     * This method retrieves a particular pending entry instance, automatically instantiating any missing intervening instances.
036     * This behavior is coupled tightly with some underlying issues that the Struts PojoProcessor plugin has with how objects get
037     * instantiated within lists. This behavior is required because otherwise when the PojoProcessor tries to automatically inject
038     * values into the list, it will get an index out of bounds error if the instance at an index is being called and prior
039     * instances at indices before that one are not being instantiated.
040     * 
041     * @param index
042     * @return The GLPE instance at the passed in index.
043     */
044    GeneralLedgerPendingEntry getGeneralLedgerPendingEntry(int index);
045
046    /**
047     * This method sets the list of pending entries for this document.
048     * 
049     * @param generalLedgerPendingEntries
050     */
051    void setGeneralLedgerPendingEntries(List<GeneralLedgerPendingEntry> generalLedgerPendingEntries);
052
053    /**
054     * This method will check sufficient funds for the document
055     * 
056     * @return a list of sufficientfundsitems that do not have sufficient funds. It returns an empty list if there is sufficient
057     *         funds for the entire document
058     */
059    public List<SufficientFundsItem> checkSufficientFunds();
060
061    /**
062     * This method will return only PLEs that should be checked for SF. Normally this will be all PLEs, but some docs (such as BA)
063     * have additional requirements.
064     * 
065     * @return a list of sufficientfundsitems that do not have sufficient funds. It returns an empty list if there is sufficient
066     *         funds for the entire document
067     */
068    public List<GeneralLedgerPendingEntry> getPendingLedgerEntriesForSufficientFundsChecking();
069}