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.purap.service; 017 018 import org.kuali.kfs.module.purap.document.AccountsPayableDocument; 019 import org.kuali.kfs.module.purap.document.VendorCreditMemoDocument; 020 import org.kuali.kfs.module.purap.document.PaymentRequestDocument; 021 import org.kuali.kfs.module.purap.document.PurchaseOrderDocument; 022 import org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument; 023 import org.kuali.kfs.sys.businessobject.AccountingLine; 024 import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry; 025 026 027 public interface PurapGeneralLedgerService { 028 029 public final static String CREATE_PAYMENT_REQUEST = "create"; 030 public final static String CANCEL_PAYMENT_REQUEST = "cancel"; 031 public final static String MODIFY_PAYMENT_REQUEST = "modify"; 032 public final static boolean CREATE_CREDIT_MEMO = false; 033 public final static boolean CANCEL_CREDIT_MEMO = !CREATE_CREDIT_MEMO; 034 035 /** 036 * Customize the given general ledger entry based on the document type. 037 * 038 * @param purapDocument Document creating entries 039 * @param accountingLine AccountingLine from document used to create the pending entry 040 * @param explicitEntry GeneralLedgerPendingEntry that has been created with account info 041 * @param referenceDocumentNumber Number of the referenced document 042 * @param debitCreditCode String field indicating if the entry is a debit or credit 043 * @param docType Document type creating the pending entries 044 * @param isEncumbrance Boolean to indicate if the entry is an encumbrance 045 */ 046 public void customizeGeneralLedgerPendingEntry(PurchasingAccountsPayableDocument purapDocument, AccountingLine accountingLine, GeneralLedgerPendingEntry explicitEntry, Integer referenceDocumentNumber, String debitCreditCode, String docType, boolean isEncumbrance); 047 048 /** 049 * Generates general ledger pending entries for the creation of a Payment Request 050 * 051 * @param preq PaymentRequestDocument which holds the accounts to create the entries 052 */ 053 public void generateEntriesCreatePaymentRequest(PaymentRequestDocument preq); 054 055 /** 056 * Generates general ledger pending entries for the modification of a Payment Request. No entries will be created if the 057 * calculated change is zero (meaning no change was made). Also, no encumbrance entries will be created. 058 * 059 * @param preq PaymentRequestDocument which holds the accounts to create the entries 060 */ 061 public void generateEntriesModifyPaymentRequest(PaymentRequestDocument preq); 062 063 /** 064 * Generates general ledger pending entries for the creation of a Credit Memo 065 * 066 * @param cm CreditMemoDocument which holds the accounts to create the entries 067 */ 068 public void generateEntriesCreateCreditMemo(VendorCreditMemoDocument cm); 069 070 /** 071 * Generates general ledger pending entries for the cancellation of an Accounts Payable document. 072 * 073 * @param apDocument AccountsPayableDocument which holds the accounts to create the entries for the cancellation 074 */ 075 public void generateEntriesCancelAccountsPayableDocument(AccountsPayableDocument apDocument); 076 077 /** 078 * Generates general ledger pending entries for the amendment of a Purchase Order 079 * 080 * @param po PurchaseOrderDocument which holds the accounts to create the entries 081 */ 082 public void generateEntriesApproveAmendPurchaseOrder(PurchaseOrderDocument po); 083 084 /** 085 * Generates general ledger pending entries for when a Purchase Order is closed which will disencumber all the remaining 086 * encumbrances 087 * 088 * @param po PurchaseOrderDocument which holds the accounts to create the entries 089 */ 090 public void generateEntriesClosePurchaseOrder(PurchaseOrderDocument po); 091 092 /** 093 * Generates general ledger pending entries for when a Purchase Order is reopened which will calculate the funds to be 094 * re-encumbered 095 * 096 * @param po PurchaseOrderDocument which holds the accounts to create the entries 097 */ 098 public void generateEntriesReopenPurchaseOrder(PurchaseOrderDocument po); 099 100 /** 101 * Generates general ledger pending entries for when a Purchase Order is voided 102 * 103 * @param po PurchaseOrderDocument which holds the accounts to create the entries 104 */ 105 public void generateEntriesVoidPurchaseOrder(PurchaseOrderDocument po); 106 107 }