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.List;
019
020 import org.kuali.kfs.coa.businessobject.ObjectCode;
021 import org.kuali.kfs.gl.businessobject.Transaction;
022 import org.kuali.kfs.sys.businessobject.SufficientFundsItem;
023 import org.kuali.kfs.sys.document.GeneralLedgerPostingDocument;
024
025
026 /**
027 * Service used for manipulating disbursement voucher cover sheets.
028 */
029 public interface SufficientFundsService {
030
031 /**
032 * Checks for sufficient funds on a single document
033 *
034 * @param document document to check
035 * @return Empty List if has sufficient funds for all accounts, List of SufficientFundsItem if not
036 */
037 public List<SufficientFundsItem> checkSufficientFunds(GeneralLedgerPostingDocument document);
038
039 /**
040 * Checks for sufficient funds on a list of transactions
041 *
042 * @param transactions list of transactions
043 * @return Empty List if has sufficient funds for all accounts, List of SufficientFundsItem if not
044 */
045 public List<SufficientFundsItem> checkSufficientFunds(List<? extends Transaction> transactions);
046
047 /**
048 * This operation derives the acct_sf_finobj_cd which is used to populate the General Ledger Pending entry table, so that later
049 * we can do Suff Fund checking against that entry
050 *
051 * @param financialObject the object code being checked against
052 * @param accountSufficientFundsCode the kind of sufficient funds checking turned on in this system
053 * @return the object code that should be used for the sufficient funds inquiry, or a blank String
054 */
055 public String getSufficientFundsObjectCode(ObjectCode financialObject, String accountSufficientFundsCode);
056
057 /**
058 * Purge the sufficient funds balance table by year/chart
059 *
060 * @param chart chart of sufficient fund balances to purge
061 * @param year fiscal year of sufficent fund balances to purge
062 */
063 public void purgeYearByChart(String chart, int year);
064 }