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.Map;
020    
021    import org.kuali.kfs.gl.businessobject.Encumbrance;
022    
023    /**
024     * An interface declaring services dealing with encumbrances
025     */
026    public interface EncumbranceService {
027        /**
028         * Save an Encumbrance entry
029         * 
030         * @param enc an encumbrance entry
031         */
032        public void save(Encumbrance enc);
033    
034        /**
035         * Purge an entire fiscal year for a single chart.
036         * 
037         * @param chartOfAccountsCode the chart of encumbrances to purge
038         * @param year the year of encumbrances to purage
039         */
040        public void purgeYearByChart(String chartOfAccountsCode, int year);
041    
042        /**
043         * Fetch all encumbrance records from GL open encumbrance table.  Based on test data, there's only
044         * about a third as many encumbrances as there are, say, balances, so unless your institution is huge,
045         * it's probably safe to call this method.
046         * @return an Iterator of encumbrances
047         */
048        public Iterator getAllEncumbrances();
049    
050        /**
051         * group all encumbrances with/without the given document type code by fiscal year, chart, account, sub-account, object code,
052         * sub object code, and balance type code, and summarize the encumbrance amount and the encumbrance close amount.
053         * 
054         * @param documentTypeCode the given document type code
055         * @param included indicate if all encumbrances with the given document type are included in the results or not
056         */
057        public Iterator getSummarizedEncumbrances(String documentTypeCode, boolean included);
058    
059        /**
060         * This method finds the open encumbrances according to input fields and values
061         * 
062         * @param fieldValues the input fields and values
063         * @return a collection of open encumbrances
064         */
065        public Iterator findOpenEncumbrance(Map fieldValues);
066    
067        /**
068         * This method gets the number of the open encumbrances according to input fields and values
069         * 
070         * @param fieldValues the input fields and values
071         * @return the number of the open encumbrances
072         */
073        public Integer getOpenEncumbranceRecordCount(Map fieldValues);
074    }