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.module.ld.service;
017
018 import java.util.Collection;
019 import java.util.Iterator;
020 import java.util.Map;
021
022 import org.kuali.kfs.module.ld.businessobject.LaborLedgerPendingEntry;
023 import org.kuali.kfs.module.ld.document.LaborLedgerPostingDocument;
024
025 /**
026 * Defines methods that must be implemented by classes providing a LaborLedgerPendingEntryServiceImpl.
027 */
028 public interface LaborLedgerPendingEntryService {
029
030 /**
031 * Does the given account have any labor ledger entries? It is necessary to check this before closing an account.
032 *
033 * @param account
034 * @return
035 */
036 public boolean hasPendingLaborLedgerEntry(String chartOfAccountsCode, String accountNumber);
037
038 /**
039 * determine if there is any pending entry that has not been processed for the given criteria
040 *
041 * @param fieldValues the given search criteria
042 * @return true if there is one or more pending entries that have not been processed for the given criteria; otherwise, false
043 */
044 public boolean hasPendingLaborLedgerEntry(Map fieldValues);
045
046 /**
047 * This method generates labor ledger pending entries.
048 *
049 * @param document
050 * @return
051 */
052 public boolean generateLaborLedgerPendingEntries(LaborLedgerPostingDocument document);
053
054 /**
055 * Get all entries that have been approved but still in pending entry queue
056 *
057 * @return all approved pending entries
058 */
059 public Iterator<LaborLedgerPendingEntry> findApprovedPendingLedgerEntries();
060
061 /**
062 * Delete the pending entries with the given financial document approved code
063 *
064 * @param approvedCode
065 */
066 public void deleteByFinancialDocumentApprovedCode(String financialDocumentApprovedCode);
067
068 /**
069 * This method checks for pending ledger entries that match the current balance inquiry
070 *
071 * @param emplid
072 * @return
073 */
074 public Iterator findPendingLedgerEntriesForLedgerBalance(Map fieldValues, boolean isApproved);
075
076 /**
077 * Use fieldValues to create a query for matching records of <code>{@link LaborLedgerPendingEntry}</code> instances
078 *
079 * @param fieldValues properties to match against
080 * @param isApproved Retrieve approved or unapproved entries?
081 */
082 public Collection findPendingEntries(Map fieldValues, boolean isApproved);
083
084 /**
085 * delete pending entries with the given document header id
086 *
087 * @param documentHeaderId
088 */
089 public void delete(String documentHeaderId);
090 }