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