001: /*
002: * Copyright 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.purap.service;
017:
018: import java.util.HashMap;
019:
020: import org.kuali.module.purap.bo.PurApAccountingLineBase;
021: import org.kuali.module.purap.bo.PurchaseOrderItem;
022: import org.kuali.module.purap.document.AccountsPayableDocument;
023: import org.kuali.module.purap.util.ExpiredOrClosedAccountEntry;
024:
025: /**
026: * Contains logic for use by the individual AccountsPayable documents
027: */
028: public interface AccountsPayableService {
029:
030: /**
031: * Generates a list of continuation accounts for expired or closed accounts as well as a list of expired or closed
032: * accounts with no continuation accounts.
033: *
034: * @param document The accounts payable document whose accounts we are trying to retrieve.
035: * @return A HashMap where the keys are the string representations of the chart and account of the
036: * original account and the values are the ExpiredOrClosedAccountEntry.
037: */
038: public HashMap<String, ExpiredOrClosedAccountEntry> getExpiredOrClosedAccountList(
039: AccountsPayableDocument document);
040:
041: /**
042: * Generates a note of where continuation accounts were used and adds them as a note to the document.
043: *
044: * @param document The accounts payable document to which we're adding the notes.
045: * @param expiredOrClosedAccountList The HashMap where the keys are the string representations of the chart and
046: * account of the original account and the values are the ExpiredOrClosedAccountEntry.
047: */
048: public void generateExpiredOrClosedAccountNote(
049: AccountsPayableDocument document,
050: HashMap<String, ExpiredOrClosedAccountEntry> expiredOrClosedAccountList);
051:
052: /**
053: * Adds a warning message to the message list if expired or closed accounts have been used on the document and the
054: * document is not in any of these state: Initiate, In Process or Awaiting Accounts Payable Review and the
055: * current user is a fiscal user.
056: *
057: * @param document The accounts payable document to which we're adding the warning message.
058: */
059: public void generateExpiredOrClosedAccountWarning(
060: AccountsPayableDocument document);
061:
062: /**
063: * Performs the replacement of an expired/closed account with a continuation account.
064: *
065: * @param acctLineBase The accounting line whose chart and account we're going to replace.
066: * @param expiredOrClosedAccountList The HashMap where the keys are the string representations of the chart
067: * and account of the original account and the values are the ExpiredOrClosedAccountEntry.
068: */
069: public void processExpiredOrClosedAccount(
070: PurApAccountingLineBase acctLineBase,
071: HashMap<String, ExpiredOrClosedAccountEntry> expiredOrClosedAccountList);
072:
073: /**
074: * This method cancels a document, it uses DocumentSpecificService to call the actual logic on the PaymentRequestService
075: * or CreditMemoService as appropriate. In certain cases it will also reopen a closed PurchaseOrderDocument
076: *
077: * @param apDocument The accounts payable document to be canceled.
078: * @param currentNodeName The string representing the current node, which we'll need when we
079: * want to update the document status by node. Note: if this is blank it is assumed
080: * the request is not coming from workflow.
081: */
082: public void cancelAccountsPayableDocument(
083: AccountsPayableDocument apDocument, String currentNodeName);
084:
085: /**
086: * Updates the item list based on what's eligible to be payed on purchase order.
087: *
088: * @param apDocument The accounts payable document containing the items to be updated.
089: */
090: public void updateItemList(AccountsPayableDocument apDocument);
091:
092: /**
093: * Determines if item is eligible for payment.
094: *
095: * @param poi The purchase order item whose eligibility for payment is to be determined.
096: * @return boolean true if the item is eligible for payment.
097: */
098: public boolean purchaseOrderItemEligibleForPayment(
099: PurchaseOrderItem poi);
100: }
|