1 /* 2 * Copyright 2006 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.kuali.ole.gl.service; 17 18 import java.util.Iterator; 19 import java.util.List; 20 import java.util.Map; 21 22 import org.kuali.ole.coa.businessobject.Account; 23 import org.kuali.ole.gl.businessobject.Balance; 24 import org.kuali.ole.gl.businessobject.GlSummary; 25 26 /** 27 * An interface which declares methods needed for using Balance 28 */ 29 public interface BalanceService { 30 31 /** 32 * This method... 33 * 34 * @param account 35 * @return 36 */ 37 public boolean hasAssetLiabilityFundBalanceBalances(Account account); 38 39 /** 40 * This method... 41 * 42 * @param account 43 * @return 44 */ 45 public boolean fundBalanceWillNetToZero(Account account); 46 47 /** 48 * This method... 49 * 50 * @param account 51 * @return 52 */ 53 public boolean hasEncumbrancesOrBaseBudgets(Account account); 54 55 /** 56 * This method... 57 * 58 * @param account 59 * @return 60 */ 61 public boolean beginningBalanceLoaded(Account account); 62 63 /** 64 * This method... 65 * 66 * @param account 67 * @return 68 */ 69 public boolean hasAssetLiabilityOrFundBalance(Account account); 70 71 /** 72 * Returns all of the balances for a given fiscal year. 73 * 74 * @param fiscalYear the fiscal year to find balances for 75 * @return an Iterator over all balances for a given year 76 */ 77 public Iterator<Balance> findBalancesForFiscalYear(Integer fiscalYear); 78 79 /** 80 * This method finds the summary records of balance entries according to input fields an values. The results will be limited to 81 * the system lookup results limit. 82 * 83 * @param fieldValues the input fields an values 84 * @param isConsolidated consolidation option is applied or not 85 * @return the summary records of balance entries 86 */ 87 public Iterator lookupCashBalance(Map fieldValues, boolean isConsolidated); 88 89 /** 90 * This method gets the size of cash balance entries according to input fields and values 91 * 92 * @param fieldValues the input fields and values 93 * @param isConsolidated consolidation option is applied or not 94 * @return the count of cash balance entries 95 */ 96 public Integer getCashBalanceRecordCount(Map fieldValues, boolean isConsolidated); 97 98 /** 99 * This method gets the size of balance entries according to input fields and values 100 * 101 * @param fieldValues the input fields and values 102 * @param isConsolidated consolidation option is applied or not 103 * @return the size of balance entries 104 */ 105 public Iterator findBalance(Map fieldValues, boolean isConsolidated); 106 107 /** 108 * This method finds the summary records of balance entries according to input fields and values 109 * 110 * @param fieldValues the input fields and values 111 * @param isConsolidated consolidation option is applied or not 112 * @return the summary records of balance entries 113 */ 114 public Integer getBalanceRecordCount(Map fieldValues, boolean isConsolidated); 115 116 /** 117 * Purge the sufficient funds balance table by year/chart 118 * 119 * @param chart the chart purged balances should have 120 * @param year the fiscal year purged balances should have 121 */ 122 public void purgeYearByChart(String chart, int year); 123 124 /** 125 * Get the GL Balance summary for the GL Summary report 126 * 127 * @param universityFiscalYear 128 * @param balanceTypeCodes 129 * @return a list of summarized GL balances 130 */ 131 public List<GlSummary> getGlSummary(int universityFiscalYear, List<String> balanceTypeCodes); 132 133 /** 134 * This method returns the total count of balances for a fiscal year 135 * 136 * @param year fiscal year to check 137 * @return the count of balances 138 */ 139 public int countBalancesForFiscalYear(Integer year); 140 141 /** 142 * This method returns all of the balances specifically for the nominal activity closing job 143 * 144 * @param year year to find balances for 145 * @return an Iterator of nominal activity balances 146 */ 147 public Iterator<Balance> findNominalActivityBalancesForFiscalYear(Integer year); 148 149 /** 150 * Returns all the balances specifically to be processed by the balance forwards job for the "general" rule 151 * 152 * @param year the fiscal year to find balances for 153 * @return an Iterator of balances to process for the general balance forward process 154 */ 155 public Iterator<Balance> findGeneralBalancesToForwardForFiscalYear(Integer year); 156 157 /** 158 * Returns all the balances to be forwarded for the "cumulative" rule 159 * 160 * @param year the fiscal year to find balances for 161 * @return an Iterator of balances to process for the cumulative/active balance forward process 162 */ 163 public Iterator<Balance> findCumulativeBalancesToForwardForFiscalYear(Integer year); 164 165 /** 166 * Returns all of the balances to be forwarded for the organization reversion process 167 * 168 * @param year the year of balances to find 169 * @param endOfYear whether the organization reversion process is running end of year (before the fiscal year change over) or 170 * beginning of year (after the fiscal year change over) 171 * @return an iterator of balances to put through the strenuous organization reversion process 172 */ 173 public Iterator<Balance> findOrganizationReversionBalancesForFiscalYear(Integer year, boolean endOfYear); 174 }