001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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.module.labor.service;
017:
018: import java.util.Collection;
019: import java.util.Iterator;
020: import java.util.List;
021: import java.util.Map;
022:
023: import org.kuali.module.labor.bo.EmployeeFunding;
024: import org.kuali.module.labor.bo.LaborBalanceSummary;
025: import org.kuali.module.labor.bo.LaborTransaction;
026: import org.kuali.module.labor.bo.LedgerBalance;
027: import org.kuali.module.labor.bo.LedgerBalanceForYearEndBalanceForward;
028:
029: public interface LaborLedgerBalanceService {
030:
031: /**
032: * @param fiscalYear the given fiscal year
033: * @return an Iterator over all balances for a given year
034: */
035: public Iterator<LedgerBalance> findBalancesForFiscalYear(
036: Integer fiscalYear);
037:
038: /**
039: * @param fiscalYear the given fiscal year
040: * @param fieldValues the input fields and values
041: * @return an Iterator over all balances for a given year and search criteria
042: */
043: public Iterator<LedgerBalance> findBalancesForFiscalYear(
044: Integer fiscalYear, Map<String, String> fieldValues);
045:
046: /**
047: * @param fiscalYear the given fiscal year
048: * @param fieldValues the input fields and values
049: * @param subFundGroupCodes the given list of qualified sub fund group codes
050: * @param fundGroupCodes the given list of qualified group codes
051: * @return an Iterator over all balances for a given year and search criteria that include the accounts of balances must belong
052: * to the given sub fund group or fund group
053: */
054: public Iterator<LedgerBalanceForYearEndBalanceForward> findBalancesForFiscalYear(
055: Integer fiscalYear, Map<String, String> fieldValues,
056: List<String> subFundGroupCodes, List<String> fundGroupCodes);
057:
058: /**
059: * This method gets the size of balance entries according to input fields and values
060: *
061: * @param fieldValues the input fields and values
062: * @param isConsolidated consolidation option is applied or not
063: * @return the size of balance entries
064: */
065: public Iterator findBalance(Map fieldValues, boolean isConsolidated);
066:
067: /**
068: * This method finds the summary records of balance entries according to input fields and values
069: *
070: * @param fieldValues the input fields and values
071: * @param isConsolidated consolidation option is applied or not
072: * @return the summary records of balance entries
073: */
074: public Integer getBalanceRecordCount(Map fieldValues,
075: boolean isConsolidated);
076:
077: /**
078: * find a ledger balance from the given ledger balance collection with the given transaction information
079: *
080: * @param ledgerBalanceCollection the given ledger balance collection
081: * @param transaction the given transaction information
082: * @param keyList the given list of keys that need to be compared
083: * @return a matching ledger balance from the given ledger balance
084: */
085: public <T extends LedgerBalance> T findLedgerBalance(
086: Collection<T> ledgerBalanceCollection,
087: LaborTransaction transaction, List<String> keyList);
088:
089: /**
090: * find a ledger balance from the given ledger balance collection with the given transaction information
091: *
092: * @param ledgerBalanceCollection the given ledger balance collection
093: * @param transaction the given transaction information
094: * @return a matching ledger balance from the given ledger balance
095: */
096: public <T extends LedgerBalance> T findLedgerBalance(
097: Collection<T> ledgerBalanceCollection,
098: LaborTransaction transaction);
099:
100: /**
101: * convert the given transaction information into a ledger balance and add it into the given ledger balance collection with
102: *
103: * @param ledgerBalanceCollection the given ledger balance collection
104: * @param transaction the given transaction information
105: * @return the ledger balance that has been added; otherwise, null;
106: */
107: public LedgerBalance addLedgerBalance(
108: Collection<LedgerBalance> ledgerBalanceCollection,
109: LaborTransaction transaction);
110:
111: /**
112: * update the given ledger balance with the given transaction information
113: *
114: * @param ledgerBalance the given ledger balance
115: * @param transaction the given transaction information
116: */
117: public <T extends LedgerBalance> void updateLedgerBalance(
118: T ledgerBalance, LaborTransaction transaction);
119:
120: /**
121: * find the funding by employee
122: *
123: * @param fieldValues the given field values
124: * @return the funding by employee
125: */
126: public List<EmployeeFunding> findEmployeeFunding(Map fieldValues,
127: boolean isConsolidated);
128:
129: /**
130: * find the employee funding with the corresponding CSF trakers
131: *
132: * @param fieldValues the given field values
133: * @return the employee funding with the corresponding CSF trakers
134: */
135: public List<EmployeeFunding> findEmployeeFundingWithCSFTracker(
136: Map fieldValues, boolean isConsolidated);
137:
138: /**
139: * find the summary of the ledger balances for the given fiscal year and balance types
140: *
141: * @param fiscalYear the given fiscal year
142: * @param balanceTypes the given balance type codes
143: * @return the ledger balances for the given fiscal year and balance types
144: */
145: public List<LaborBalanceSummary> findBalanceSummary(
146: Integer fiscalYear, Collection<String> balanceTypes);
147:
148: /**
149: * save the given ledger balance into the underlying data store
150: *
151: * @param ledgerBalance the given ledger balance
152: */
153: public void save(LedgerBalance ledgerBalance);
154:
155: /**
156: * find the accounts (chart of accounts code + account number) in the given fund groups
157: *
158: * @param fiscalYear the given fiscal year
159: * @param fieldValues the input fields and values
160: * @param subFundGroupCodes the given list of qualified sub fund group codes
161: * @param fundGroupCodes the given list of qualified group codes
162: * @return the accounts (chart of accounts code + account number) in the given fund groups
163: */
164: public List<List<String>> findAccountsInFundGroups(
165: Integer fiscalYear, Map<String, String> fieldValues,
166: List<String> subFundGroupCodes, List<String> fundGroupCodes);
167: }
|