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.sql.Date; 019 import java.util.Collection; 020 import java.util.Iterator; 021 import java.util.List; 022 023 import org.kuali.kfs.module.purap.document.PaymentRequestDocument; 024 import org.kuali.kfs.module.purap.util.VendorGroupingHelper; 025 import org.kuali.rice.kns.util.KualiDecimal; 026 027 /** 028 * Payment Request DAO Interface. 029 */ 030 public interface PaymentRequestDao { 031 032 /** 033 * Get all the payment requests that need to be extracted that match a credit memo. 034 * 035 * @param campusCode - limit results to a single chart 036 * @param paymentRequestIdentifier - Payment Request Identifier (can be null) 037 * @param purchaseOrderIdentifier - PO Identifier (can be null) 038 * @param vendorHeaderGeneratedIdentifier - Vendor Header ID 039 * @param vendorDetailAssignedIdentifier - Vendor Detail ID 040 * @return - list of payment requests that need to be extracted 041 */ 042 public Iterator<PaymentRequestDocument> getPaymentRequestsToExtract(String campusCode, Integer paymentRequestIdentifier, Integer purchaseOrderIdentifier, Integer vendorHeaderGeneratedIdentifier, Integer vendorDetailAssignedIdentifier); 043 044 /** 045 * Get all the payment requests that need to be extracted that match a credit memo. 046 * 047 * @param campusCode - limit results to a single chart 048 * @param vendor - Vendor Header ID, Vendor Detail ID, Country, Zip Code 049 * @param onOrBeforePaymentRequestPayDate only payment requests with a pay date on or before this value will be returned in the iterator 050 * @return - list of payment requests that need to be extracted 051 */ 052 public Collection<PaymentRequestDocument> getPaymentRequestsToExtractForVendor(String campusCode, VendorGroupingHelper vendor, Date onOrBeforePaymentRequestPayDate); 053 054 /** 055 * Get all the payment requests that need to be extracted to PDP. 056 * 057 * @param onlySpecialPayments - true only include special payments, False - include all 058 * @param chartCode - if not null, limit results to a single chart 059 * @return - Collection of payment requests 060 */ 061 public Collection<PaymentRequestDocument> getPaymentRequestsToExtract(boolean onlySpecialPayments, String chartCode, Date onOrBeforePaymentRequestPayDate); 062 063 /** 064 * Get all the payment requests that are marked immediate that need to be extracted to PDP. 065 * 066 * @param chartCode - chart of accounts code 067 * @return - Collection of payment requests 068 */ 069 public Collection<PaymentRequestDocument> getImmediatePaymentRequestsToExtract(String chartCode); 070 071 /** 072 * Get all payment request documents that are eligible for auto-approval. Whether or not a document is eligible for 073 * auto-approval is determined according to whether or not the document total is below a pre-determined minimum amount. This 074 * amount is derived from the accounts, charts and/or organizations associated with a given document. If no minimum amount can 075 * be determined from chart associations a default minimum specified as a system parameter is used to determine the minimum 076 * amount threshold. 077 * 078 * @return - an Iterator over all payment request documents eligible for automatic approval 079 */ 080 public List<PaymentRequestDocument> getEligibleForAutoApproval(); 081 082 /** 083 * Get a payment request document number by id. 084 * 085 * @param id - PaymentRequest Id 086 * @return - PaymentRequest or null if not found 087 */ 088 public String getDocumentNumberByPaymentRequestId(Integer id); 089 090 /** 091 * Retrieves a list of document numbers by purchase order id. 092 * 093 * @param id - purchase order id 094 * @return - list of document numbers 095 */ 096 public List<String> getDocumentNumbersByPurchaseOrderId(Integer id); 097 098 /** 099 * Retrieves a list of Payment Requests with the given vendor id and invoice number. 100 * 101 * @param vendorHeaderGeneratedId - header id of the vendor id 102 * @param vendorDetailAssignedId - detail id of the vendor id 103 * @param invoiceNumber - invoice number as entered by AP 104 * @return - List of Payment Requests. 105 */ 106 public List getActivePaymentRequestsByVendorNumberInvoiceNumber(Integer vendorHeaderGeneratedId, Integer vendorDetailAssignedId, String invoiceNumber); 107 108 /** 109 * Retrieves a list of Payment Requests with the given vendor id and invoice number. 110 * 111 * @param vendorHeaderGeneratedId - header id of the vendor id 112 * @param vendorDetailAssignedId - detail id of the vendor id 113 * @return - List of Payment Requests. 114 */ 115 public List getActivePaymentRequestsByVendorNumber(Integer vendorHeaderGeneratedId, Integer vendorDetailAssignedId); 116 117 /** 118 * Retrieves a list of Payment Requests with the given PO Id, invoice amount, and invoice date. 119 * 120 * @param poId - purchase order ID 121 * @param invoiceAmount - amount of the invoice as entered by AP 122 * @param invoiceDate - date of the invoice as entered by AP 123 * @return - List of Pay Reqs. 124 */ 125 public List getActivePaymentRequestsByPOIdInvoiceAmountInvoiceDate(Integer poId, KualiDecimal invoiceAmount, Date invoiceDate); 126 127 /** 128 * Retrieves a list of potentially active payment requests for a purchase order by 129 * status code. Active being defined as being enroute and before final. The issue 130 * is that a status of vendor_tax_review may not mean that it's in review, but could be 131 * in final (as there isn't a final status code for payment request). Workflow status 132 * must be checked further after retrieval. 133 * 134 * @param purchaseOrderId 135 * @return 136 */ 137 public List<String> getActivePaymentRequestDocumentNumbersForPurchaseOrder(Integer purchaseOrderId); 138 139 /** 140 * Get all payment request which are waiting in receiving status queue 141 * @return 142 */ 143 public List<PaymentRequestDocument> getPaymentRequestInReceivingStatus(); 144 145 }