001: /*
002: * Copyright 2006-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.gl.service;
017:
018: import java.util.Iterator;
019: import java.util.List;
020: import java.util.Map;
021:
022: import org.kuali.module.chart.bo.Account;
023: import org.kuali.module.gl.bo.Balance;
024:
025: /**
026: * An interface which declares methods needed for using Balance
027: */
028: public interface BalanceService {
029: /**
030: * Save. Like. OK. You know. Save a balance? You know? That's what this method should do. Yeah. It should save a balance. In the DB and stuff.
031: *
032: * @param b the balance to, like, totally save
033: */
034: public void save(Balance b);
035:
036: /**
037: *
038: * This method...
039: * @param account
040: * @return
041: */
042: public boolean hasAssetLiabilityFundBalanceBalances(Account account);
043:
044: /**
045: *
046: * This method...
047: * @param account
048: * @return
049: */
050: public boolean fundBalanceWillNetToZero(Account account);
051:
052: /**
053: *
054: * This method...
055: * @param account
056: * @return
057: */
058: public boolean hasEncumbrancesOrBaseBudgets(Account account);
059:
060: /**
061: *
062: * This method...
063: * @param account
064: * @return
065: */
066: public boolean beginningBalanceLoaded(Account account);
067:
068: /**
069: *
070: * This method...
071: * @param account
072: * @return
073: */
074: public boolean hasAssetLiabilityOrFundBalance(Account account);
075:
076: /**
077: * Returns all of the balances for a given fiscal year.
078: *
079: * @param fiscalYear the fiscal year to find balances for
080: * @return an Iterator over all balances for a given year
081: */
082: public Iterator<Balance> findBalancesForFiscalYear(
083: Integer fiscalYear);
084:
085: /**
086: * This method finds the summary records of balance entries according to input fields an values
087: *
088: * @param fieldValues the input fields an values
089: * @param isConsolidated consolidation option is applied or not
090: * @return the summary records of balance entries
091: */
092: public Iterator findCashBalance(Map fieldValues,
093: boolean isConsolidated);
094:
095: /**
096: * This method gets the size of cash balance entries according to input fields and values
097: *
098: * @param fieldValues the input fields and values
099: * @param isConsolidated consolidation option is applied or not
100: * @return the count of cash balance entries
101: */
102: public Integer getCashBalanceRecordCount(Map fieldValues,
103: boolean isConsolidated);
104:
105: /**
106: * This method gets the size of balance entries according to input fields and values
107: *
108: * @param fieldValues the input fields and values
109: * @param isConsolidated consolidation option is applied or not
110: * @return the size of balance entries
111: */
112: public Iterator findBalance(Map fieldValues, boolean isConsolidated);
113:
114: /**
115: * This method finds the summary records of balance entries according to input fields and values
116: *
117: * @param fieldValues the input fields and values
118: * @param isConsolidated consolidation option is applied or not
119: * @return the summary records of balance entries
120: */
121: public Integer getBalanceRecordCount(Map fieldValues,
122: boolean isConsolidated);
123:
124: /**
125: * Purge the sufficient funds balance table by year/chart
126: *
127: * @param chart the chart purged balances should have
128: * @param year the fiscal year purged balances should have
129: */
130: public void purgeYearByChart(String chart, int year);
131:
132: /**
133: * Get the GL Balance summary for the GL Summary report
134: *
135: * @param universityFiscalYear
136: * @param balanceTypeCodes
137: * @return a list of summarized GL balances
138: */
139: public List getGlSummary(int universityFiscalYear,
140: List<String> balanceTypeCodes);
141:
142: /**
143: * This method returns the total count of balances for a fiscal year
144: *
145: * @param year fiscal year to check
146: * @return the count of balances
147: */
148: public int countBalancesForFiscalYear(Integer year);
149:
150: /**
151: * This method returns all of the balances specifically for the nominal activity closing job
152: *
153: * @param year year to find balances for
154: * @return an Iterator of nominal activity balances
155: */
156: public Iterator<Balance> findNominalActivityBalancesForFiscalYear(
157: Integer year);
158:
159: /**
160: * Returns all the balances specifically to be processed by the balance forwards job for the "general" rule
161: * @param year the fiscal year to find balances for
162: * @return an Iterator of balances to process for the general balance forward process
163: */
164: public Iterator<Balance> findGeneralBalancesToForwardForFiscalYear(
165: Integer year);
166:
167: /**
168: * Returns all the balances to be forwarded for the "cumulative" rule
169: * @param year the fiscal year to find balances for
170: * @return an Iterator of balances to process for the cumulative/active balance forward process
171: */
172: public Iterator<Balance> findCumulativeBalancesToForwardForFiscalYear(
173: Integer year);
174:
175: /**
176: * Returns all of the balances to be forwarded for the organization reversion process
177: *
178: * @param year the year of balances to find
179: * @param endOfYear whether the organization reversion process is running end of year (before the fiscal year change over) or
180: * beginning of year (after the fiscal year change over)
181: * @return an iterator of balances to put through the strenuous organization reversion process
182: */
183: public Iterator<Balance> findOrganizationReversionBalancesForFiscalYear(
184: Integer year, boolean endOfYear);
185: }
|