001    /*
002     * Copyright 2011 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     */
016    package org.kuali.kfs.gl.service;
017    
018    import java.util.Iterator;
019    import java.util.List;
020    import java.util.Map;
021    
022    import org.kuali.kfs.gl.businessobject.AccountBalance;
023    
024    /**
025     * This interface delcares methods useful for dealing with AccountBalance objects.
026     */
027    public interface AccountBalanceService {
028        public final int PENDING_NONE = 1;
029        public final int PENDING_APPROVED = 2;
030        public final int PENDING_ALL = 3;
031    
032        /**
033         * This method finds the available account balances according to input fields and values
034         * 
035         * @param fieldValues the input fields and values
036         * @return the summary records of account balance entries
037         */
038        public Iterator findConsolidatedAvailableAccountBalance(Map fieldValues);
039    
040        /**
041         * This method gets the number of the available account balances according to input fields and values
042         * 
043         * @param fieldValues the input fields and values
044         * @param isConsolidated determine whether the search results are consolidated
045         * @return the number of the available account balances
046         */
047        public Integer getAvailableAccountBalanceCount(Map fieldValues, boolean isConsolidated);
048    
049        /**
050         * This method finds the available account balances according to input fields and values
051         * 
052         * @param fieldValues the input fields and values
053         * @param isConsolidated determine whether the search results are consolidated
054         * @return a collection of account balance entries
055         */
056        public Iterator findAvailableAccountBalance(Map fieldValues);
057    
058        /**
059         * This method finds the available account balances according to input fields and values
060         * 
061         * @param universityFiscalYear the fiscal year account to find account balances for
062         * @param chartOfAccountsCode the chart of accounts code to find account balances for
063         * @param accountNumber the account number to find account balances for
064         * @param subAccountNumber the sub account number to find account balances for
065         * @param isCostShareExcluded should account balances found have cost share information excluded?
066         * @param isConsolidated should account balances found be consolidated?
067         * @param pendingEntryCode should pending entries be included in the query?
068         * @return a List of qualifying account balance records
069         */
070        public List findAccountBalanceByConsolidation(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String subAccountNumber, boolean isCostShareExcluded, boolean isConsolidated, int pendingEntryCode);
071    
072        /**
073         * This method finds the available account balances according to input fields and values
074         * 
075         * @param universityFiscalYear the fiscal year account to find account balances for
076         * @param chartOfAccountsCode the chart of accounts code to find account balances for
077         * @param accountNumber the account number to find account balances for
078         * @param subAccountNumber the sub account number to find account balances for
079         * @param financialConsolidationCode the consolidation code to find account balances for
080         * @param isCostShareExcluded should account balances found have cost share information excluded?
081         * @param isConsolidated should account balances found be consolidated?
082         * @param pendingEntryCode should pending entries be included in the query?
083         * @return a List of qualifying account balance records
084         */
085        public List findAccountBalanceByLevel(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String subAccountNumber, String financialConsolidationObjectCode, boolean isCostShareExcluded, boolean isConsolidated, int pendingEntryCode);
086    
087        /**
088         * This method finds the available account balances according to input fields and values
089         * 
090         * @param universityFiscalYear the fiscal year account to find account balances for
091         * @param chartOfAccountsCode the chart of accounts code to find account balances for
092         * @param accountNumber the account number to find account balances for
093         * @param subAccountNumber the sub account number to find account balances for
094         * @param financialObjectLevelCode the financial object level code to find account balances for
095         * @param financialReportingSortCode the reporting sort code to sort account balances by
096         * @param isCostShareExcluded should account balances found have cost share information excluded?
097         * @param isConsolidated should account balances found be consolidated?
098         * @param pendingEntryCode should pending entries be included in the query?
099         * @return a List of qualifying account balance records
100         */
101        public List findAccountBalanceByObject(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String subAccountNumber, String financialObjectLevelCode, String financialReportingSortCode, boolean isCostShareExcluded, boolean isConsolidated, int pendingEntryCode);
102    
103        /**
104         * Save an account balance
105         * 
106         * @param ab account balance record to save
107         */
108        public void save(AccountBalance ab);
109    
110        /**
111         * Purge an entire fiscal year for a single chart.
112         * 
113         * @param chartOfAccountsCode the chart of accounts to purge account balance records from
114         * @param year the fiscal year to purge account balance records of
115         */
116        public void purgeYearByChart(String chartOfAccountsCode, int year);
117    }