1 /*
2 * Copyright 2007 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.ole.sys.document;
17
18 import java.util.List;
19
20 import org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntry;
21 import org.kuali.ole.sys.businessobject.SufficientFundsItem;
22
23 /**
24 * Defines methods that must be implements for a general ledger posting document.
25 */
26 public interface GeneralLedgerPostingDocument extends LedgerPostingDocument {
27 /**
28 * This method retrieves the list of GLPEs for the document.
29 *
30 * @return A list of pending entries.
31 */
32 List<GeneralLedgerPendingEntry> getGeneralLedgerPendingEntries();
33
34 /**
35 * This method retrieves a particular pending entry instance, automatically instantiating any missing intervening instances.
36 * This behavior is coupled tightly with some underlying issues that the Struts PojoProcessor plugin has with how objects get
37 * instantiated within lists. This behavior is required because otherwise when the PojoProcessor tries to automatically inject
38 * values into the list, it will get an index out of bounds error if the instance at an index is being called and prior
39 * instances at indices before that one are not being instantiated.
40 *
41 * @param index
42 * @return The GLPE instance at the passed in index.
43 */
44 GeneralLedgerPendingEntry getGeneralLedgerPendingEntry(int index);
45
46 /**
47 * This method sets the list of pending entries for this document.
48 *
49 * @param generalLedgerPendingEntries
50 */
51 void setGeneralLedgerPendingEntries(List<GeneralLedgerPendingEntry> generalLedgerPendingEntries);
52
53 /**
54 * This method will check sufficient funds for the document
55 *
56 * @return a list of sufficientfundsitems that do not have sufficient funds. It returns an empty list if there is sufficient
57 * funds for the entire document
58 */
59 public List<SufficientFundsItem> checkSufficientFunds();
60
61 /**
62 * This method will return only PLEs that should be checked for SF. Normally this will be all PLEs, but some docs (such as BA)
63 * have additional requirements.
64 *
65 * @return a list of sufficientfundsitems that do not have sufficient funds. It returns an empty list if there is sufficient
66 * funds for the entire document
67 */
68 public List<GeneralLedgerPendingEntry> getPendingLedgerEntriesForSufficientFundsChecking();
69 }