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.Map;
020
021 import org.kuali.kfs.module.ld.businessobject.AccountStatusCurrentFunds;
022 import org.kuali.kfs.module.ld.businessobject.LedgerBalance;
023 import org.kuali.kfs.module.ld.businessobject.LedgerEntry;
024 import org.kuali.rice.kns.web.ui.Field;
025 import org.kuali.rice.kns.web.ui.Row;
026
027 /**
028 * The LaborInquiryOptionsService interface provides hooks for Pending Ledger and Consilidation options for balance inquiries.
029 */
030 public interface LaborInquiryOptionsService {
031
032 /**
033 * The expected name of the consolidation option field name
034 *
035 * @return String
036 */
037 public String getConsolidationFieldName();
038
039 /**
040 * Examine a collection of <code>{@link Row}</code> instances for the consolidation field
041 *
042 * @param rows
043 * @return Field
044 */
045 public Field getConsolidationField(Collection<Row> rows);
046
047 /**
048 * Get the current state of the consolidation option
049 *
050 * @return String
051 */
052 public String getConsolidationOption(Map fieldValues);
053
054 /**
055 * This method tests if the user selects to see the details or consolidated results
056 *
057 * @param fieldValues the map containing the search fields and values
058 * @param rows
059 * @return true if consolidation is selected and subaccount is not specified
060 */
061 public boolean isConsolidationSelected(Map fieldValues, Collection<Row> rows);
062
063 /**
064 * This method tests if the user selects to see the details or consolidated results
065 *
066 * @param fieldValues the map containing the search fields and values
067 * @return true if consolidation is selected and subaccount is not specified
068 */
069 public boolean isConsolidationSelected(Map fieldValues);
070
071 /**
072 * update a given balance collection with the pending entry obtained from the given field values and pending entry option
073 *
074 * @param balanceCollection the given ledger balance collection
075 * @param fieldValues the given field values
076 * @param pendingEntryOption the given pending entry option: all, approved or none
077 * @param isConsolidated indicate if the collection balances have been consolidated
078 * @see org.kuali.kfs.module.ld.businessobject.LedgerBalance
079 */
080 public void updateLedgerBalanceByPendingLedgerEntry(Collection<LedgerBalance> balanceCollection, Map fieldValues, String pendingEntryOption, boolean isConsolidated);
081
082 /**
083 * update a given balance collection with the pending entry obtained from the given field values and pending entry option
084 *
085 * @param balanceCollection the given ledger balance collection
086 * @param fieldValues the given field values
087 * @param pendingEntryOption the given pending entry option: all, approved or none
088 * @param isConsolidated indicate if the collection balances have been consolidated
089 * @see org.kuali.kfs.module.ld.businessobject.LedgerBalance
090 */
091 public void updateCurrentFundsByPendingLedgerEntry(Collection<AccountStatusCurrentFunds> balanceCollection, Map fieldValues, String pendingEntryOption, boolean isConsolidated);
092
093 /**
094 * update a given ledger entry collection with the pending entry obtained from the given field values and pending entry option
095 *
096 * @param entryCollection the given ledger entry collection
097 * @param fieldValues the given field values
098 * @param pendingEntryOption the given pending entry option: all, approved or none
099 * @see org.kuali.kfs.module.ld.businessobject.LedgerEntry
100 */
101 public void updateLedgerEntryByPendingLedgerEntry(Collection<LedgerEntry> entryCollection, Map fieldValues, String pendingEntryOption);
102
103 /**
104 * Get the Pending Entry Option selected
105 *
106 * @param fieldValues
107 * @return String
108 */
109 public String getSelectedPendingEntryOption(Map fieldValues);
110 }