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.sys.dataaccess;
017    
018    import java.util.Collection;
019    import java.util.Iterator;
020    import java.util.Map;
021    
022    import org.kuali.kfs.coa.businessobject.Account;
023    import org.kuali.kfs.gl.businessobject.Balance;
024    import org.kuali.kfs.gl.businessobject.Encumbrance;
025    import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry;
026    import org.kuali.rice.kns.util.KualiDecimal;
027    
028    /**
029     * This interface defines basic methods that GeneralLedgerPendingEntry Dao's must provide
030     */
031    public interface GeneralLedgerPendingEntryDao {
032    
033        /**
034         * Get summary of amounts in the pending entry table
035         * 
036         * @param universityFiscalYear
037         * @param chartOfAccountsCode
038         * @param accountNumber
039         * @param objectCodes
040         * @param balanceTypeCodes
041         * @param isDebit
042         * @return
043         */
044        public KualiDecimal getTransactionSummary(Collection universityFiscalYears, String chartOfAccountsCode, String accountNumber, Collection objectCodes, Collection balanceTypeCodes, boolean isDebit);
045    
046        /**
047         * Get summary of amounts in the pending entry table
048         * 
049         * @param universityFiscalYear
050         * @param chartOfAccountsCode
051         * @param accountNumber
052         * @param objectTypeCodes
053         * @param balanceTypeCodes
054         * @param acctSufficientFundsFinObjCd
055         * @param isDebit
056         * @param isYearEnd
057         * @return
058         */
059        public KualiDecimal getTransactionSummary(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, Collection objectTypeCodes, Collection balanceTypeCodes, String acctSufficientFundsFinObjCd, boolean isDebit, boolean isYearEnd);
060    
061        /**
062         * Get summary of amounts in the pending entry table
063         * 
064         * @param universityFiscalYear
065         * @param chartOfAccountsCode
066         * @param accountNumber
067         * @param objectTypeCodes
068         * @param balanceTypeCodes
069         * @param acctSufficientFundsFinObjCd
070         * @param isYearEnd
071         * @return
072         */
073        public KualiDecimal getTransactionSummary(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, Collection objectTypeCodes, Collection balanceTypeCodes, String acctSufficientFundsFinObjCd, boolean isYearEnd);
074    
075        /**
076         * Find Pending Entries
077         * 
078         * @param fieldValues
079         * @param isApproved
080         * @return
081         */
082        public Collection findPendingEntries(Map fieldValues, boolean isApproved);
083    
084        /**
085         * @param documentHeaderId
086         * @param transactionLedgerEntrySequenceNumber
087         * @return a pending ledger entry
088         */
089        public GeneralLedgerPendingEntry getByPrimaryId(String documentHeaderId, Integer transactionLedgerEntrySequenceNumber);
090    
091        /**
092         * @param generalLedgerPendingEntry
093         */
094        public void save(GeneralLedgerPendingEntry generalLedgerPendingEntry);
095    
096        /**
097         * Delete all pending entries for a given document
098         * 
099         * @param documentHeaderId
100         */
101        public void delete(String documentHeaderId);
102    
103        /**
104         * Delete all pending entries based on the document approved code
105         * 
106         * @param financialDocumentApprovedCode
107         */
108        public void deleteByFinancialDocumentApprovedCode(String financialDocumentApprovedCode);
109    
110        /**
111         * This method retrieves all approved pending ledger entries
112         * 
113         * @return all approved pending ledger entries
114         */
115        public Iterator findApprovedPendingLedgerEntries();
116    
117        /**
118         * This method counts all approved pending ledger entries by account
119         * 
120         * @param account the given account
121         * @return count of entries
122         */
123        public int countPendingLedgerEntries(Account account);
124    
125        /**
126         * This method retrieves all pending ledger entries for the given encumbrance
127         * 
128         * @param encumbrance the encumbrance entry in the GL_Encumbrance_T table
129         * @param isApproved the flag that indicates whether the pending entries are approved or don't care
130         * @return all pending ledger entries of the given encumbrance
131         */
132        public Iterator findPendingLedgerEntries(Encumbrance encumbrance, boolean isApproved);
133    
134        /**
135         * This method retrieves all pending ledger entries for the given encumbrance
136         * 
137         * @param balance the balance entry
138         * @param isApproved the flag that indicates whether the pending entries are approved or don't care
139         * @param isConsolidated consolidation option is applied or not
140         * @return all pending ledger entries of the given balance
141         */
142        public Iterator findPendingLedgerEntries(Balance balance, boolean isApproved, boolean isConsolidated);
143    
144        /**
145         * This method retrieves all pending ledger entries matching the given entry criteria
146         * 
147         * @param isApproved the flag that indicates whether the pending entries are approved or don't care
148         * @param fieldValues the input fields and values
149         * @return all pending ledger entries matching the given balance criteria
150         */
151        public Iterator findPendingLedgerEntriesForEntry(Map fieldValues, boolean isApproved);
152    
153        /**
154         * This method retrieves all pending ledger entries matching the given balance criteria
155         * 
156         * @param isApproved the flag that indicates whether the pending entries are approved or don't care
157         * @param fieldValues the input fields and values
158         * @return all pending ledger entries matching the given balance criteria
159         */
160        public Iterator findPendingLedgerEntriesForBalance(Map fieldValues, boolean isApproved);
161    
162        /**
163         * This method retrieves all pending ledger entries matching the given cash balance criteria
164         * 
165         * @param isApproved the flag that indicates whether the pending entries are approved or don't care
166         * @param fieldValues the input fields and values
167         * @return all pending ledger entries matching the given cash balance criteria
168         */
169        public Iterator findPendingLedgerEntriesForCashBalance(Map fieldValues, boolean isApproved);
170    
171        /**
172         * This method retrieves all pending ledger entries that may belong to encumbrance table in the future
173         * 
174         * @param isApproved the flag that indicates whether the pending entries are approved or don't care
175         * @param fieldValues the input fields and values
176         * @return all pending ledger entries that may belong to encumbrance table
177         */
178        public Iterator findPendingLedgerEntriesForEncumbrance(Map fieldValues, boolean isApproved);
179    
180        /**
181         * This method retrieves all pending ledger entries that may belong to the given account balance record in the future
182         * 
183         * @param fieldValues the input fields and values
184         * @param isApproved the flag that indicates whether the pending entries are approved or don't care
185         * @return all pending ledger entries that may belong to encumbrance table
186         */
187        public Iterator findPendingLedgerEntrySummaryForAccountBalance(Map fieldValues, boolean isApproved);
188    
189        /**
190         * This method retrieves all pending ledger entries that may belong to the given account balance record in the future
191         * 
192         * @param fieldValues the input fields and values
193         * @param isApproved the flag that indicates whether the pending entries are approved or don't care
194         * @return all pending ledger entries that may belong to encumbrance table
195         */
196        public Iterator findPendingLedgerEntriesForAccountBalance(Map fieldValues, boolean isApproved);
197    
198    }