001/* 002 * Copyright 2007 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 */ 016package org.kuali.ole.module.purap.document.dataaccess; 017 018import org.kuali.ole.module.purap.businessobject.AutoClosePurchaseOrderView; 019import org.kuali.ole.module.purap.document.PurchaseOrderDocument; 020 021import java.util.List; 022 023 024/** 025 * Purchase Order DAO Interface. 026 */ 027public interface PurchaseOrderDao { 028 029 public Integer getPurchaseOrderIdForCurrentPurchaseOrderByRelatedDocId(Integer accountsPayablePurchasingDocumentLinkIdentifier); 030 031 public PurchaseOrderDocument getCurrentPurchaseOrder(Integer id); 032 033 /** 034 * Retrieves the Purchase Order Document's document number using the purapDocumentIdentifier as criteria 035 * 036 * @param id - purapDocument Identifier 037 * @return - the document number of the purchase order found or null if no purchase order found 038 */ 039 public String getDocumentNumberForPurchaseOrderId(Integer id); 040 041 /** 042 * Retrieves the current Purchase Order Document's document number by the purapDocumentIdentifier. 043 * 044 * @param id - purapDocument Identifier 045 * @return - the document number of the purchase order found or null if no purchase order found 046 */ 047 public String getDocumentNumberForCurrentPurchaseOrder(Integer id); 048 049 /** 050 * Retrieves the oldest purchase order's (defined by the one having the smallest document number) document number. 051 * 052 * @param id - the purapDocumentIdentifier. 053 * @return - the document numbers of the purchase order found or null if none found 054 */ 055 public String getOldestPurchaseOrderDocumentNumber(Integer id); 056 057 /** 058 * Determines if the purchase order item exists on the current purchase order. 059 * 060 * @param poItemLineNumber 061 * @param docNumber 062 * @return 063 */ 064 public boolean itemExistsOnPurchaseOrder(Integer poItemLineNumber, String docNumber); 065 066 /** 067 * This method gets all the PurchaseOrderView objects that relate to POs 068 * with no recurring payment type, status of 'OPEN', and total encumbrance 069 * of 0 that do not have any of the excluded vendor choice codes. 070 * 071 * @param excludedVendorChoiceCodes - list of strings of excluded vendor choice codes 072 * @return List of PurchaseOrderAutoClose objects 073 */ 074 public List<AutoClosePurchaseOrderView> getAllOpenPurchaseOrders(List<String> excludedVendorChoiceCodes); 075 076 /** 077 * This method gets all the PurchaseOrderView objects that relate to POs 078 * with no recurring payment type, status of 'OPEN', and total encumbrance 079 * of 0 that do not have any of the excluded vendor choice codes. 080 * 081 * @param excludedVendorChoiceCodes - list of strings of excluded vendor choice codes 082 * @param poCloseFromDate - start date 083 * @param poCloseToDate - end date 084 * @return List of PurchaseOrderAutoClose objects 085 */ 086 public List<AutoClosePurchaseOrderView> getAllOpenPurchaseOrders(List<String> excludedVendorChoiceCodes, java.sql.Date poCloseFromDate, java.sql.Date poCloseToDate); 087 088 089 /** 090 * This method gets all the PurchaseOrderView objects that relate to POs 091 * with a recurring payment type, status of 'OPEN', and that do not have any 092 * of the excluded vendor choice codes. 093 * 094 * @param excludedVendorChoiceCodes - list of strings of excluded vendor choice codes 095 * @return List of PurchaseOrderAutoClose objects 096 */ 097 public List<AutoClosePurchaseOrderView> getAutoCloseRecurringPurchaseOrders(List<String> excludedVendorChoiceCodes); 098 099 /** 100 * This method gets all the Purchase orders that are waiting for faxing 101 * 102 * @return List of POs 103 */ 104 public List<PurchaseOrderDocument> getPendingPurchaseOrdersForFaxing(); 105 106 public void deleteFromWorkflowItem(String documentNumber); 107}