001/*
002 * Copyright 2006 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.gl.dataaccess;
017
018import java.util.Iterator;
019import java.util.List;
020import java.util.Map;
021
022import org.kuali.ole.gl.businessobject.AccountBalance;
023import org.kuali.ole.gl.businessobject.Transaction;
024import org.kuali.ole.sys.businessobject.SystemOptions;
025import org.kuali.ole.sys.businessobject.UniversityDate;
026
027/**
028 * An interface that declares methods needed for AccountBalances to interact with the database
029 */
030public interface AccountBalanceDao {
031    /**
032     * Given a transaction, finds a matching account balance in the database
033     * 
034     * @param t a transaction to find an appropriate related account balance for
035     * @return an appropriate account balance
036     */
037    public AccountBalance getByTransaction(Transaction t);
038
039    /**
040     * This method finds the available account balances according to input fields and values
041     * 
042     * @param fieldValues the input fields and values
043     * @return the summary records of account balance entries
044     */
045    public Iterator findConsolidatedAvailableAccountBalance(Map fieldValues);
046
047    /**
048     * This method finds the available account balances according to input fields and values
049     * 
050     * @param fieldValues the input fields and values
051     * @return account balance entries
052     */
053    public Iterator findAvailableAccountBalance(Map fieldValues);
054
055    /**
056     * Get available balances by consolidation for specific object types
057     * 
058     * @param objectTypes the object types that reported account balances must have
059     * @param universityFiscalYear the university fiscal year of account balances to find
060     * @param chartOfAccountsCode the chart of accounts of account balances to find
061     * @param accountNumber the account number of account balances to find
062     * @param isExcludeCostShare whether cost share entries should be excluded from this inquiry
063     * @param isConsolidated whether the results of this should be consolidated or not
064     * @param pendingEntriesCode whether to include no pending entries, approved pending entries, or all pending entries
065     * @param options system options
066     * @param today current university date
067     * @return a List of Maps with the appropriate query results
068     */
069    public List findAccountBalanceByConsolidationByObjectTypes(String[] objectTypes, Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, boolean isExcludeCostShare, boolean isConsolidated, int pendingEntriesCode, SystemOptions options, UniversityDate today);
070
071    /**
072     * Get available balances by level
073     * 
074     * @param universityFiscalYear the university fiscal year of account balances to find
075     * @param chartOfAccountsCode the chart of accounts of account balances to find
076     * @param accountNumber the account number of account balances to find
077     * @param financialConsolidationObjectCode the consolidation code of account balances to find
078     * @param isCostShareExcluded whether cost share entries should be excluded from this inquiry
079     * @param isConsolidated whether the results of this should be consolidated or not
080     * @param pendingEntryCode
081     * @param today the current university date
082     * @return a List of Mapswith the appropriate query results
083     */
084    public List findAccountBalanceByLevel(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String financialConsolidationObjectCode, boolean isCostShareExcluded, boolean isConsolidated, int pendingEntryCode, UniversityDate today, SystemOptions options);
085
086    /**
087     * Get available balances by object
088     * 
089     * @param universityFiscalYear the university fiscal year of account balances to find
090     * @param chartOfAccountsCode the chart of accounts of account balances to find
091     * @param accountNumber the account number of account balances to find
092     * @param financialObjectLevelCode the object level code of account balances to find
093     * @param financialReportingSortCode
094     * @param isCostShareExcluded whether cost share entries should be excluded from this inquiry
095     * @param isConsolidated whether the results of this should be consolidated or not
096     * @param pendingEntryCode
097     * @param today the current university date
098     * @return a List of Maps with the appropriate query results
099     */
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}