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 /* 017 * Created on Mar 7, 2006 018 * 019 */ 020 package org.kuali.kfs.module.purap.service; 021 022 import java.util.Map; 023 024 import org.kuali.kfs.module.purap.businessobject.ElectronicInvoice; 025 import org.kuali.kfs.module.purap.businessobject.ElectronicInvoiceItem; 026 import org.kuali.kfs.module.purap.businessobject.ElectronicInvoiceOrder; 027 028 public interface ElectronicInvoiceMappingService { 029 030 // default values 031 public static String DEFAULT_BELOW_LINE_ITEM_DESCRIPTION = "Electronically entered amount"; 032 // ELECTRONIC INVOICE SHIPPING DESCRIPTION 033 public static String E_INVOICE_SHIPPING_DESCRIPTION = "Shipping"; 034 035 036 // role id of the address we use as the Ship To address 037 public static String CXML_ADDRESS_SHIP_TO_ROLE_ID = "shipTo"; 038 public static String CXML_ADDRESS_BILL_TO_ROLE_ID = "billTo"; 039 public static String CXML_ADDRESS_REMIT_TO_ROLE_ID = "remitTo"; 040 041 // name of our default address name we use (null for first available) 042 public static String CXML_ADDRESS_SHIP_TO_NAME = null; 043 public static String CXML_ADDRESS_BILL_TO_NAME = null; 044 public static String CXML_ADDRESS_REMIT_TO_NAME = null; 045 046 /* 047 * These mappings link E-Invoice CXML item types to PREQ Item Types 048 * 049 * If the PREQ ITEM TYPE is null then we do not accept or care 050 * about these items 051 */ 052 public static String ITEM_TYPE_RETURN_VALUE_UNACCEPTED = ""; 053 054 // ELECTRONIC INVOICE CXML US DOLLAR CODE 055 public static String[] CXML_VALID_CURRENCY_CODES = {"USD"}; 056 057 // ELECTRONIC INVOICE CXML OPERATION CODE 058 public static String[] CXML_VALID_OPERATION_CODES = {"new"}; 059 060 // ELECTRONIC INVOICE CXML PURPOSE CODE 061 public static String[] CXML_VALID_PURPOSE_CODES = {"standard"}; 062 063 public Map getDefaultItemMappingMap(); 064 065 public Map getItemMappingMap(Integer vendorHeaderId, Integer vendorDetailId); 066 067 public boolean acceptAmountType(String cxmlAmountType) ; 068 069 /** 070 * This method defines which field out of the ElectronicInvoiceOrder that the 071 * purchase order number is coming in as 072 * 073 * @param invoiceOrder ElectronicInvoiceOrder we need to get the PO ID from 074 * @return the String value of the purchase order id 075 */ 076 public String getInvoicePurchaseOrderID(ElectronicInvoiceOrder invoiceOrder); 077 078 /** 079 * This method defines which field out of the ElectronicInvoiceItem that the 080 * catalog number is coming in as 081 * 082 * @param eii ElectronicInvoiceItem we need to get the catalog number from 083 * @return catalog number value 084 */ 085 public String getCatalogNumber(ElectronicInvoiceItem item); 086 087 /** 088 * This method defines which field out of the ElectronicInvoice that the 089 * customer number field is coming in as 090 * 091 * @param ei ElectronicInvoice we need to get the customer number from 092 * @return customer number value 093 */ 094 public String getInvoiceCustomerNumber(ElectronicInvoice ei); 095 096 /** 097 * This method contains the mapping check for valid Currency Code(s) 098 */ 099 public String checkCodeForValidCurrency(String code); 100 101 /** 102 * This method contains the mapping check for valid Currency Code(s) 103 */ 104 public boolean isCodeValidCurrency(String code); 105 }