1 /* 2 * Copyright 2007 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.kuali.ole.module.purap.document.dataaccess; 17 18 import org.kuali.ole.module.purap.document.VendorCreditMemoDocument; 19 import org.kuali.ole.module.purap.util.VendorGroupingHelper; 20 import org.kuali.rice.core.api.util.type.KualiDecimal; 21 22 import java.sql.Date; 23 import java.util.Collection; 24 import java.util.List; 25 26 /** 27 * Credit Memo DAO Interface. Defines DB access methods that a CreditMemoDaoImpl must implement. 28 */ 29 public interface CreditMemoDao { 30 31 /** 32 * Get all the credit memos that need to be extracted 33 * 34 * @param chartCode - if not null, limit results to a single chart 35 * @return - Iterator of credit memos 36 */ 37 public List<VendorCreditMemoDocument> getCreditMemosToExtract(String chartCode); 38 39 /** 40 * Get all the credit memos that need to be extracted for a particular vendor record. 41 * 42 * @param chartCode - if not null, limit results to a single chart 43 * @param vendorHeaderGeneratedIdentifier 44 * 45 * @param vendorDetailAssignedIdentifier 46 * @return - Iterator of credit memos 47 */ 48 public Collection<VendorCreditMemoDocument> getCreditMemosToExtractByVendor(String chartCode, VendorGroupingHelper vendor); 49 50 /** 51 * This method tests for a duplicate entry of a credit memo by the combination of vendorNumber HeaderId, vendorNumber and 52 * creditMemoNumber. This method accepts the three values as arguments, and returns a boolean, describing whether a duplicate 53 * exists in the system or not. 54 * 55 * @param vendorNumberHeaderId - vendor number header id 56 * @param vendorNumber - the composite two-part vendorNumber (headerId-detailId) 57 * @param creditMemoNumber - the vendor-supplied creditMemoNumber 58 * @return boolean - true if a match exists in the db, false if not 59 */ 60 public boolean duplicateExists(Integer vendorNumberHeaderId, Integer vendorNumberDetailId, String creditMemoNumber); 61 62 /** 63 * This method tests for a duplicate entry of a credit memo by the combination of vendor number header id, vendor detail id, 64 * date and amount. This method accepts the values as arguments, and returns a boolean, describing whether a duplicate exists in 65 * the system or not. 66 * 67 * @param vendorNumberHeaderId 68 * @param vendorNumberDetailId 69 * @param date - date of transaction 70 * @param amount - amount of transaction 71 * @return boolean - true if a match exists in the db, false if not 72 */ 73 public boolean duplicateExists(Integer vendorNumberHeaderId, Integer vendorNumberDetailId, Date date, KualiDecimal amount); 74 75 /** 76 * This method returns a credit memo document number by id. 77 * 78 * @param id - credit memo id 79 * @return - document number 80 */ 81 public String getDocumentNumberByCreditMemoId(Integer id); 82 83 /** 84 * Retrieves a list of potentially active credit memos for a purchase order by 85 * status code. Active being defined as being enroute and before final. The issue 86 * is that a status of vendor_tax_review may not mean that it's in review, but could be 87 * in final (as there isn't a final status code for payment request). Workflow status 88 * must be checked further after retrieval. 89 * 90 * @param purchaseOrderId 91 * @return 92 */ 93 public List<String> getActiveCreditMemoDocumentNumbersForPurchaseOrder(Integer purchaseOrderId); 94 }