01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.gl.dao;
17:
18: import java.util.Iterator;
19: import java.util.Map;
20:
21: import org.kuali.module.gl.bo.Encumbrance;
22: import org.kuali.module.gl.bo.Transaction;
23:
24: /**
25: * A DAO interface that declares methods needed for Encumbrances to interact with the database
26: */
27: public interface EncumbranceDao {
28: /**
29: * Returns an encumbrance that would be affected by the given transaction
30: *
31: * @param t the transaction to find the affected encumbrance for
32: * @return an Encumbrance that would be affected by the posting of the transaction, or null
33: */
34: public Encumbrance getEncumbranceByTransaction(Transaction t);
35:
36: /**
37: * Returns an Iterator of all encumbrances that need to be closed for the fiscal year
38: *
39: * @param fiscalYear a fiscal year to find encumbrances for
40: * @return an Iterator of encumbrances to close
41: */
42: public Iterator getEncumbrancesToClose(Integer fiscalYear);
43:
44: /**
45: * Purges the database of all those encumbrances with the given chart and year
46: *
47: * @param chartOfAccountsCode the chart of accounts code purged encumbrances will have
48: * @param year the university fiscal year purged encumbrances will have
49: */
50: public void purgeYearByChart(String chartOfAccountsCode, int year);
51:
52: /**
53: * Saves an encumbrance to the database
54: *
55: * @param e an encumbrance to save
56: */
57: public void save(Encumbrance e);
58:
59: /**
60: * fetch all encumbrance records from GL open encumbrance table
61: *
62: * @return an Iterator with all encumbrances currently in the database
63: */
64: public Iterator getAllEncumbrances();
65:
66: /**
67: * group all encumbrances with/without the given document type code by fiscal year, chart, account, sub-account, object code,
68: * sub object code, and balance type code, and summarize the encumbrance amount and the encumbrance close amount.
69: *
70: * @param documentTypeCode the given document type code
71: * @param included indicate if all encumbrances with the given document type are included in the results or not
72: * @return an Iterator of arrays of java.lang.Objects holding summarization data about qualifying encumbrances
73: */
74: public Iterator getSummarizedEncumbrances(String documentTypeCode,
75: boolean included);
76:
77: /**
78: * This method finds the open encumbrances according to input fields and values
79: *
80: * @param fieldValues the input fields and values
81: * @return a collection of open encumbrances
82: */
83: public Iterator findOpenEncumbrance(Map fieldValues);
84:
85: /**
86: * Counts the number of the open encumbrances according to input fields and values
87: *
88: * @param fieldValues the input fields and values
89: * @return the number of the open encumbrances
90: */
91: public Integer getOpenEncumbranceRecordCount(Map fieldValues);
92: }
|