1 /*
2 * Copyright 2006 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.gl.dataaccess;
17
18 import java.util.Iterator;
19 import java.util.List;
20 import java.util.Map;
21
22 import org.kuali.ole.gl.businessobject.AccountBalance;
23 import org.kuali.ole.gl.businessobject.Transaction;
24 import org.kuali.ole.sys.businessobject.SystemOptions;
25 import org.kuali.ole.sys.businessobject.UniversityDate;
26
27 /**
28 * An interface that declares methods needed for AccountBalances to interact with the database
29 */
30 public interface AccountBalanceDao {
31 /**
32 * Given a transaction, finds a matching account balance in the database
33 *
34 * @param t a transaction to find an appropriate related account balance for
35 * @return an appropriate account balance
36 */
37 public AccountBalance getByTransaction(Transaction t);
38
39 /**
40 * This method finds the available account balances according to input fields and values
41 *
42 * @param fieldValues the input fields and values
43 * @return the summary records of account balance entries
44 */
45 public Iterator findConsolidatedAvailableAccountBalance(Map fieldValues);
46
47 /**
48 * This method finds the available account balances according to input fields and values
49 *
50 * @param fieldValues the input fields and values
51 * @return account balance entries
52 */
53 public Iterator findAvailableAccountBalance(Map fieldValues);
54
55 /**
56 * Get available balances by consolidation for specific object types
57 *
58 * @param objectTypes the object types that reported account balances must have
59 * @param universityFiscalYear the university fiscal year of account balances to find
60 * @param chartOfAccountsCode the chart of accounts of account balances to find
61 * @param accountNumber the account number of account balances to find
62 * @param isExcludeCostShare whether cost share entries should be excluded from this inquiry
63 * @param isConsolidated whether the results of this should be consolidated or not
64 * @param pendingEntriesCode whether to include no pending entries, approved pending entries, or all pending entries
65 * @param options system options
66 * @param today current university date
67 * @return a List of Maps with the appropriate query results
68 */
69 public List findAccountBalanceByConsolidationByObjectTypes(String[] objectTypes, Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, boolean isExcludeCostShare, boolean isConsolidated, int pendingEntriesCode, SystemOptions options, UniversityDate today);
70
71 /**
72 * Get available balances by level
73 *
74 * @param universityFiscalYear the university fiscal year of account balances to find
75 * @param chartOfAccountsCode the chart of accounts of account balances to find
76 * @param accountNumber the account number of account balances to find
77 * @param financialConsolidationObjectCode the consolidation code of account balances to find
78 * @param isCostShareExcluded whether cost share entries should be excluded from this inquiry
79 * @param isConsolidated whether the results of this should be consolidated or not
80 * @param pendingEntryCode
81 * @param today the current university date
82 * @return a List of Mapswith the appropriate query results
83 */
84 public List findAccountBalanceByLevel(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String financialConsolidationObjectCode, boolean isCostShareExcluded, boolean isConsolidated, int pendingEntryCode, UniversityDate today, SystemOptions options);
85
86 /**
87 * Get available balances by object
88 *
89 * @param universityFiscalYear the university fiscal year of account balances to find
90 * @param chartOfAccountsCode the chart of accounts of account balances to find
91 * @param accountNumber the account number of account balances to find
92 * @param financialObjectLevelCode the object level code of account balances to find
93 * @param financialReportingSortCode
94 * @param isCostShareExcluded whether cost share entries should be excluded from this inquiry
95 * @param isConsolidated whether the results of this should be consolidated or not
96 * @param pendingEntryCode
97 * @param today the current university date
98 * @return a List of Maps with the appropriate query results
99 */
100 public List findAccountBalanceByObject(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String financialObjectLevelCode, String financialReportingSortCode, boolean isCostShareExcluded, boolean isConsolidated, int pendingEntryCode, UniversityDate today, SystemOptions options);
101
102 /**
103 * Purge an entire fiscal year for a single chart.
104 *
105 * @param chartOfAccountsCode the chart of accounts code of account balances to purge
106 * @param year the fiscal year of account balances to purge
107 */
108 public void purgeYearByChart(String chartOfAccountscode, int year);
109
110 /**
111 * @param year the given university fiscal year
112 * @return count of rows for the given fiscal year
113 */
114 public Integer findCountGreaterOrEqualThan(Integer year);
115 }