001/*
002 * Copyright 2006 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;
017
018import org.apache.commons.lang.StringUtils;
019import org.kuali.ole.module.purap.businessobject.AvailabilityMatrix;
020import org.kuali.ole.module.purap.businessobject.PurchaseOrderAccount;
021import org.kuali.ole.module.purap.businessobject.PurchaseOrderItem;
022import org.kuali.ole.module.purap.businessobject.PurchaseOrderVendorQuote;
023import org.kuali.ole.module.purap.document.*;
024import org.kuali.ole.sys.OLEConstants;
025import org.kuali.ole.sys.OLEPropertyConstants;
026import org.kuali.rice.core.api.util.type.KualiDecimal;
027
028import java.util.*;
029
030
031/**
032 * Holds constants for PURAP.
033 */
034public class PurapConstants {
035
036    public static final String PURAP_NAMESPACE = "OLE-PURAP";
037
038    public static final KualiDecimal HUNDRED = new KualiDecimal(100);
039
040
041    public static final String B2B_PUNCHBACK_METHOD_TO_CALL = "returnFromShopping";
042
043    public static final String PDP_PURAP_EXTRACT_FILE_NAME = "extr_fr_purap";
044
045    public static final KualiDecimal DOCUMENT_MAX_TOTAL = new KualiDecimal(1000);
046
047    public static final String ORDER_TYPE_FIRM = "Firm, Fixed";
048
049    public static final String ORDER_TYPE_FIRM_MULTIPART = "Firm (multi part)";
050
051    public static final String ORDER_TYPE_APPROVAL = "Approval";
052
053    public static final String ORDER_TYPE_SUBSCRIPTION = "Subscription";
054
055    public static final String ORDER_TYPE_STANDING = "Standing";
056
057    public static final String ORDER_TYPE_MEMBERSHIP = "Membership";
058
059    public static class QuoteTypes {
060        public static final String COMPETITIVE = "COMP";
061        public static final String PRICE_CONFIRMATION = "CONF";
062    }
063
064    public static class QuoteTypeDescriptions {
065        public static final String COMPETITIVE = "Competitive";
066        public static final String PRICE_CONFIRMATION = "Price Confirmation";
067    }
068
069    public static class QuoteTransmitTypes {
070        public static final String PRINT = "PRINT";
071        public static final String FAX = "FAX";
072    }
073
074    public static class QuoteStatusCode {
075        public static final String DELV = "DELV";
076        public static final String FUIP = "FUIP";
077        public static final String IIQ = "IIQ";
078        public static final String LEXP = "LEXP";
079        public static final String MULT = "MULT";
080        public static final String NORS = "NORS";
081        public static final String PTFE = "PTFE";
082        public static final String RECV = "RECV";
083        public static final String RIR = "RIR";
084        public static final String RECL = "RECL";
085        public static final String RNLB = "RNLB";
086        public static final String RNLN = "RNLN";
087        public static final String NOBD = "NOBD";
088        public static final String SQNA = "SQNA";
089        public static final String TINC = "TINC";
090    }
091
092    public static final String NOTE_TAB_WARNING = "noteWarning";
093
094    public static final String QUESTION_INDEX = "questionIndex";
095    public static final String REMOVE_ACCOUNTS_QUESTION = "RemoveAccounts";
096    public static final String CLEAR_COMMODITY_CODES_QUESTION = "ClearCommodityCodes";
097    public static final String QUESTION_ROUTE_DOCUMENT_TO_COMPLETE = "Completing this document will remove it from your Action List.<br/><br/>  Are you sure you want to continue?";
098    public static final String QUESTION_REMOVE_ACCOUNTS = "question.document.purap.removeAccounts";
099    public static final String QUESTION_CLEAR_ALL_COMMODITY_CODES = "question.document.pur.clearCommodityCodes";
100    // TODO - This constant is referenced, but has no corresponding value in ApplicationResources.properties????
101    public static final String CONFIRM_CHANGE_DFLT_RVNG_ADDR = "confirm.change.dflt.rcvng.addr";
102    public static final String CONFIRM_CHANGE_DFLT_RVNG_ADDR_TXT = "Setting this receiving address to be default will unset the current default address. Do you want to proceed?";
103
104    public static final String REQ_REASON_NOT_APO = "Requisition did not become an APO because: ";
105    public static final String REQ_UNABLE_TO_CREATE_NOTE = "Unable to create a note on this document.";
106
107    public static final String TRADE_IN_OBJECT_CODE_FOR_CAPITAL_ASSET_OBJECT_SUB_TYPE = "7070";
108    public static final String TRADE_IN_OBJECT_CODE_FOR_CAPITAL_LEASE_OBJECT_SUB_TYPE = "7099";
109
110    // PDF OLEConstants
111    public static final String IMAGE_TEMP_PATH = "PDF_IMAGE_TEMP_PATH";
112    public static final String PDF_DIRECTORY = "PDF_DIRECTORY";
113    public static final String STATUS_INQUIRY_URL = "PDF_STATUS_INQUIRY_URL";
114    public static final String PURCHASING_DIRECTOR_IMAGE_PREFIX = "PDF_DIRECTOR_IMAGE_PREFIX";
115    public static final String PURCHASING_DIRECTOR_IMAGE_EXTENSION = "PDF_DIRECTOR_IMAGE_EXTENSION";
116    public static final String CONTRACT_MANAGER_IMAGE_PREFIX = "PDF_IMAGE_PREFIX";
117    public static final String CONTRACT_MANAGER_IMAGE_EXTENSION = "PDF_IMAGE_EXTENSION";
118    public static final String LOGO_IMAGE_PREFIX = "PDF_LOGO_IMAGE_PREFIX";
119    public static final String LOGO_IMAGE_EXTENSION = "PDF_LOGO_IMAGE_EXTENSION";
120    public static final String PDF_IMAGES_AVAILABLE_INDICATOR = "PDF_IMAGES_AVAILABLE_IND";
121    public static final String PDF_IMAGE_LOCATION_URL = "PDF_IMAGE_LOCATION_URL";
122
123    public static final String TAX_RECALCULATION_INFO = "TaxRecalculationQuestion";
124    public static final String TAX_RECALCULATION_QUESTION = "The postal code of the delivery address has changed.[br]Selecting \"Yes\" will submit the document without recalculating the taxes.[br]Selecting \"No\" will return you to the document so that the taxes can be recalculated.[br]The \"clear all\" button can be used to clear all tax amounts which will force taxes to be recalculated upon submission.";
125
126    public static class RequisitionStatuses {
127        // Added for updating app doc status for disapproved
128        public static final String APPDOC_IN_PROCESS = "In Process";
129        public static final String APPDOC_CANCELLED = "Cancelled";
130        public static final String APPDOC_CLOSED = "Closed";
131        public static final String APPDOC_AWAIT_FISCAL_REVIEW = "Awaiting Fiscal Officer";
132        public static final String APPDOC_AWAIT_CONTENT_REVIEW = "Awaiting Content Approval";
133        public static final String APPDOC_AWAIT_HAS_ACCOUNTING_LINES = "Awaiting Accounting Lines";
134        public static final String APPDOC_AWAIT_SUB_ACCT_REVIEW = "Awaiting Sub Account";
135        public static final String APPDOC_AWAIT_CHART_REVIEW = "Awaiting Base Org Review";
136        public static final String APPDOC_AWAIT_COMMODITY_CODE_REVIEW = "Awaiting Commodity Code";
137        public static final String APPDOC_AWAIT_SEP_OF_DUTY_REVIEW = "Awaiting Separation of Duties";
138        public static final String APPDOC_AWAIT_CONTRACT_MANAGER_ASSGN = "Awaiting Contract Manager Assignment";
139        public static final String APPDOC_AWAIT_LICENSE_REVIEW = "Awaiting License Review";
140
141        public static final String APPDOC_DAPRVD_CONTENT = "Disapproved Content";
142        public static final String APPDOC_DAPRVD_HAS_ACCOUNTING_LINES = "Disapproved Accounting Lines";
143        public static final String APPDOC_DAPRVD_SUB_ACCT = "Disapproved Sub Account";
144        public static final String APPDOC_DAPRVD_FISCAL = "Disapproved Fiscal";
145        public static final String APPDOC_DAPRVD_CHART = "Disapproved Base Org Review";
146        public static final String APPDOC_DAPRVD_COMMODITY_CODE = "Disapproved Commodity Code";
147        public static final String APPDOC_DAPRVD_SEP_OF_DUTY = "Disapproved Separation of Duties";
148        public static final String APPDOC_DAPRVD_LICENSE = "Disapproved License";
149        public static final String AWAIT_BUDGET_REVIEW = "Awaiting Budget Approval";
150        public static final String APPDOC_DAPRVD_BUDGET = "Disapproved Budget";
151
152
153        public static HashMap<String, String> getAllAppDocStatuses() {
154            HashMap<String, String> appDocStatusMap = new HashMap<String, String>();
155
156            appDocStatusMap.put(APPDOC_IN_PROCESS, APPDOC_IN_PROCESS);
157            appDocStatusMap.put(APPDOC_CANCELLED, APPDOC_CANCELLED);
158            appDocStatusMap.put(APPDOC_CLOSED, APPDOC_CLOSED);
159            appDocStatusMap.put(APPDOC_AWAIT_FISCAL_REVIEW, APPDOC_AWAIT_FISCAL_REVIEW);
160            appDocStatusMap.put(APPDOC_AWAIT_CONTENT_REVIEW, APPDOC_AWAIT_CONTENT_REVIEW);
161            appDocStatusMap.put(APPDOC_AWAIT_HAS_ACCOUNTING_LINES, APPDOC_AWAIT_HAS_ACCOUNTING_LINES);
162            appDocStatusMap.put(APPDOC_AWAIT_SUB_ACCT_REVIEW, APPDOC_AWAIT_SUB_ACCT_REVIEW);
163            appDocStatusMap.put(APPDOC_AWAIT_CHART_REVIEW, APPDOC_AWAIT_CHART_REVIEW);
164            appDocStatusMap.put(APPDOC_AWAIT_COMMODITY_CODE_REVIEW, APPDOC_AWAIT_COMMODITY_CODE_REVIEW);
165            appDocStatusMap.put(APPDOC_AWAIT_SEP_OF_DUTY_REVIEW, APPDOC_AWAIT_SEP_OF_DUTY_REVIEW);
166            appDocStatusMap.put(APPDOC_AWAIT_CONTRACT_MANAGER_ASSGN, APPDOC_AWAIT_CONTRACT_MANAGER_ASSGN);
167            /*appDocStatusMap.put(APPDOC_AWAIT_LICENSE_REVIEW, APPDOC_AWAIT_LICENSE_REVIEW);*/
168            appDocStatusMap.put(AWAIT_BUDGET_REVIEW, AWAIT_BUDGET_REVIEW);
169            appDocStatusMap.put(APPDOC_DAPRVD_CONTENT, APPDOC_DAPRVD_CONTENT);
170            appDocStatusMap.put(APPDOC_DAPRVD_HAS_ACCOUNTING_LINES, APPDOC_DAPRVD_HAS_ACCOUNTING_LINES);
171            appDocStatusMap.put(APPDOC_DAPRVD_SUB_ACCT, APPDOC_DAPRVD_SUB_ACCT);
172            appDocStatusMap.put(APPDOC_DAPRVD_FISCAL, APPDOC_DAPRVD_FISCAL);
173            appDocStatusMap.put(APPDOC_DAPRVD_CHART, APPDOC_DAPRVD_CHART);
174            appDocStatusMap.put(APPDOC_DAPRVD_COMMODITY_CODE, APPDOC_DAPRVD_COMMODITY_CODE);
175            appDocStatusMap.put(APPDOC_DAPRVD_SEP_OF_DUTY, APPDOC_DAPRVD_SEP_OF_DUTY);
176            appDocStatusMap.put(APPDOC_DAPRVD_LICENSE, APPDOC_DAPRVD_LICENSE);
177            appDocStatusMap.put(APPDOC_DAPRVD_BUDGET, APPDOC_DAPRVD_BUDGET);
178
179            return appDocStatusMap;
180        }
181
182        // Node Name Declarations
183        public static final String NODE_CONTENT_REVIEW = "Organization";
184        public static final String NODE_SUBACCOUNT = "SubAccount";
185        public static final String NODE_SEPARATION_OF_DUTIES = "SeparationOfDuties";
186        public static final String NODE_ACCOUNT = "Account";
187        public static final String NODE_HAS_ACCOUNTING_LINES = "Initiator";
188        public static final String NODE_ORG_REVIEW = "AccountingOrganizationHierarchy";
189        public static final String NODE_COMMODITY_CODE_REVIEW = "Commodity";
190        public static final String NODE_LICENSE_REVIEW = "LicenseRequest";
191        public static final String NODE_BUDGET_OFFICE_REVIEW = "Budget";
192
193        public static HashMap<String, String> getRequistionAppDocStatuses() {
194            HashMap<String, String> reqAppDocStatusMap;
195
196            reqAppDocStatusMap = new HashMap<String, String>();
197            reqAppDocStatusMap.put(NODE_CONTENT_REVIEW, APPDOC_DAPRVD_CONTENT);
198            reqAppDocStatusMap.put(NODE_HAS_ACCOUNTING_LINES, APPDOC_DAPRVD_HAS_ACCOUNTING_LINES);
199            reqAppDocStatusMap.put(NODE_SUBACCOUNT, APPDOC_DAPRVD_SUB_ACCT);
200            reqAppDocStatusMap.put(NODE_ACCOUNT, APPDOC_DAPRVD_FISCAL);
201            reqAppDocStatusMap.put(NODE_ORG_REVIEW, APPDOC_DAPRVD_CHART);
202            reqAppDocStatusMap.put(NODE_COMMODITY_CODE_REVIEW, APPDOC_DAPRVD_COMMODITY_CODE);
203            reqAppDocStatusMap.put(NODE_SEPARATION_OF_DUTIES, APPDOC_DAPRVD_SEP_OF_DUTY);
204            reqAppDocStatusMap.put(NODE_LICENSE_REVIEW, APPDOC_DAPRVD_LICENSE);
205            reqAppDocStatusMap.put(AWAIT_BUDGET_REVIEW, RequisitionStatuses.NODE_BUDGET_OFFICE_REVIEW);
206            reqAppDocStatusMap.put(APPDOC_IN_PROCESS, APPDOC_IN_PROCESS);
207            reqAppDocStatusMap.put(APPDOC_CLOSED, APPDOC_CLOSED);
208            reqAppDocStatusMap.put(APPDOC_CANCELLED, APPDOC_CANCELLED);
209            reqAppDocStatusMap.put(APPDOC_AWAIT_CONTRACT_MANAGER_ASSGN, APPDOC_AWAIT_CONTRACT_MANAGER_ASSGN);
210            reqAppDocStatusMap.put(NODE_BUDGET_OFFICE_REVIEW, RequisitionStatuses.APPDOC_DAPRVD_BUDGET);
211
212            return reqAppDocStatusMap;
213        }
214        public static final Set<String> INCOMPLETE_STATUSES = new HashSet<String>();
215        public static final Set<String> COMPLETE_STATUSES = new HashSet<String>();
216
217        static {
218            INCOMPLETE_STATUSES.add(AWAIT_BUDGET_REVIEW);
219            COMPLETE_STATUSES.add(APPDOC_DAPRVD_BUDGET);
220        }
221
222    }
223
224    public static final String PURCHASE_ORDER_TRANSMISSION_METHOD = "PMTM";
225
226    public static class POCostSources {
227        public static final String ESTIMATE = "EST";
228    }
229
230    public static final class POTransmissionMethods {
231        public static final String FAX = "FAX";
232        public static final String PRINT = "PRIN";
233        public static final String NOPRINT = "NOPR";
234        public static final String ELECTRONIC = "ELEC";
235    }
236
237    public static final String REQ_B2B_ALLOW_COPY_DAYS = "5";
238    public static final String B2B_VENDOR_CONTRACT_NOT_FOUND_ERROR_MESSAGE = "The vendor whose shopping cart you are attempting to return does not have an active contract for your organization.";
239    public static final String B2B_URL_STRING = "&channelUrl=b2b.do?methodToCall=shopCatalogs";
240
241    public static class RequisitionSources {
242        public static final String STANDARD_ORDER = "STAN";
243        public static final String B2B = "B2B";
244        public static final String MANUAL_INGEST = "MAN";
245    }
246
247    // PURCHASE ORDER VENDOR CHOICE CODES
248    public static class VendorChoice {
249        public static final String CONTRACTED_PRICE = "CONT";
250        public static final String SMALL_ORDER = "SMAL";
251        public static final String PROFESSIONAL_SERVICE = "PROF";
252        public static final String SUBCONTRACT = "SUBC";
253    }
254
255    public static String[] AUTO_CLOSE_EXCLUSION_VNDR_CHOICE_CODES = {VendorChoice.SUBCONTRACT};
256
257    public static Integer APO_CONTRACT_MANAGER = new Integer(99);
258
259    // Requisition/Purchase Order Tab Errors
260    public static final String DELIVERY_TAB_ERRORS = "document.delivery*";
261    public static final String DETAIL_TAB_ERRORS = "document";
262    public static final String VENDOR_ERRORS = "document.vendor*,document.purchaseOrderVendorChoiceCode,document.alternateVendorName,document.shipmentReceivedDate";
263    public static final String ADDITIONAL_TAB_ERRORS = "document.requestor*,document.institution*,document.purchaseOrderTransmissionMethodCode,document.purchaseOrderCostSourceCode,document.purchaseOrderTotalLimit";
264    public static final String ITEM_TAB_ERRORS = "document.item*,newPurchasingItemLine*,itemQuantity,document.grandTotal,accountDistributionnewSourceLine*";
265    public static final String LINEITEM_TAB_ERRORS = "document.item*,newLineItemReceivingItemLine*";
266    public static final String ITEM_TAB_ERROR_PROPERTY = ITEM_TAB_ERRORS; // used to be "newPurchasingItemLine"
267    public static final String ACCOUNT_SUMMARY_TAB_ERRORS = "document.accountSummary*";
268    public static final String ACCOUNT_DISTRIBUTION_ERROR_KEY = "accountDistributionnewSourceLine";
269    public static final String RELATED_DOCS_TAB_ERRORS = "";
270    public static final String PAYMENT_HISTORY_TAB_ERRORS = "";
271    public static final String PAYMENT_INFO_ERRORS = "document.paymentInfo";
272    public static final String PAYMENT_INFO_TAB_ERRORS = "document.paymentInfo*,document.purchaseOrderBeginDate,document.purchaseOrderEndDate,document.finalPaymentAmount,document.initialPaymentAmount,document.recurringPaymentAmount";
273    public static final String CAPITAL_ASSET_TAB_ERRORS = "document.purchasingCapitalAsset*,newPurchasingItemCapitalAssetLine*,newPurchasingCapitalAssetLocationLine*";
274    public static final String SPLIT_PURCHASE_ORDER_TAB_ERRORS = "document.splitPurchaseOrder";
275    public static final String ASSIGN_SENSITIVE_DATA_TAB_ERRORS = "document.assignSensitiveData";
276    public static final String STIPULATIONS_TAB_ERRORS = "document.purchaseOrderVendorStipulation*,newPurchaseOrderVendorStipulationLine*";
277    // PO/Quotes Tab Constants
278    public static final String QUOTE_TAB_ERRORS = "document.quote*,quote*,purchaseOrderVendorQuotes*,newPurchaseOrderVendorQuote*,document.purchaseOrderVendorQuote*";
279    //PO Number Warning
280    public static final String WARNING_PURCHASEORDER_NUMBER_DONT_DISCLOSE = "warning.purchaseorder.number.dont.disclose";
281
282    // Assign Contract Manager
283    public static final String ASSIGN_CONTRACT_MANAGER_DEFAULT_DESC = "Contract Manager Assigned";
284    public static final String ASSIGN_CONTRACT_MANAGER_TAB_ERRORS = "document.unassignedRequisition*";
285
286    public static class PurchaseOrderStatuses {
287        // Added for updating app doc status for disapproved
288        public static final String APPDOC_DAPRVD_UNORDERED_ITEM = "Disapproved New Unordered Item Review";
289        public static final String APPDOC_DAPRVD_PURCHASING = "Disapproved Purchasing";
290        public static final String APPDOC_DAPRVD_COMMODITY_CODE = "Disapproved Commodity Code";
291        public static final String APPDOC_DAPRVD_CG_APPROVAL = "Disapproved C and G";
292        public static final String APPDOC_DAPRVD_BUDGET = "Disapproved Budget";
293        public static final String APPDOC_DAPRVD_TAX = "Disapproved Tax";
294        public static final String APPDOC_CANCELLED = "Cancelled";
295        public static final String APPDOC_VOID = "Void";
296        public static final String APPDOC_IN_PROCESS = "In Process";
297        public static final String APPDOC_CHANGE_IN_PROCESS = "Change in Process";
298        public static final String APPDOC_CLOSED = "Closed";
299        public static final String APPDOC_OPEN = "Open";
300        public static final String APPDOC_PAYMENT_HOLD = "Payment Hold";
301        public static final String APPDOC_PENDING_PRINT = "Pending Print";
302        public static final String APPDOC_AWAIT_TAX_REVIEW = "Awaiting Tax Approval";
303        public static final String APPDOC_AWAIT_BUDGET_REVIEW = "Awaiting Budget Approval";
304        public static final String APPDOC_AWAIT_CONTRACTS_GRANTS_REVIEW = "Awaiting C and G Approval";
305        public static final String APPDOC_AWAIT_PURCHASING_REVIEW = "Awaiting Purchasing Approval";
306        public static final String APPDOC_AWAIT_NEW_UNORDERED_ITEM_REVIEW = "Awaiting New Unordered Item Review";
307        public static final String APPDOC_AWAIT_COMMODITY_CODE_REVIEW = "Awaiting Commodity Code Approval";
308        public static final String APPDOC_FAX_ERROR = "Error occurred sending fax";
309        public static final String APPDOC_QUOTE = "Out for Quote";
310        public static final String APPDOC_CXML_ERROR = "Error occurred sending cxml";
311        public static final String APPDOC_PENDING_CXML = "Pending cxml";
312        public static final String APPDOC_PENDING_FAX = "Pending Fax";
313        public static final String APPDOC_WAITING_FOR_VENDOR = "Waiting for Vendor";
314        public static final String APPDOC_WAITING_FOR_DEPARTMENT = "Waiting for Department";
315        public static final String APPDOC_AMENDMENT = "Pending Amendment";
316        public static final String APPDOC_PENDING_CLOSE = "Pending Close";
317        public static final String APPDOC_CANCELLED_CHANGE = "Cancelled Change";
318        public static final String APPDOC_DISAPPROVED_CHANGE = "Disapproved Change";
319        public static final String APPDOC_DAPRVD_CONTRACTS_GRANTS = "Disapproved C and G";
320        public static final String APPDOC_PENDING_PAYMENT_HOLD = "Pending Payment Hold";
321        public static final String APPDOC_PENDING_REMOVE_HOLD = "Pending Remove Hold";
322        public static final String APPDOC_PENDING_REOPEN = "Pending Reopen";
323        public static final String APPDOC_PENDING_RETRANSMIT = "Pending Retransmit";
324        public static final String APPDOC_RETIRED_VERSION = "Retired Version";
325        public static final String APPDOC_PENDING_VOID = "Pending Void";
326        public static final String APPDOC_CANCELLED_IN_PROCESS = "Cancelled In Process";
327
328        public static HashMap<String, String> getAllAppDocStatuses() {
329            HashMap<String, String> appDocStatusMap = new HashMap<String, String>();
330
331            appDocStatusMap.put(APPDOC_DAPRVD_UNORDERED_ITEM, APPDOC_DAPRVD_UNORDERED_ITEM);
332            appDocStatusMap.put(APPDOC_DAPRVD_PURCHASING, APPDOC_DAPRVD_PURCHASING);
333            appDocStatusMap.put(APPDOC_DAPRVD_COMMODITY_CODE, APPDOC_DAPRVD_COMMODITY_CODE);
334            appDocStatusMap.put(APPDOC_DAPRVD_CG_APPROVAL, APPDOC_DAPRVD_CG_APPROVAL);
335            appDocStatusMap.put(APPDOC_DAPRVD_BUDGET, APPDOC_DAPRVD_BUDGET);
336            appDocStatusMap.put(APPDOC_DAPRVD_TAX, APPDOC_DAPRVD_TAX);
337            appDocStatusMap.put(APPDOC_CANCELLED, APPDOC_CANCELLED);
338            appDocStatusMap.put(APPDOC_VOID, APPDOC_VOID);
339            appDocStatusMap.put(APPDOC_IN_PROCESS, APPDOC_IN_PROCESS);
340            appDocStatusMap.put(APPDOC_CHANGE_IN_PROCESS, APPDOC_CHANGE_IN_PROCESS);
341            appDocStatusMap.put(APPDOC_CLOSED, APPDOC_CLOSED);
342            appDocStatusMap.put(APPDOC_OPEN, APPDOC_OPEN);
343            appDocStatusMap.put(APPDOC_PAYMENT_HOLD, APPDOC_PAYMENT_HOLD);
344            appDocStatusMap.put(APPDOC_PENDING_PRINT, APPDOC_PENDING_PRINT);
345            appDocStatusMap.put(APPDOC_AWAIT_TAX_REVIEW, APPDOC_AWAIT_TAX_REVIEW);
346            appDocStatusMap.put(APPDOC_AWAIT_BUDGET_REVIEW, APPDOC_AWAIT_BUDGET_REVIEW);
347            appDocStatusMap.put(APPDOC_AWAIT_CONTRACTS_GRANTS_REVIEW, APPDOC_AWAIT_CONTRACTS_GRANTS_REVIEW);
348            appDocStatusMap.put(APPDOC_AWAIT_PURCHASING_REVIEW, APPDOC_AWAIT_PURCHASING_REVIEW);
349            appDocStatusMap.put(APPDOC_AWAIT_NEW_UNORDERED_ITEM_REVIEW, APPDOC_AWAIT_NEW_UNORDERED_ITEM_REVIEW);
350            appDocStatusMap.put(APPDOC_AWAIT_COMMODITY_CODE_REVIEW, APPDOC_AWAIT_COMMODITY_CODE_REVIEW);
351            appDocStatusMap.put(APPDOC_FAX_ERROR, APPDOC_FAX_ERROR);
352            appDocStatusMap.put(APPDOC_QUOTE, APPDOC_QUOTE);
353            appDocStatusMap.put(APPDOC_CXML_ERROR, APPDOC_CXML_ERROR);
354            appDocStatusMap.put(APPDOC_PENDING_CXML, APPDOC_PENDING_CXML);
355            appDocStatusMap.put(APPDOC_PENDING_FAX, APPDOC_PENDING_FAX);
356            appDocStatusMap.put(APPDOC_WAITING_FOR_VENDOR, APPDOC_WAITING_FOR_VENDOR);
357            appDocStatusMap.put(APPDOC_WAITING_FOR_DEPARTMENT, APPDOC_WAITING_FOR_DEPARTMENT);
358            appDocStatusMap.put(APPDOC_AMENDMENT, APPDOC_AMENDMENT);
359            appDocStatusMap.put(APPDOC_PENDING_CLOSE, APPDOC_PENDING_CLOSE);
360            appDocStatusMap.put(APPDOC_CANCELLED_CHANGE, APPDOC_CANCELLED_CHANGE);
361            appDocStatusMap.put(APPDOC_DISAPPROVED_CHANGE, APPDOC_DISAPPROVED_CHANGE);
362            appDocStatusMap.put(APPDOC_DAPRVD_CONTRACTS_GRANTS, APPDOC_DAPRVD_CONTRACTS_GRANTS);
363            appDocStatusMap.put(APPDOC_PENDING_PAYMENT_HOLD, APPDOC_PENDING_PAYMENT_HOLD);
364            appDocStatusMap.put(APPDOC_PENDING_REMOVE_HOLD, APPDOC_PENDING_REMOVE_HOLD);
365            appDocStatusMap.put(APPDOC_PENDING_REOPEN, APPDOC_PENDING_REOPEN);
366            appDocStatusMap.put(APPDOC_PENDING_RETRANSMIT, APPDOC_PENDING_RETRANSMIT);
367            appDocStatusMap.put(APPDOC_RETIRED_VERSION, APPDOC_RETIRED_VERSION);
368            appDocStatusMap.put(APPDOC_PENDING_VOID, APPDOC_PENDING_VOID);
369
370            return appDocStatusMap;
371        }
372
373        public static final String NODE_ADHOC_REVIEW = "AdHoc";
374        public static final String NODE_CONTRACT_MANAGEMENT = "ContractManagement";
375        public static final String NODE_AWAIT_NEW_UNORDERED_ITEM_REVIEW = "NewUnorderedItems";
376        public static final String NODE_INTERNAL_PURCHASING_REVIEW = "ContractManagement";
377        public static final String NODE_COMMODITY_CODE_REVIEW = "Commodity";
378        public static final String NODE_CONTRACTS_AND_GRANTS_REVIEW = "Award";
379        public static final String NODE_BUDGET_OFFICE_REVIEW = "Budget";
380        public static final String NODE_VENDOR_TAX_REVIEW = "Tax";
381        public static final String NODE_DOCUMENT_TRANSMISSION = "JoinVendorIsEmployeeOrNonResidentAlien";
382
383        public static final HashMap<String, String> getPurchaseOrderAppDocDisapproveStatuses() {
384
385            HashMap<String, String> poAppDocStatusMap = new HashMap<String, String>();
386
387            poAppDocStatusMap.put(NODE_ADHOC_REVIEW, PurchaseOrderStatuses.APPDOC_CANCELLED);
388            poAppDocStatusMap.put(NODE_AWAIT_NEW_UNORDERED_ITEM_REVIEW, PurchaseOrderStatuses.APPDOC_DAPRVD_UNORDERED_ITEM);
389            poAppDocStatusMap.put(NODE_INTERNAL_PURCHASING_REVIEW, PurchaseOrderStatuses.APPDOC_DAPRVD_PURCHASING);
390            poAppDocStatusMap.put(NODE_COMMODITY_CODE_REVIEW, PurchaseOrderStatuses.APPDOC_DAPRVD_COMMODITY_CODE);
391            poAppDocStatusMap.put(NODE_CONTRACTS_AND_GRANTS_REVIEW, PurchaseOrderStatuses.APPDOC_DAPRVD_CG_APPROVAL);
392            poAppDocStatusMap.put(NODE_BUDGET_OFFICE_REVIEW, PurchaseOrderStatuses.APPDOC_DAPRVD_BUDGET);
393            poAppDocStatusMap.put(NODE_VENDOR_TAX_REVIEW, PurchaseOrderStatuses.APPDOC_DAPRVD_TAX);
394            poAppDocStatusMap.put(PurchaseOrderStatuses.APPDOC_CANCELLED, PurchaseOrderStatuses.APPDOC_CANCELLED);
395            poAppDocStatusMap.put(PurchaseOrderStatuses.APPDOC_VOID, PurchaseOrderStatuses.APPDOC_VOID);
396            poAppDocStatusMap.put(PurchaseOrderStatuses.APPDOC_IN_PROCESS, PurchaseOrderStatuses.APPDOC_IN_PROCESS);
397            poAppDocStatusMap.put(PurchaseOrderStatuses.APPDOC_CLOSED, PurchaseOrderStatuses.APPDOC_CLOSED);
398
399            return poAppDocStatusMap;
400
401        }
402
403        public static final Set<String> INCOMPLETE_STATUSES = new HashSet<String>();
404        public static final Set<String> COMPLETE_STATUSES = new HashSet<String>();
405
406        static {
407            INCOMPLETE_STATUSES.add(APPDOC_AWAIT_TAX_REVIEW);
408            INCOMPLETE_STATUSES.add(APPDOC_AWAIT_BUDGET_REVIEW);
409            INCOMPLETE_STATUSES.add(APPDOC_AWAIT_CONTRACTS_GRANTS_REVIEW);
410            INCOMPLETE_STATUSES.add(APPDOC_AWAIT_PURCHASING_REVIEW);
411            INCOMPLETE_STATUSES.add(APPDOC_AWAIT_NEW_UNORDERED_ITEM_REVIEW);
412            INCOMPLETE_STATUSES.add(APPDOC_AWAIT_COMMODITY_CODE_REVIEW);
413            INCOMPLETE_STATUSES.add(APPDOC_FAX_ERROR);
414            INCOMPLETE_STATUSES.add(APPDOC_QUOTE);
415            INCOMPLETE_STATUSES.add(APPDOC_CXML_ERROR);
416            INCOMPLETE_STATUSES.add(APPDOC_PENDING_CXML);
417            INCOMPLETE_STATUSES.add(APPDOC_IN_PROCESS);
418            INCOMPLETE_STATUSES.add(APPDOC_PAYMENT_HOLD);
419            INCOMPLETE_STATUSES.add(APPDOC_PENDING_FAX);
420            INCOMPLETE_STATUSES.add(APPDOC_PENDING_PRINT);
421            INCOMPLETE_STATUSES.add(APPDOC_WAITING_FOR_VENDOR);
422            INCOMPLETE_STATUSES.add(APPDOC_WAITING_FOR_DEPARTMENT);
423
424            COMPLETE_STATUSES.add(APPDOC_AMENDMENT);
425            COMPLETE_STATUSES.add(APPDOC_CANCELLED);
426            COMPLETE_STATUSES.add(APPDOC_CHANGE_IN_PROCESS);
427            COMPLETE_STATUSES.add(APPDOC_CLOSED);
428            COMPLETE_STATUSES.add(APPDOC_PENDING_CLOSE);
429            COMPLETE_STATUSES.add(APPDOC_CANCELLED_CHANGE);
430            COMPLETE_STATUSES.add(APPDOC_DISAPPROVED_CHANGE);
431            COMPLETE_STATUSES.add(APPDOC_DAPRVD_BUDGET);
432            COMPLETE_STATUSES.add(APPDOC_DAPRVD_CONTRACTS_GRANTS);
433            COMPLETE_STATUSES.add(APPDOC_DAPRVD_COMMODITY_CODE);
434            COMPLETE_STATUSES.add(APPDOC_DAPRVD_PURCHASING);
435            COMPLETE_STATUSES.add(APPDOC_DAPRVD_TAX);
436            COMPLETE_STATUSES.add(APPDOC_OPEN);
437            COMPLETE_STATUSES.add(APPDOC_PENDING_PAYMENT_HOLD);
438            COMPLETE_STATUSES.add(APPDOC_PENDING_REMOVE_HOLD);
439            COMPLETE_STATUSES.add(APPDOC_PENDING_REOPEN);
440            COMPLETE_STATUSES.add(APPDOC_PENDING_RETRANSMIT);
441            COMPLETE_STATUSES.add(APPDOC_RETIRED_VERSION);
442            COMPLETE_STATUSES.add(APPDOC_VOID);
443            COMPLETE_STATUSES.add(APPDOC_PENDING_VOID);
444        }
445
446
447        /**
448         * Do not include 'OPEN' status in this map. The 'OPEN' status is the default status that is set when no status exists for a
449         * particular pending transmission type code.
450         *
451         * @see {@link org.kuali.module.purap.service.PurchaseOrderService#completePurchaseOrder(org.kuali.module.purap.document.PurchaseOrderDocument)}
452         */
453        private static final Map<String, String> getStatusesByTransmissionType() {
454            Map<String, String> statusByTrans = new HashMap<String, String>();
455            statusByTrans.put(PurapConstants.POTransmissionMethods.PRINT, APPDOC_PENDING_PRINT);
456            statusByTrans.put(PurapConstants.POTransmissionMethods.ELECTRONIC, APPDOC_PENDING_CXML);
457            statusByTrans.put(PurapConstants.POTransmissionMethods.FAX, APPDOC_PENDING_FAX);
458            return Collections.unmodifiableMap(statusByTrans);
459        }
460
461        public static final Map<String, String> STATUSES_BY_TRANSMISSION_TYPE = getStatusesByTransmissionType();
462
463    }
464
465    public static final class ItemTypeCodes {
466        // ITEM TYPES
467        public static final String ITEM_TYPE_ITEM_CODE = "ITEM";
468        public static final String ITEM_TYPE_SERVICE_CODE = "SRVC";
469        public static final String ITEM_TYPE_FREIGHT_CODE = "FRHT";
470        public static final String ITEM_TYPE_SHIP_AND_HAND_CODE = "SPHD";
471        public static final String ITEM_TYPE_TRADE_IN_CODE = "TRDI";
472        public static final String ITEM_TYPE_ORDER_DISCOUNT_CODE = "ORDS";
473        public static final String ITEM_TYPE_MIN_ORDER_CODE = "MNOR";
474        public static final String ITEM_TYPE_MISC_CODE = "MISC";
475        public static final String ITEM_TYPE_PMT_TERMS_DISCOUNT_CODE = "DISC";
476        public static final String ITEM_TYPE_FEDERAL_TAX_CODE = "FDTX";
477        public static final String ITEM_TYPE_STATE_TAX_CODE = "STTX";
478        public static final String ITEM_TYPE_FEDERAL_GROSS_CODE = "FDGR";
479        public static final String ITEM_TYPE_STATE_GROSS_CODE = "STGR";
480        public static final String ITEM_TYPE_RESTCK_FEE_CODE = "RSTO";
481        public static final String ITEM_TYPE_MISC_CRDT_CODE = "MSCR";
482        public static final String ITEM_TYPE_UNORDERED_ITEM_CODE = "UNOR";
483        public static final String ITEM_TYPE_SHIPPING_CODE = "SHIP";
484
485        public static final Set<String> EXCLUDED_ITEM_TYPES = new HashSet<String>();
486
487        static {
488            EXCLUDED_ITEM_TYPES.add(ITEM_TYPE_UNORDERED_ITEM_CODE);
489        }
490    }
491
492    // Item constants
493    public static final int DOLLAR_AMOUNT_MIN_SCALE = 2;
494    public static final int UNIT_PRICE_MAX_SCALE = 4;
495    public static final int PREQ_DESC_LENGTH = 500;
496    public static final String PREQ_DISCOUNT_MULT = "-0.01";
497    public static final String PRQS_DISCOUNT_MULT = "-0.01";
498
499    public static final String REQUISITION_DOCUMENT_TYPE = "OLE_REQS";
500    public static final String RECEIVING_LINE_ITEM_DOCUMENT_TYPE = "OLE_RCVL";
501    public static final String RECEIVING_THRESHOLD_DOCUMENT_TYPE = "OLE_THLD";
502
503    public static class PurchaseOrderDocTypes {
504        public static final String PURCHASE_ORDER_REOPEN_DOCUMENT = "OLE_POR";
505        public static final String PURCHASE_ORDER_CLOSE_DOCUMENT = "OLE_POC";
506        public static final String PURCHASE_ORDER_DOCUMENT = "OLE_PO";
507        public static final String PURCHASE_ORDER_RETRANSMIT_DOCUMENT = "OLE_PORT";
508        public static final String PURCHASE_ORDER_PRINT_DOCUMENT = "OLEPurchaseOrderPrintDocument";
509        public static final String PURCHASE_ORDER_VOID_DOCUMENT = "OLE_POV";
510        public static final String PURCHASE_ORDER_PAYMENT_HOLD_DOCUMENT = "OLE_POPH";
511        public static final String PURCHASE_ORDER_REMOVE_HOLD_DOCUMENT = "OLE_PORH";
512        public static final String PURCHASE_ORDER_AMENDMENT_DOCUMENT = "OLE_POA";
513        public static final String PURCHASE_ORDER_SPLIT_DOCUMENT = "OLE_POSP";
514    }
515
516    public static class PODocumentsStrings {
517        public static final String CLOSE_QUESTION = "POClose";
518        public static final String CLOSE_CONFIRM = "POCloseConfirm";
519        public static final String CLOSE_NOTE_PREFIX = "Note entered while closing a Purchase Order :";
520
521        public static final String REOPEN_PO_QUESTION = "ReopenPO";
522        public static final String CONFIRM_REOPEN_QUESTION = "ConfirmReopen";
523        public static final String REOPEN_NOTE_PREFIX = "Note entered while reopening a Purchase Order : ";
524
525        public static final String VOID_QUESTION = "POVoid";
526        public static final String VOID_CONFIRM = "POVoidConfirm";
527        public static final String VOID_NOTE_PREFIX = "Note entered while voiding a Purchase Order :";
528
529        public static final String PAYMENT_HOLD_QUESTION = "POPaymentHold";
530        public static final String PAYMENT_HOLD_CONFIRM = "POPaymentHoldConfirm";
531        public static final String PAYMENT_HOLD_NOTE_PREFIX = "Note entered while putting a Purchase Order on payment hold :";
532
533        public static final String REMOVE_HOLD_QUESTION = "PORemoveHold";
534        public static final String REMOVE_HOLD_CONFIRM = "PORemoveHoldConfirm";
535        public static final String REMOVE_HOLD_NOTE_PREFIX = "Note entered while removing a Purchase Order from payment hold :";
536        public static final String REMOVE_HOLD_FYI = "This document was taken off Payment Hold status.";
537
538        public static final String AMENDMENT_PO_QUESTION = "AmendmentPO";
539        public static final String CONFIRM_AMENDMENT_QUESTION = "ConfirmAmendment";
540        public static final String AMENDMENT_NOTE_PREFIX = "Note entered while amending a Purchase Order : ";
541
542        public static final String SPLIT_QUESTION = "POSplit";
543        public static final String SPLIT_CONFIRM = "POSplitConfirm";
544        public static final String SPLIT_NOTE_PREFIX_OLD_DOC = "Note entered while splitting this Purchase Order : ";
545        public static final String SPLIT_NOTE_PREFIX_NEW_DOC = "Note entered while being split from Purchase Order ";
546        public static final String SPLIT_ADDL_CHARGES_WARNING_LABEL = "WARNING";
547        public static final String SPLIT_ADDL_CHARGES_WARNING = "* ADDITIONAL CHARGES EXIST *";
548        public static final String SPLIT_NOTE_TEXT = "splitNoteText";
549        public static final String ITEMS_MOVING_TO_SPLIT = "movingPOItems";
550        public static final String ITEMS_REMAINING = "remainingPOItems";
551        public static final String LINE_ITEMS_REMAINING = "remainingPOLineItems";
552
553        public static final String CONFIRM_AWARD_QUESTION = "POConfirmAward";
554        public static final String CONFIRM_AWARD_RETURN = "completeQuote";
555
556        public static final String CONFIRM_CANCEL_QUESTION = "POCancelQuote";
557        public static final String CONFIRM_CANCEL_RETURN = "cancelQuote";
558
559        public static final String SINGLE_CONFIRMATION_QUESTION = "singleConfirmationQuestion";
560
561        public static final String MANUAL_STATUS_CHANGE_QUESTION = "manualStatusChangeQuestion";
562        public static final String WAITING_FOR_VENDOR = "WVEN";
563        public static final String WAITING_FOR_DEPARTMENT = "WDPT";
564
565        public static final String OPEN_STATUS = "Open";
566
567        public static final String POSTAL_CODE = "Postal Code";
568        public static final String ALTERNATE_PAYEE_VENDOR = "Alternate Payee Vendor";
569        public static final String CUSTOMER_INVOICE_DETAIL_UOM_DEFAULT = "EA"; //TODO: System parameter?
570    }
571
572    public static final String PO_OVERRIDE_NOT_TO_EXCEED_QUESTION = "OverrideNotToExceed";
573    public static final String FIX_CAPITAL_ASSET_WARNINGS = "FixCapitalAssetWarnings";
574    public static final String PO_NEXT_FY_WARNING = "NextFiscalYearWarning";
575
576    // ACCOUNTS PAYABLE
577    public static final String AP_OVERRIDE_INVOICE_NOMATCH_QUESTION = "OverrideInvoiceNoMatch";
578
579    public static class AccountsPayableDocumentStrings {
580        public static final String CANCEL_NOTE_PREFIX = "Note entered while canceling document: ";
581    }
582
583    // PAYMENT REQUEST
584    public static final String PAYMENT_REQUEST_ACTION_NAME = "PaymentRequest";
585    public static final String PREQ_PAY_DATE_DAYS = "days";
586    public static final String PREQ_PAY_DATE_DATE = "date";
587    public static final int PREQ_PAY_DATE_EMPTY_TERMS_DEFAULT_DAYS = 28;
588    public static final int PREQ_PAY_DATE_DAYS_BEFORE_WARNING = 60;
589
590    // INVOICE
591    public static final String INVOICE_ACTION_NAME = "Invoice";
592    public static final String PRQS_PAY_DATE_DAYS = "days";
593    public static final String PRQS_PAY_DATE_DATE = "date";
594    public static final int PRQS_PAY_DATE_EMPTY_TERMS_DEFAULT_DAYS = 28;
595    public static final int PRQS_PAY_DATE_DAYS_BEFORE_WARNING = 60;
596
597    //TAB ERROR KEYS
598    public static final String PAYMENT_REQUEST_INIT_TAB_ERRORS = "document.purchaseOrderIdentifier,document.invoiceNumber,document.invoiceDate,document.vendorInvoiceAmount,document.specialHandlingInstructionLine1Text,document.specialHandlingInstructionLine2Text,document.specialHandlingInstructionLine3Text";
599    public static final String PAYMENT_REQUEST_TAX_TAB_ERRORS = "document.tax*";
600    public static final String PAYMENT_REQUEST_INVOICE_TAB_ERRORS = "document.paymentRequestPayDate,document.bank*,bankCode";
601    public static final String RECEIVING_LINE_INIT_TAB_ERRORS = "document.purchaseOrderIdentifier,document.shipmentReceivedDate,document.shipmentPackingSlipNumber,document.shipmentBillOfLadingNumber,document.carrierCode";
602    public static final String BULK_RECEIVING_INIT_TAB_ERRORS = "document.purchaseOrderIdentifier,document.shipmentReceivedDate,document.shipmentPackingSlipNumber,document.shipmentBillOfLadingNumber,document.carrierCode";
603    public static final String BULK_RECEIVING_VENDOR_TAB_ERRORS = "document.vendor*,document.alternate*,document.goodsDelivered*,document.shipmentReceivedDate,document.shipmentPackingSlipNumber,document.shipmentBillOfLadingNumber,document.carrierCode,document.shipmentReferenceNumber,document.shipmentWeight,document.noOfCartons,document.trackingNumber";
604    public static final String BULK_RECEIVING_DELIVERY_TAB_ERRORS = "document.delivery*,document.institution*,document.requestor,document.preparer";
605    public static final String REJECT_DOCUMENT_TAB_ERRORS = "document.vendorDunsNumber,document.vendor*,document.invoice*";
606
607    // Weird PaymentTermsType is due on either the 10th or 25th with no discount
608    public static final String PMT_TERMS_TYP_NO_DISCOUNT_CD = "00N2T";
609
610    public static final String PURAP_AP_SHOW_CONTINUATION_ACCOUNT_WARNING_FISCAL_OFFICERS = "SHOW_CONTINUATION_ACCOUNT_WARNING_FISCAL_OFFICERS_IND";
611    public static final String PURAP_AP_SHOW_CONTINUATION_ACCOUNT_WARNING_AP_USERS = "SHOW_CONTINUATION_ACCOUNT_WARNING_AP_USERS_IND";
612
613    public static final class PaymentRequestIndicatorText {
614        public static final String HOLD = "HOLD";
615        public static final String REQUEST_CANCEL = "REQUEST CANCEL";
616    }
617
618    public static final class InvoiceIndicatorText {
619        public static final String HOLD = "HOLD";
620        public static final String REQUEST_CANCEL = "REQUEST CANCEL";
621    }
622
623    public static class AccountsPayableSharedStatuses {
624        public static final String IN_PROCESS = "INPR";
625        public static final String AWAITING_ACCOUNTS_PAYABLE_REVIEW = "APAD"; // Waiting for Accounts Payable approval
626    }
627
628    public static final class AccountsPayableStatuses {
629        public static final String NODE_ACCOUNT_PAYABLE_REVIEW = "ImageAttachment";
630    }
631
632    public static final class PaymentRequestStatuses {
633        public static final String APPDOC_INITIATE = "Initiated";
634        public static final String APPDOC_IN_PROCESS = "In Process";
635        public static final String APPDOC_CANCELLED_IN_PROCESS = "Cancelled In Process";
636        public static final String APPDOC_CANCELLED_POST_AP_APPROVE = "Cancelled";
637        public static final String APPDOC_DEPARTMENT_APPROVED = "Department-Approved";
638        public static final String APPDOC_AUTO_APPROVED = "Auto-Approved";
639        public static final String APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW = "Awaiting AP Review"; // Waiting for Accounts Payable approval
640        public static final String APPDOC_AWAITING_RECEIVING_REVIEW = "Awaiting Receiving"; // Waiting for Receiving approval
641        public static final String APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW = "Awaiting Sub-Account Manager Approval"; // Waiting for Sub Acct Manager approval
642        public static final String APPDOC_AWAITING_FISCAL_REVIEW = "Awaiting Fiscal Officer Approval"; // Waiting for Fiscal Officer approval
643        public static final String APPDOC_AWAITING_ORG_REVIEW = "Awaiting Chart Approval"; // Waiting for Chart/Org approval
644        public static final String APPDOC_AWAITING_TAX_REVIEW = "Awaiting Tax Approval"; // Waiting for Vendor Tax approval
645        public static final String APPDOC_PENDING_E_INVOICE = "Pending Route Electronic Invoice";
646        public static final String AWAIT_BUDGET_REVIEW = "Awaiting Budget Approval";
647        public static final String DAPRVD_BUDGET = "DBUD";
648        public static final String APPDOC_AWAITING_PAYMENT_REVIEW = "Awaiting Payment Method Approval";
649
650        public static HashMap<String, String> getAllAppDocStatuses() {
651            HashMap<String, String> appDocStatusMap = new HashMap<String, String>();
652
653            appDocStatusMap.put(APPDOC_INITIATE, APPDOC_INITIATE);
654            appDocStatusMap.put(APPDOC_IN_PROCESS, APPDOC_IN_PROCESS);
655            appDocStatusMap.put(APPDOC_CANCELLED_IN_PROCESS, APPDOC_CANCELLED_IN_PROCESS);
656            appDocStatusMap.put(APPDOC_CANCELLED_POST_AP_APPROVE, APPDOC_CANCELLED_POST_AP_APPROVE);
657            appDocStatusMap.put(APPDOC_DEPARTMENT_APPROVED, APPDOC_DEPARTMENT_APPROVED);
658            appDocStatusMap.put(APPDOC_AUTO_APPROVED, APPDOC_AUTO_APPROVED);
659            appDocStatusMap.put(APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW, APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
660            appDocStatusMap.put(APPDOC_AWAITING_RECEIVING_REVIEW, APPDOC_AWAITING_RECEIVING_REVIEW);
661            appDocStatusMap.put(APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW, APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW);
662            appDocStatusMap.put(AWAIT_BUDGET_REVIEW, AWAIT_BUDGET_REVIEW);
663            appDocStatusMap.put(APPDOC_AWAITING_FISCAL_REVIEW, APPDOC_AWAITING_FISCAL_REVIEW);
664            appDocStatusMap.put(APPDOC_AWAITING_ORG_REVIEW, APPDOC_AWAITING_ORG_REVIEW);
665            appDocStatusMap.put(APPDOC_AWAITING_TAX_REVIEW, APPDOC_AWAITING_TAX_REVIEW);
666            appDocStatusMap.put(APPDOC_AWAITING_PAYMENT_REVIEW, APPDOC_AWAITING_PAYMENT_REVIEW);
667            appDocStatusMap.put(APPDOC_PENDING_E_INVOICE, APPDOC_PENDING_E_INVOICE);
668
669            return appDocStatusMap;
670        }
671
672        public static final String NODE_ADHOC_REVIEW = "AdHoc";
673        public static final String NODE_AWAITING_RECEIVING_REVIEW = "PurchaseWasReceived";
674        public static final String NODE_SUB_ACCOUNT_REVIEW = "SubAccount";
675        public static final String NODE_ACCOUNT_REVIEW = "Account";
676        public static final String NODE_ORG_REVIEW = "AccountingOrganizationHierarchy";
677        public static final String NODE_VENDOR_TAX_REVIEW = "Tax";
678
679        // keep these in the order of potential routing
680        // Note it doesn't make much sense to compare auto_approved and dept_approved but this is
681        // easier than two enums plus this should primarily be used for user enterred areas
682        public enum STATUS_ORDER {
683            CANCELLED_IN_PROCESS(PurapConstants.PaymentRequestStatuses.APPDOC_CANCELLED_IN_PROCESS, false),
684            CANCELLED_POST_AP_APPROVE(PurapConstants.PaymentRequestStatuses.APPDOC_CANCELLED_POST_AP_APPROVE, false),
685            INITIATE(PurapConstants.PaymentRequestStatuses.APPDOC_INITIATE, true),
686            IN_PROCESS(PurapConstants.PaymentRequestStatuses.APPDOC_IN_PROCESS, true),
687            AWAITING_ACCOUNTS_PAYABLE_REVIEW(PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW, false),
688            AWAITING_RECEIVING_REVIEW(PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_RECEIVING_REVIEW, false),
689            AWAITING_SUB_ACCT_MGR_REVIEW(PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW, false),
690            AWAIT_BUDGET_REVIEW(
691                    PurapConstants.PaymentRequestStatuses.AWAIT_BUDGET_REVIEW, false),
692            AWAITING_FISCAL_REVIEW(PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_FISCAL_REVIEW, false),
693            AWAITING_ORG_REVIEW(PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_ORG_REVIEW, false),
694            AWAITING_TAX_REVIEW(PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_TAX_REVIEW, false),
695            AWAITING_PAYMENT_REVIEW(
696                    PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_PAYMENT_REVIEW, false),
697            DEPARTMENT_APPROVED(PurapConstants.PaymentRequestStatuses.APPDOC_DEPARTMENT_APPROVED, false),
698            AUTO_APPROVED(PurapConstants.PaymentRequestStatuses.APPDOC_AUTO_APPROVED, false),;
699
700            private String statusCode = new String();
701            private boolean fullEntryAllowed = false;
702
703            STATUS_ORDER(String statusCode, boolean fullEntry) {
704                this.statusCode = statusCode;
705                this.fullEntryAllowed = fullEntry;
706            }
707
708            public static STATUS_ORDER getByStatusCode(String statusCode) {
709                for (STATUS_ORDER status : STATUS_ORDER.values()) {
710                    if (StringUtils.equals(status.statusCode, statusCode)) {
711                        return status;
712                    }
713                }
714                return null;
715            }
716
717            public static boolean isFullDocumentEntryCompleted(String status) {
718                if (StringUtils.isNotBlank(status)) {
719                    return !getByStatusCode(status).fullEntryAllowed;
720                }
721                return false;
722            }
723
724            public static STATUS_ORDER getPreviousStatus(String statusCode) {
725                STATUS_ORDER statusOrder = STATUS_ORDER.getByStatusCode(statusCode);
726                if (statusOrder.ordinal() > 0) {
727                    return STATUS_ORDER.values()[statusOrder.ordinal() - 1];
728                }
729                return null;
730            }
731
732            public static boolean isFirstFullEntryStatus(String statusCode) {
733                // NOTE this won't work if there endsup being two ways to get to the first full entry status (i.e. like AUTO/DEPT
734                // for final)
735                return getByStatusCode(statusCode).fullEntryAllowed && !getPreviousStatus(statusCode).fullEntryAllowed;
736            }
737        }
738
739
740        public static final String[] PREQ_STATUSES_FOR_AUTO_APPROVE = {
741                APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW,
742                AWAIT_BUDGET_REVIEW,
743                APPDOC_AWAITING_FISCAL_REVIEW,
744                APPDOC_AWAITING_ORG_REVIEW,
745                APPDOC_AWAITING_PAYMENT_REVIEW};
746
747        public static final String[] STATUSES_ALLOWED_FOR_EXTRACTION = {APPDOC_AUTO_APPROVED, APPDOC_DEPARTMENT_APPROVED};
748
749        public static final String[] STATUSES_POTENTIALLY_ACTIVE = {
750                APPDOC_IN_PROCESS,
751                APPDOC_DEPARTMENT_APPROVED,
752                APPDOC_AUTO_APPROVED,
753                APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW,
754                APPDOC_AWAITING_RECEIVING_REVIEW,
755                APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW,
756                AWAIT_BUDGET_REVIEW,
757                APPDOC_AWAITING_FISCAL_REVIEW,
758                APPDOC_AWAITING_ORG_REVIEW,
759                APPDOC_AWAITING_TAX_REVIEW,
760                APPDOC_AWAITING_PAYMENT_REVIEW};
761
762        public static final Set CANCELLED_STATUSES = new HashSet();
763        public static final Set STATUSES_DISALLOWING_HOLD = new HashSet();
764        public static final Set STATUSES_DISALLOWING_REMOVE_HOLD = new HashSet();
765        public static final Set STATUSES_DISALLOWING_REQUEST_CANCEL = new HashSet();
766        public static final Set STATUSES_DISALLOWING_REMOVE_REQUEST_CANCEL = new HashSet();
767        public static final Set STATUSES_PREROUTE = new HashSet();
768        public static final Set STATUSES_ENROUTE = new HashSet();
769        public static final Set STATUSES_POSTROUTE = new HashSet();
770
771        static {
772            CANCELLED_STATUSES.add(APPDOC_CANCELLED_IN_PROCESS);
773            CANCELLED_STATUSES.add(APPDOC_CANCELLED_POST_AP_APPROVE);
774
775            STATUSES_DISALLOWING_HOLD.add(APPDOC_INITIATE);
776            STATUSES_DISALLOWING_HOLD.add(APPDOC_IN_PROCESS);
777            STATUSES_DISALLOWING_HOLD.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
778
779            STATUSES_DISALLOWING_REMOVE_HOLD.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
780
781            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_INITIATE);
782            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_IN_PROCESS);
783            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_DEPARTMENT_APPROVED);
784            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_AUTO_APPROVED);
785            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
786            STATUSES_DISALLOWING_REQUEST_CANCEL.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
787
788            STATUSES_DISALLOWING_REMOVE_REQUEST_CANCEL.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
789
790            STATUSES_PREROUTE.add(APPDOC_IN_PROCESS);
791            STATUSES_PREROUTE.add(APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
792
793            STATUSES_ENROUTE.add(APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW);
794            STATUSES_ENROUTE.add(APPDOC_AWAITING_FISCAL_REVIEW);
795            STATUSES_ENROUTE.add(APPDOC_AWAITING_ORG_REVIEW);
796            STATUSES_ENROUTE.add(APPDOC_AWAITING_TAX_REVIEW);
797            STATUSES_ENROUTE.add(APPDOC_AWAITING_PAYMENT_REVIEW);
798
799            STATUSES_POSTROUTE.add(APPDOC_DEPARTMENT_APPROVED);
800            STATUSES_POSTROUTE.add(APPDOC_AUTO_APPROVED);
801        }
802
803        public static final HashMap<String, String> getPaymentRequestAppDocDisapproveStatuses() {
804
805            HashMap<String, String> appDocStatusMap = new HashMap<String, String>();
806
807            appDocStatusMap.put(NODE_ADHOC_REVIEW, PaymentRequestStatuses.APPDOC_CANCELLED_IN_PROCESS);
808            appDocStatusMap.put(AccountsPayableStatuses.NODE_ACCOUNT_PAYABLE_REVIEW, PaymentRequestStatuses.APPDOC_CANCELLED_IN_PROCESS);
809            appDocStatusMap.put(NODE_AWAITING_RECEIVING_REVIEW, PaymentRequestStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
810            appDocStatusMap.put(NODE_SUB_ACCOUNT_REVIEW, PaymentRequestStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
811            appDocStatusMap.put(NODE_ACCOUNT_REVIEW, PaymentRequestStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
812            appDocStatusMap.put(NODE_ORG_REVIEW, PaymentRequestStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
813            appDocStatusMap.put(NODE_VENDOR_TAX_REVIEW, PaymentRequestStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
814
815            return appDocStatusMap;
816
817        }
818
819        public static final List<String> getNodesRequiringCorrectingGeneralLedgerEntries() {
820
821            List<String> returnList = new ArrayList<String>();
822
823            returnList.add(NODE_ACCOUNT_REVIEW);
824            returnList.add(NODE_VENDOR_TAX_REVIEW);
825
826            return returnList;
827        }
828
829    }
830
831    public static final class InvoiceStatuses {
832        public static final String APPDOC_INITIATE = "Initiated";
833        public static final String APPDOC_IN_PROCESS = "In Process";
834        public static final String APPDOC_CANCELLED_IN_PROCESS = "Cancelled In Process";
835        public static final String APPDOC_CANCELLED_POST_AP_APPROVE = "Cancelled";
836        public static final String APPDOC_DEPARTMENT_APPROVED = "Department-Approved";
837        public static final String APPDOC_AUTO_APPROVED = "Auto-Approved";
838        public static final String APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW = "Awaiting AP Review"; // Waiting for Accounts Payable approval
839        public static final String APPDOC_AWAITING_RECEIVING_REVIEW = "Awaiting Receiving"; // Waiting for Receiving approval
840        public static final String APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW = "Awaiting Sub-Account Manager Approval"; // Waiting for Sub Acct Manager approval
841        public static final String APPDOC_AWAITING_FISCAL_REVIEW = "Awaiting Fiscal Officer Approval"; // Waiting for Fiscal Officer approval
842        public static final String APPDOC_AWAITING_ORG_REVIEW = "Awaiting Chart Approval"; // Waiting for Chart/Org approval
843        public static final String APPDOC_AWAITING_TAX_REVIEW = "Awaiting Tax Approval"; // Waiting for Vendor Tax approval
844        public static final String APPDOC_PENDING_E_INVOICE = "Pending Route Electronic Invoice";
845        public static final String AWAIT_BUDGET_REVIEW = "Awaiting Budget Approval";
846       // public static final String DAPRVD_BUDGET = "DBUD";
847        public static final String APPDOC_AWAITING_PAYMENT_REVIEW = "Awaiting Payment Method Approval";
848        public static final String APPDOC_DAPRVD_BUDGET = "Disapproved Budget";
849        public static final String APPDOC_DAPRVD_PAYMENT = "Disapproved Payment";
850        
851        public static HashMap<String, String> getAllAppDocStatuses() {
852            HashMap<String, String> appDocStatusMap = new HashMap<String, String>();
853
854            appDocStatusMap.put(APPDOC_INITIATE, APPDOC_INITIATE);
855            appDocStatusMap.put(APPDOC_IN_PROCESS, APPDOC_IN_PROCESS);
856            appDocStatusMap.put(APPDOC_CANCELLED_IN_PROCESS, APPDOC_CANCELLED_IN_PROCESS);
857            appDocStatusMap.put(APPDOC_CANCELLED_POST_AP_APPROVE, APPDOC_CANCELLED_POST_AP_APPROVE);
858            appDocStatusMap.put(APPDOC_DEPARTMENT_APPROVED, APPDOC_DEPARTMENT_APPROVED);
859            appDocStatusMap.put(APPDOC_AUTO_APPROVED, APPDOC_AUTO_APPROVED);
860            appDocStatusMap.put(APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW, APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
861            appDocStatusMap.put(APPDOC_AWAITING_RECEIVING_REVIEW, APPDOC_AWAITING_RECEIVING_REVIEW);
862            appDocStatusMap.put(APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW, APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW);
863            appDocStatusMap.put(AWAIT_BUDGET_REVIEW, AWAIT_BUDGET_REVIEW);
864            appDocStatusMap.put(APPDOC_AWAITING_FISCAL_REVIEW, APPDOC_AWAITING_FISCAL_REVIEW);
865            appDocStatusMap.put(APPDOC_AWAITING_ORG_REVIEW, APPDOC_AWAITING_ORG_REVIEW);
866            appDocStatusMap.put(APPDOC_AWAITING_TAX_REVIEW, APPDOC_AWAITING_TAX_REVIEW);
867            appDocStatusMap.put(APPDOC_AWAITING_PAYMENT_REVIEW, APPDOC_AWAITING_PAYMENT_REVIEW);
868            appDocStatusMap.put(APPDOC_PENDING_E_INVOICE, APPDOC_PENDING_E_INVOICE);
869            appDocStatusMap.put(APPDOC_DAPRVD_BUDGET, APPDOC_DAPRVD_BUDGET);
870            appDocStatusMap.put(APPDOC_DAPRVD_PAYMENT, APPDOC_DAPRVD_PAYMENT);
871
872            return appDocStatusMap;
873        }
874
875        public static final String NODE_ADHOC_REVIEW = "AdHoc";
876        public static final String NODE_AWAITING_RECEIVING_REVIEW = "PurchaseWasReceived";
877        public static final String NODE_SUB_ACCOUNT_REVIEW = "SubAccount";
878        public static final String NODE_ACCOUNT_REVIEW = "Account";
879        public static final String NODE_ORG_REVIEW = "AccountingOrganizationHierarchy";
880        public static final String NODE_VENDOR_TAX_REVIEW = "Tax";
881        public static final String NODE_BUDGET_OFFICE_REVIEW = "Budget";
882        public static final String NODE_PAYMENT_OFFICE_REVIEW = "Payment";
883
884        // keep these in the order of potential routing
885        // Note it doesn't make much sense to compare auto_approved and dept_approved but this is
886        // easier than two enums plus this should primarily be used for user enterred areas
887        public enum STATUS_ORDER {
888            CANCELLED_IN_PROCESS(PurapConstants.InvoiceStatuses.APPDOC_CANCELLED_IN_PROCESS, false),
889            CANCELLED_POST_AP_APPROVE(PurapConstants.InvoiceStatuses.APPDOC_CANCELLED_POST_AP_APPROVE, false),
890            APPDOC_DAPRVD_BUDGET(PurapConstants.InvoiceStatuses.APPDOC_DAPRVD_BUDGET, false),
891            APPDOC_DAPRVD_PAYMENT(PurapConstants.InvoiceStatuses.APPDOC_DAPRVD_PAYMENT, false),
892            INITIATE(PurapConstants.InvoiceStatuses.APPDOC_INITIATE, true),
893            IN_PROCESS(PurapConstants.InvoiceStatuses.APPDOC_IN_PROCESS, true),
894            AWAITING_ACCOUNTS_PAYABLE_REVIEW(PurapConstants.InvoiceStatuses.APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW, false),
895            AWAITING_RECEIVING_REVIEW(PurapConstants.InvoiceStatuses.APPDOC_AWAITING_RECEIVING_REVIEW, false),
896            AWAITING_SUB_ACCT_MGR_REVIEW(PurapConstants.InvoiceStatuses.APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW, false),
897            AWAIT_BUDGET_REVIEW(
898                    PurapConstants.InvoiceStatuses.AWAIT_BUDGET_REVIEW, false),
899            AWAITING_FISCAL_REVIEW(PurapConstants.InvoiceStatuses.APPDOC_AWAITING_FISCAL_REVIEW, false),
900            AWAITING_ORG_REVIEW(PurapConstants.InvoiceStatuses.APPDOC_AWAITING_ORG_REVIEW, false),
901            AWAITING_TAX_REVIEW(PurapConstants.InvoiceStatuses.APPDOC_AWAITING_TAX_REVIEW, false),
902            AWAITING_PAYMENT_REVIEW(
903                    PurapConstants.InvoiceStatuses.APPDOC_AWAITING_PAYMENT_REVIEW, false),
904            DEPARTMENT_APPROVED(PurapConstants.InvoiceStatuses.APPDOC_DEPARTMENT_APPROVED, false),
905            AUTO_APPROVED(PurapConstants.InvoiceStatuses.APPDOC_AUTO_APPROVED, false),;
906
907            private String statusCode = new String();
908            private boolean fullEntryAllowed = false;
909
910            STATUS_ORDER(String statusCode, boolean fullEntry) {
911                this.statusCode = statusCode;
912                this.fullEntryAllowed = fullEntry;
913            }
914
915            public static STATUS_ORDER getByStatusCode(String statusCode) {
916                for (STATUS_ORDER status : STATUS_ORDER.values()) {
917                    if (StringUtils.equals(status.statusCode, statusCode)) {
918                        return status;
919                    }
920                }
921                return null;
922            }
923
924            public static boolean isFullDocumentEntryCompleted(String status) {
925                if (StringUtils.isNotBlank(status)) {
926                    return !getByStatusCode(status).fullEntryAllowed;
927                }
928                return false;
929            }
930
931            public static STATUS_ORDER getPreviousStatus(String statusCode) {
932                STATUS_ORDER statusOrder = STATUS_ORDER.getByStatusCode(statusCode);
933                if (statusOrder.ordinal() > 0) {
934                    return STATUS_ORDER.values()[statusOrder.ordinal() - 1];
935                }
936                return null;
937            }
938
939            public static boolean isFirstFullEntryStatus(String statusCode) {
940                // NOTE this won't work if there endsup being two ways to get to the first full entry status (i.e. like AUTO/DEPT
941                // for final)
942                return getByStatusCode(statusCode).fullEntryAllowed && !getPreviousStatus(statusCode).fullEntryAllowed;
943            }
944        }
945
946
947        public static final String[] PRQS_STATUSES_FOR_AUTO_APPROVE = {
948                APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW,
949                AWAIT_BUDGET_REVIEW,
950                APPDOC_AWAITING_FISCAL_REVIEW,
951                APPDOC_AWAITING_ORG_REVIEW,
952                APPDOC_AWAITING_PAYMENT_REVIEW};
953
954        public static final String[] STATUSES_ALLOWED_FOR_EXTRACTION = {APPDOC_AUTO_APPROVED, APPDOC_DEPARTMENT_APPROVED};
955
956        public static final String[] STATUSES_POTENTIALLY_ACTIVE = {
957                APPDOC_IN_PROCESS,
958                APPDOC_DEPARTMENT_APPROVED,
959                APPDOC_AUTO_APPROVED,
960                APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW,
961                APPDOC_AWAITING_RECEIVING_REVIEW,
962                APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW,
963                AWAIT_BUDGET_REVIEW,
964                APPDOC_AWAITING_FISCAL_REVIEW,
965                APPDOC_AWAITING_ORG_REVIEW,
966                APPDOC_AWAITING_TAX_REVIEW,
967                APPDOC_AWAITING_PAYMENT_REVIEW};
968
969        public static final Set CANCELLED_STATUSES = new HashSet();
970        public static final Set STATUSES_DISALLOWING_HOLD = new HashSet();
971        public static final Set STATUSES_DISALLOWING_REMOVE_HOLD = new HashSet();
972        public static final Set STATUSES_DISALLOWING_REQUEST_CANCEL = new HashSet();
973        public static final Set STATUSES_DISALLOWING_REMOVE_REQUEST_CANCEL = new HashSet();
974        public static final Set STATUSES_PREROUTE = new HashSet();
975        public static final Set STATUSES_ENROUTE = new HashSet();
976        public static final Set STATUSES_POSTROUTE = new HashSet();
977
978        static {
979            CANCELLED_STATUSES.add(APPDOC_CANCELLED_IN_PROCESS);
980            CANCELLED_STATUSES.add(APPDOC_CANCELLED_POST_AP_APPROVE);
981            CANCELLED_STATUSES.add(APPDOC_DAPRVD_BUDGET);
982            CANCELLED_STATUSES.add(APPDOC_DAPRVD_PAYMENT);
983            STATUSES_DISALLOWING_HOLD.add(APPDOC_INITIATE);
984            STATUSES_DISALLOWING_HOLD.add(APPDOC_IN_PROCESS);
985            STATUSES_DISALLOWING_HOLD.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
986
987            STATUSES_DISALLOWING_REMOVE_HOLD.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
988
989            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_INITIATE);
990            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_IN_PROCESS);
991            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_DEPARTMENT_APPROVED);
992            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_AUTO_APPROVED);
993            STATUSES_DISALLOWING_REQUEST_CANCEL.add(APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
994            STATUSES_DISALLOWING_REQUEST_CANCEL.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
995
996            STATUSES_DISALLOWING_REMOVE_REQUEST_CANCEL.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
997
998            STATUSES_PREROUTE.add(APPDOC_IN_PROCESS);
999            STATUSES_PREROUTE.add(APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
1000
1001            STATUSES_ENROUTE.add(APPDOC_AWAITING_SUB_ACCT_MGR_REVIEW);
1002            STATUSES_ENROUTE.add(APPDOC_AWAITING_FISCAL_REVIEW);
1003            STATUSES_ENROUTE.add(APPDOC_AWAITING_ORG_REVIEW);
1004            STATUSES_ENROUTE.add(APPDOC_AWAITING_TAX_REVIEW);
1005            STATUSES_ENROUTE.add(APPDOC_AWAITING_PAYMENT_REVIEW);
1006
1007            STATUSES_POSTROUTE.add(APPDOC_DEPARTMENT_APPROVED);
1008            STATUSES_POSTROUTE.add(APPDOC_AUTO_APPROVED);
1009        }
1010
1011        public static final HashMap<String, String> getInvoiceAppDocDisapproveStatuses() {
1012
1013            HashMap<String, String> appDocStatusMap = new HashMap<String, String>();
1014
1015            appDocStatusMap.put(NODE_ADHOC_REVIEW, InvoiceStatuses.APPDOC_CANCELLED_IN_PROCESS);
1016            appDocStatusMap.put(AWAIT_BUDGET_REVIEW, InvoiceStatuses.NODE_BUDGET_OFFICE_REVIEW);
1017            appDocStatusMap.put(APPDOC_AWAITING_PAYMENT_REVIEW, InvoiceStatuses.NODE_PAYMENT_OFFICE_REVIEW);
1018            appDocStatusMap.put(AccountsPayableStatuses.NODE_ACCOUNT_PAYABLE_REVIEW, InvoiceStatuses.APPDOC_CANCELLED_IN_PROCESS);
1019            appDocStatusMap.put(NODE_AWAITING_RECEIVING_REVIEW, InvoiceStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
1020            appDocStatusMap.put(NODE_SUB_ACCOUNT_REVIEW, InvoiceStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
1021            appDocStatusMap.put(NODE_ACCOUNT_REVIEW, InvoiceStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
1022            appDocStatusMap.put(NODE_ORG_REVIEW, InvoiceStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
1023            appDocStatusMap.put(NODE_VENDOR_TAX_REVIEW, InvoiceStatuses.APPDOC_CANCELLED_POST_AP_APPROVE);
1024            appDocStatusMap.put(InvoiceStatuses.NODE_BUDGET_OFFICE_REVIEW, InvoiceStatuses.APPDOC_DAPRVD_BUDGET);
1025            appDocStatusMap.put(InvoiceStatuses.NODE_PAYMENT_OFFICE_REVIEW, InvoiceStatuses.APPDOC_DAPRVD_PAYMENT);
1026
1027
1028            return appDocStatusMap;
1029
1030        }
1031
1032
1033        public static final List<String> getNodesRequiringCorrectingGeneralLedgerEntries() {
1034
1035            List<String> returnList = new ArrayList<String>();
1036
1037            returnList.add(NODE_ACCOUNT_REVIEW);
1038            returnList.add(NODE_VENDOR_TAX_REVIEW);
1039
1040            return returnList;
1041        }
1042        
1043        public static final Set<String> INCOMPLETE_STATUSES = new HashSet<String>();
1044        public static final Set<String> COMPLETE_STATUSES = new HashSet<String>();
1045
1046        static {
1047            INCOMPLETE_STATUSES.add(AWAIT_BUDGET_REVIEW);
1048            COMPLETE_STATUSES.add(APPDOC_DAPRVD_BUDGET);
1049            INCOMPLETE_STATUSES.add(APPDOC_AWAITING_PAYMENT_REVIEW);
1050            COMPLETE_STATUSES.add(APPDOC_DAPRVD_PAYMENT);
1051        }
1052
1053    }
1054
1055    public static class LineItemReceivingDocumentStrings {
1056        public static final String DUPLICATE_RECEIVING_LINE_QUESTION = "DuplicateReceivingLine";
1057        public static final String VENDOR_DATE = "Vendor Date";
1058        public static final String AWAITING_PO_OPEN_STATUS = "OutstandingTransactions";
1059        public static final String JOIN_NODE = "Join";
1060        public static final String CUSTOMER_INVOICE_DETAIL_UOM_DEFAULT = "EA"; //TODO: System parameter?
1061    }
1062
1063    public static class LineItemReceivingStatuses {
1064        public static final String APPDOC_IN_PROCESS = "In Process";
1065        public static final String APPDOC_AWAITING_PO_OPEN_STATUS = "Awaiting Purchase Order Open Status";
1066        public static final String APPDOC_COMPLETE = "Complete";
1067        public static final String APPDOC_CANCELLED = "Cancelled";
1068    }
1069
1070    public static class CorrectionReceivingDocumentStrings {
1071        public static final String NOTE_QUESTION = "CorrectionReceivingNote";
1072        public static final String NOTE_PREFIX = "Note entered while creating Correction Receiving: ";
1073        public static final String CORRECTION_RECEIVING_DOCUMENT_TYPE_NAME = "CorrectionReceiving";
1074        public static final String CORRECTION_RECEIVING_CREATION_NOTE_PARAMETER = "CorrectionReceivingNoteParameter";
1075    }
1076
1077    public static class BulkReceivingDocumentStrings {
1078        public static final String DUPLICATE_BULK_RECEIVING_DOCUMENT_QUESTION = "DuplicateBulkReceiving";
1079        public static final String VENDOR_DATE = "Vendor Date";
1080        public static final String MESSAGE_BULK_RECEIVING_DEFAULT_DOC_DESCRIPTION = "Not associated with a PO";
1081    }
1082
1083    public static class PREQDocumentsStrings {
1084        public static final String DUPLICATE_INVOICE_QUESTION = "PREQDuplicateInvoice";
1085        public static final String HOLD_PREQ_QUESTION = "HoldPREQ";
1086        public static final String CONFIRM_HOLD_QUESTION = "ConfirmHold";
1087        public static final String HOLD_NOTE_PREFIX = "Note entered while placing Payment Request on hold : ";
1088        public static final String REMOVE_HOLD_PREQ_QUESTION = "RemoveHoldPREQ";
1089        public static final String CONFIRM_REMOVE_HOLD_QUESTION = "ConfirmRemoveHold";
1090        public static final String REMOVE_HOLD_NOTE_PREFIX = "Note entered while removing a hold on Payment Request : ";
1091        public static final String CANCEL_PREQ_QUESTION = "CancelPREQ";
1092        public static final String CONFIRM_CANCEL_QUESTION = "ConfirmCancel";
1093        public static final String CANCEL_NOTE_PREFIX = "Note entered while requesting cancel on Payment Request : ";
1094        public static final String REMOVE_CANCEL_PREQ_QUESTION = "RemoveCancelPREQ";
1095        public static final String CONFIRM_REMOVE_CANCEL_QUESTION = "ConfirmRemoveCancel";
1096        public static final String REMOVE_CANCEL_NOTE_PREFIX = "Note entered while removing a request cancel on Payment Request : ";
1097        public static final String PURCHASE_ORDER_ID = "Purchase Order Identifier";
1098        public static final String INVOICE_DATE = "Invoice Date";
1099        public static final String INVOICE_NUMBER = "Invoice Number";
1100        public static final String IN_PROCESS = "In Process";
1101        public static final String THRESHOLD_DAYS_OVERRIDE_QUESTION = "Threshold Days Override Question";
1102        public static final String UNUSED_TRADE_IN_QUESTION = "There is an unused trade in amount from PO that you could apply to line item; are you sure you want to proceed ?";
1103        public static final String EXPIRED_ACCOUNT_QUESTION = "There is an expired account on the document; do you want to continue ?";
1104        public static final String ENCUMBER_NEXT_FISCAL_YEAR_QUESTION = "Encumber Next Fiscal Year Question";
1105        public static final String ENCUMBER_PRIOR_FISCAL_YEAR_QUESTION = "Encumber Prior Fiscal Year Question";
1106        public static final String VENDOR_INVOICE_AMOUNT = "Vendor Invoice Amount";
1107        public static final String VENDOR_STATE = "State";
1108        public static final String VENDOR_POSTAL_CODE = "Postal Code";
1109    }
1110
1111    public static class PRQSDocumentsStrings {
1112        public static final String DUPLICATE_INVOICE_QUESTION = "PRQSDuplicateInvoice";
1113        public static final String HOLD_PRQS_QUESTION = "HoldPRQS";
1114        public static final String CONFIRM_HOLD_QUESTION = "ConfirmHold";
1115        public static final String HOLD_NOTE_PREFIX = "Note entered while placing Payment Request on hold : ";
1116        public static final String REMOVE_HOLD_PRQS_QUESTION = "RemoveHoldPRQS";
1117        public static final String CONFIRM_REMOVE_HOLD_QUESTION = "ConfirmRemoveHold";
1118        public static final String REMOVE_HOLD_NOTE_PREFIX = "Note entered while removing a hold on Payment Request : ";
1119        public static final String CANCEL_PRQS_QUESTION = "CancelPRQS";
1120        public static final String CONFIRM_CANCEL_QUESTION = "ConfirmCancel";
1121        public static final String CANCEL_NOTE_PREFIX = "Note entered while requesting cancel on Payment Request : ";
1122        public static final String REMOVE_CANCEL_PRQS_QUESTION = "RemoveCancelPRQS";
1123        public static final String CONFIRM_REMOVE_CANCEL_QUESTION = "ConfirmRemoveCancel";
1124        public static final String REMOVE_CANCEL_NOTE_PREFIX = "Note entered while removing a request cancel on Payment Request : ";
1125        public static final String PURCHASE_ORDER_ID = "Purchase Order Identifier";
1126        public static final String INVOICE_DATE = "Invoice Date";
1127        public static final String INVOICE_NUMBER = "Invoice Number";
1128        public static final String IN_PROCESS = "In Process";
1129        public static final String THRESHOLD_DAYS_OVERRIDE_QUESTION = "Threshold Days Override Question";
1130        public static final String UNUSED_TRADE_IN_QUESTION = "There is an unused trade in amount from PO that you could apply to line item; are you sure you want to proceed ?";
1131        public static final String EXPIRED_ACCOUNT_QUESTION = "There is an expired account on the document; do you want to continue ?";
1132        public static final String ENCUMBER_NEXT_FISCAL_YEAR_QUESTION = "Encumber Next Fiscal Year Question";
1133        public static final String ENCUMBER_PRIOR_FISCAL_YEAR_QUESTION = "Encumber Prior Fiscal Year Question";
1134        public static final String VENDOR_INVOICE_AMOUNT = "Vendor Invoice Amount";
1135        public static final String VENDOR_STATE = "State";
1136        public static final String VENDOR_POSTAL_CODE = "Postal Code";
1137        public static final String PO_ID = "purchaseOrderIdentifier";
1138        public static final String INV_ID = "invoiceIdentifier";
1139        public static final String PUR_ID = "purapDocumentIdentifier";
1140
1141    }
1142
1143    public static final String BELOW_THE_LINES_PARAMETER = "ADDITIONAL_CHARGES_ITEM_TYPES";
1144    public static final String ITEM_ALLOWS_ZERO = "ITEM_TYPES_ALLOWING_ZERO";
1145    public static final String ITEM_ALLOWS_POSITIVE = "ITEM_TYPES_ALLOWING_POSITIVE";
1146    public static final String ITEM_ALLOWS_NEGATIVE = "ITEM_TYPES_ALLOWING_NEGATIVE";
1147    public static final String ITEM_REQUIRES_USER_ENTERED_DESCRIPTION = "ITEM_TYPES_REQUIRING_USER_ENTERED_DESCRIPTION";
1148
1149    public static class ItemFields {
1150        public static final String QUANTITY = "Quantity";
1151        public static final String UNIT_OF_MEASURE = "Unit of Measure";
1152        public static final String DESCRIPTION = "Description";
1153        public static final String UNIT_COST = "Unit Cost";
1154        public static final String INVOICE_QUANTITY = "Qty Invoiced";
1155        public static final String OPEN_QUANTITY = "Open Qty";
1156        public static final String INVOICE_EXTENDED_PRICE = "Total Inv Cost";
1157        public static final String COMMODITY_CODE = "Commodity Code";
1158    }
1159
1160    // ELECTRONIC INVOICE REJECT DOCUMENT
1161    public static final String ELECTROINC_INVOICE_REJECT_ACTION_NAME = "ElectronicInvoiceReject";
1162    public static final String REJECT_DOCUMENT_RESEARCH_INCOMPETE = "errors.reject.docucument.research.incomplete";
1163
1164    // CREDIT MEMO DOCUMENT
1165    public static final String CREDIT_MEMO_ACTION_NAME = "VendorCreditMemo";
1166
1167    public static class CreditMemoStatuses {
1168        public static final String APPDOC_INITIATE = "Initiated";
1169        public static final String APPDOC_IN_PROCESS = "In Process";
1170        public static final String APPDOC_CANCELLED_IN_PROCESS = "Cancelled In Process";
1171        public static final String APPDOC_CANCELLED_PRIOR_TO_AP_APPROVAL = "Void";
1172        public static final String APPDOC_CANCELLED_POST_AP_APPROVE = "Cancelled";
1173        public static final String APPDOC_COMPLETE = "Complete";
1174        public static final String APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW = "Awaiting AP Review"; // Waiting for Accounts Payable approval
1175
1176        public static HashMap<String, String> getAllAppDocStatuses() {
1177            HashMap<String, String> appDocStatusMap = new HashMap<String, String>();
1178
1179            appDocStatusMap.put(APPDOC_INITIATE, APPDOC_INITIATE);
1180            appDocStatusMap.put(APPDOC_IN_PROCESS, APPDOC_IN_PROCESS);
1181            appDocStatusMap.put(APPDOC_CANCELLED_IN_PROCESS, APPDOC_CANCELLED_IN_PROCESS);
1182            appDocStatusMap.put(APPDOC_CANCELLED_PRIOR_TO_AP_APPROVAL, APPDOC_CANCELLED_PRIOR_TO_AP_APPROVAL);
1183            appDocStatusMap.put(APPDOC_CANCELLED_POST_AP_APPROVE, APPDOC_CANCELLED_POST_AP_APPROVE);
1184            appDocStatusMap.put(APPDOC_COMPLETE, APPDOC_COMPLETE);
1185            appDocStatusMap.put(APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW, APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
1186
1187            return appDocStatusMap;
1188        }
1189
1190        public static final String NODE_ADHOC_REVIEW = "AdHoc";
1191        public static final String NODE_ACCOUNT_REVIEW = "Account";
1192
1193        public enum STATUS_ORDER {
1194            CANCELLED_IN_PROCESS(PurapConstants.CreditMemoStatuses.APPDOC_CANCELLED_IN_PROCESS, false), CANCELLED_PRIOR_TO_AP_APPROVAL(PurapConstants.CreditMemoStatuses.APPDOC_CANCELLED_PRIOR_TO_AP_APPROVAL, false), CANCELLED_POST_AP_APPROVE(PurapConstants.CreditMemoStatuses.APPDOC_CANCELLED_POST_AP_APPROVE, false), INITIATE(PurapConstants.CreditMemoStatuses.APPDOC_INITIATE, true), IN_PROCESS(PurapConstants.CreditMemoStatuses.APPDOC_IN_PROCESS, true), AWAITING_ACCOUNTS_PAYABLE_REVIEW(PurapConstants.CreditMemoStatuses.APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW, false), COMPLETE(PurapConstants.CreditMemoStatuses.APPDOC_COMPLETE, false),;
1195
1196            private String statusCode = new String();
1197            private boolean fullEntryAllowed = false;
1198
1199            STATUS_ORDER(String statusCode, boolean fullEntry) {
1200                this.statusCode = statusCode;
1201                this.fullEntryAllowed = fullEntry;
1202            }
1203
1204            public static STATUS_ORDER getByStatusCode(String statusCode) {
1205                for (STATUS_ORDER status : STATUS_ORDER.values()) {
1206                    if (StringUtils.equals(status.statusCode, statusCode)) {
1207                        return status;
1208                    }
1209                }
1210                return null;
1211            }
1212
1213            public static boolean isFullDocumentEntryCompleted(String status) {
1214                return !getByStatusCode(status).fullEntryAllowed;
1215            }
1216
1217            public static STATUS_ORDER getPreviousStatus(String statusCode) {
1218                STATUS_ORDER statusOrder = STATUS_ORDER.getByStatusCode(statusCode);
1219                if (statusOrder.ordinal() > 0) {
1220                    return STATUS_ORDER.values()[statusOrder.ordinal() - 1];
1221                }
1222                return null;
1223            }
1224
1225            public static boolean isFirstFullEntryStatus(String statusCode) {
1226                // NOTE this won't work if there endsup being two ways to get to the first full entry status (i.e. like AUTO/DEPT
1227                // for final)
1228                return getByStatusCode(statusCode).fullEntryAllowed && !getPreviousStatus(statusCode).fullEntryAllowed;
1229            }
1230        }
1231
1232        public static final String[] STATUSES_ALLOWED_FOR_EXTRACTION = {APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW, APPDOC_COMPLETE};
1233
1234        public static final String[] STATUSES_POTENTIALLY_ACTIVE = {APPDOC_IN_PROCESS, APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW};
1235
1236        public static final Set CANCELLED_STATUSES = new HashSet();
1237        public static final Set STATUSES_DISALLOWING_HOLD = new HashSet();
1238        public static final Set STATUSES_NOT_REQUIRING_ENTRY_REVERSAL = new HashSet();
1239
1240        static {
1241            CANCELLED_STATUSES.add(APPDOC_CANCELLED_IN_PROCESS);
1242            CANCELLED_STATUSES.add(APPDOC_CANCELLED_PRIOR_TO_AP_APPROVAL);
1243            CANCELLED_STATUSES.add(APPDOC_CANCELLED_POST_AP_APPROVE);
1244
1245            STATUSES_DISALLOWING_HOLD.add(APPDOC_INITIATE);
1246            STATUSES_DISALLOWING_HOLD.add(APPDOC_IN_PROCESS);
1247            STATUSES_DISALLOWING_HOLD.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
1248
1249            STATUSES_NOT_REQUIRING_ENTRY_REVERSAL.add(APPDOC_INITIATE);
1250            STATUSES_NOT_REQUIRING_ENTRY_REVERSAL.add(APPDOC_IN_PROCESS);
1251            STATUSES_NOT_REQUIRING_ENTRY_REVERSAL.addAll(Arrays.asList(CANCELLED_STATUSES.toArray(new String[CANCELLED_STATUSES.size()])));
1252        }
1253
1254        public static final HashMap<String, String> getCreditMemoAppDocDisapproveStatuses() {
1255
1256            HashMap<String, String> appDocStatusMap = new HashMap<String, String>();
1257
1258            appDocStatusMap.put(NODE_ADHOC_REVIEW, APPDOC_CANCELLED_IN_PROCESS);
1259            appDocStatusMap.put(AccountsPayableStatuses.NODE_ACCOUNT_PAYABLE_REVIEW, APPDOC_CANCELLED_PRIOR_TO_AP_APPROVAL);
1260            appDocStatusMap.put(NODE_ACCOUNT_REVIEW, APPDOC_CANCELLED_POST_AP_APPROVE);
1261
1262            return appDocStatusMap;
1263
1264        }
1265
1266    }
1267
1268    public static class CMDocumentsStrings {
1269        public static final String DUPLICATE_CREDIT_MEMO_QUESTION = "CMDuplicateInvoice";
1270        public static final String HOLD_CM_QUESTION = "HoldCM";
1271        public static final String HOLD_NOTE_PREFIX = "Note entered while placing Credit Memo on hold: ";
1272        public static final String CANCEL_CM_QUESTION = "CancelCM";
1273        public static final String REMOVE_HOLD_CM_QUESTION = "RemoveCM";
1274        public static final String REMOVE_HOLD_NOTE_PREFIX = "Note entered while removing hold on Credit Memo: ";
1275    }
1276
1277    public static final class CREDIT_MEMO_TYPE_LABELS {
1278        public static final String TYPE_PO = "PO";
1279        public static final String TYPE_PREQ = "PREQ";
1280        public static final String TYPE_VENDOR = "Vendor";
1281
1282    }
1283
1284    private static final HashMap<String, Class> uncopyableFields() {
1285        HashMap<String, Class> fields = new HashMap<String, Class>();
1286        fields.put(OLEConstants.VERSION_NUMBER, null);
1287        fields.put("LOG", null);
1288        fields.put(OLEPropertyConstants.GENERAL_LEDGER_PENDING_ENTRIES, null);
1289        fields.put(PurapPropertyConstants.CAPITAL_ASSET_ITEM_IDENTIFIER, null);
1290        fields.put(PurapPropertyConstants.CAPITAL_ASSET_SYSTEM_IDENTIFIER, null);
1291        fields.put("serialVersionUID", null);
1292        return fields;
1293    }
1294
1295    /*
1296     * Fields that shouldn't be copied by our reflective copy method. This should only contain fields that are known throughout
1297     * objects not item/doc specific ones
1298     */
1299    public static final HashMap<String, Class> KNOWN_UNCOPYABLE_FIELDS = uncopyableFields();
1300
1301    private static final HashMap<String, Class> uncopyableItemFields() {
1302        HashMap<String, Class> fields = new HashMap<String, Class>();
1303        fields.put(PurapPropertyConstants.ITEM_IDENTIFIER, null);
1304        fields.put(PurapPropertyConstants.ACCOUNTS, null);
1305        return fields;
1306    }
1307
1308    /*
1309     * Fields that shouldn't be copied by our reflective copy method. This should only contain fields that are known throughout
1310     * objects not item/doc specific ones
1311     */
1312    public static final HashMap<String, Class> ITEM_UNCOPYABLE_FIELDS = uncopyableItemFields();
1313
1314    private static final HashMap<String, Class> uncopyablePREQItemFields() {
1315        HashMap<String, Class> fields = new HashMap<String, Class>(ITEM_UNCOPYABLE_FIELDS);
1316        fields.put(PurapPropertyConstants.QUANTITY, null);
1317        fields.put(PurapPropertyConstants.EXTENDED_PRICE, null);
1318        fields.put(PurapPropertyConstants.ITEM_TAX_AMOUNT, null);
1319        fields.put(PurapPropertyConstants.ITEM_SALES_TAX_AMOUNT, null);
1320        return fields;
1321    }
1322
1323    /*
1324     * fields that shouldn't be copied on PREQ item
1325     */
1326    public static final HashMap<String, Class> PREQ_ITEM_UNCOPYABLE_FIELDS = uncopyablePREQItemFields();
1327
1328    public static final Map<String, Class> uncopyableFieldsForPurchaseOrder() {
1329        Map<String, Class> returnMap = new HashMap<String, Class>();
1330        returnMap.put(OLEPropertyConstants.DOCUMENT_NUMBER, null);
1331        returnMap.put(PurapPropertyConstants.ITEM_IDENTIFIER, PurchaseOrderItem.class);
1332        returnMap.put(PurapPropertyConstants.ACCOUNT_IDENTIFIER, PurchaseOrderAccount.class);
1333        returnMap.put(PurapPropertyConstants.PURCHASE_ORDER_VENDOR_QUOTE_IDENTIFIER, PurchaseOrderVendorQuote.class);
1334        returnMap.put("relatedRequisitionViews", PurchasingAccountsPayableDocumentBase.class);
1335        returnMap.put("relatedPurchaseOrderViews", PurchasingAccountsPayableDocumentBase.class);
1336        returnMap.put("relatedPaymentRequestViews", PurchasingAccountsPayableDocumentBase.class);
1337        returnMap.put("relatedInvoiceViews", PurchasingAccountsPayableDocumentBase.class);
1338        returnMap.put("relatedCreditMemoViews", PurchasingAccountsPayableDocumentBase.class);
1339        returnMap.put("paymentHistoryPaymentRequestViews", PurchasingAccountsPayableDocumentBase.class);
1340        returnMap.put("paymentHistoryCreditMemoViews", PurchasingAccountsPayableDocumentBase.class);
1341        returnMap.put("paymentHistoryInvoiceViews", PurchasingAccountsPayableDocumentBase.class);
1342        return returnMap;
1343    }
1344
1345    public static final Map<String, Class> UNCOPYABLE_FIELDS_FOR_PO = uncopyableFieldsForPurchaseOrder();
1346
1347    public static final Map<String, Class<?>> uncopyableFieldsForSplitPurchaseOrder() {
1348        Map<String, Class<?>> returnMap = new HashMap<String, Class<?>>();
1349        returnMap.put(OLEPropertyConstants.DOCUMENT_HEADER, null);
1350        returnMap.put(PurapPropertyConstants.PURAP_DOC_ID, null);        // We need to have a new PO ID.
1351        returnMap.put(PurapPropertyConstants.ITEMS, null);               // Items (including additional charges) are to be excluded from the copy.
1352        returnMap.put(PurapPropertyConstants.PURCHASE_ORDER_VENDOR_QUOTES, null);
1353        returnMap.put(PurapPropertyConstants.PURCHASE_ORDER_QUOTE_INITIALIZATION_DATE, null);
1354        returnMap.put(PurapPropertyConstants.PURCHASE_ORDER_QUOTE_AWARDED_DATE, null);
1355        returnMap.put(PurapPropertyConstants.PURCHASE_ORDER_QUOTE_DUE_DATE, null);
1356        returnMap.put(PurapPropertyConstants.PURCHASE_ORDER_QUOTE_TYPE_CODE, null);
1357        returnMap.put(PurapPropertyConstants.PURCHASE_ORDER_QUOTE_VENDOR_NOTE_TEXT, null);
1358        return returnMap;
1359    }
1360
1361    public static final Map<String, Class<?>> UNCOPYABLE_FIELDS_FOR_SPLIT_PO = uncopyableFieldsForSplitPurchaseOrder();
1362
1363    @Deprecated // this should be removed - use the central definition in OLEConstants
1364    public static final String PURAP_ORIGIN_CODE = "01";
1365
1366    @Deprecated // this is mostly a duplication of an earlier subclass
1367    public static final class PurapDocTypeCodes {
1368        public static final String PAYMENT_REQUEST_DOCUMENT = "OLE_PREQ";
1369        public static final String INVOICE_DOCUMENT = "OLE_PRQS";
1370        public static final String CREDIT_MEMO_DOCUMENT = "OLE_CM";
1371        public static final String PO_DOCUMENT = "OLE_PO";
1372        public static final String PO_AMENDMENT_DOCUMENT = "OLE_POA";
1373        public static final String PO_CLOSE_DOCUMENT = "OLE_POC";
1374        public static final String PO_REOPEN_DOCUMENT = "OLE_POR";
1375        public static final String PO_VOID_DOCUMENT = "OLE_POV";
1376    }
1377
1378    public static final Integer PRORATION_SCALE = new Integer(6);
1379    public static final Integer CREDITMEMO_PRORATION_SCALE = new Integer(20);
1380
1381    @Deprecated // This information needs to be looked up from the DD
1382    private static HashMap<String, String> getPurapParameterDetailTypeCodes() {
1383        HashMap<String, String> map;
1384        map = new HashMap<String, String>();
1385        map.put("OLE_REQS", RequisitionDocument.class.getName());
1386        map.put("OLE_PO", PurchaseOrderDocument.class.getName());
1387        map.put("OLE_POC", PurchaseOrderDocument.class.getName());
1388        map.put("OLE_POR", PurchaseOrderDocument.class.getName());
1389        map.put("OLE_POA", PurchaseOrderDocument.class.getName());
1390        map.put("OLE_POPH", PurchaseOrderDocument.class.getName());
1391        map.put("OLE_PORH", PurchaseOrderDocument.class.getName());
1392        map.put("OLE_PORT", PurchaseOrderDocument.class.getName());
1393        map.put("OLE_POV", PurchaseOrderDocument.class.getName());
1394        map.put("OLE_POSP", PurchaseOrderDocument.class.getName());
1395        map.put("OLE_PREQ", PaymentRequestDocument.class.getName());
1396        map.put("OLE_PRQS", InvoiceDocument.class.getName());
1397        map.put("OLE_CM", VendorCreditMemoDocument.class.getName());
1398        return map;
1399    }
1400
1401    public static final HashMap<String, String> PURAP_DETAIL_TYPE_CODE_MAP = getPurapParameterDetailTypeCodes();
1402
1403    public static class CapitalAssetTabStrings {
1404        public static final String SYSTEM_DEFINITION = "Definition: A system is any group of line items added together to create one or more identical assets. Systems are further defined as line items that work together to perform one function. Each of the line items must be necessary for the system to function.";
1405
1406        public static final String INDIVIDUAL_ASSETS = "IND";
1407        public static final String ONE_SYSTEM = "ONE";
1408        public static final String MULTIPLE_SYSTEMS = "MUL";
1409        public static final String INDIVIDUAL_ASSETS_DESC = "Each of the lines will be capitalized as INDIVIDUAL ASSETS.";
1410        public static final String ONE_SYSTEM_DESC = "Line items are being added together to create ONE SYSTEM.";
1411        public static final String MULTIPLE_SYSTEMS_DESC = "Any of the line items will be added together to create MULTIPLE SYSTEMS.";
1412        public static final String ASSET_DATA = "Asset data is on Item Tab.";
1413
1414        public static final String QUESTION_SYSTEM_SWITCHING = "question.document.pur.systemTypeSwitching";
1415        public static final String SYSTEM_SWITCHING_QUESTION = "SystemSwitchingQuestion";
1416    }
1417
1418    public static class NamedDateFormats {
1419        public static String CXML_DATE_FORMAT = "CXML_DATE_FORMAT";
1420        public static String CXML_SIMPLE_DATE_FORMAT = "CXML_SIMPLE_DATE_FORMAT";
1421        public static String CXML_SIMPLE_TIME_FORMAT = "CXML_SIMPLE_TIME_FORMAT";
1422        public static String KUALI_DATE_FORMAT = "KUALI_DATE_FORMAT";
1423        public static String KUALI_SIMPLE_DATE_FORMAT = "KUALI_SIMPLE_DATE_FORMAT";
1424        public static String KUALI_SIMPLE_DATE_FORMAT_2 = "KUALI_SIMPLE_DATE_FORMAT_2";
1425
1426    }
1427
1428    /**
1429     * Electronic Invoice Constants
1430     */
1431    public static class ElectronicInvoice {
1432        public static String NO_FILES_PROCESSED_EMAIL_MESSAGE = "No invoice files were processed today. " + "The developers will send notification if this was an error with the load process.";
1433
1434        public static String[] ITEM_TYPES_REQUIRES_DESCRIPTION = {PurapConstants.ItemTypeCodes.ITEM_TYPE_ITEM_CODE,
1435                PurapConstants.ItemTypeCodes.ITEM_TYPE_MISC_CODE};
1436
1437        // ELECTRONIC INVOICE REJECT REASON TYPE CODES
1438        public static String REJECT_REASON_TYPE_FILE = "FILE";
1439        public static String REJECT_REASON_TYPE_ORDER = "INVC";
1440
1441        // ELECTRONIC INVOICE CXML DEPLOYMENT MODE CODE FOR PRODUCTION
1442        public static String CXML_DEPLOYMENT_MODE_PRODUCTION = "production";
1443
1444        // ELECTRONIC INVOICE SHIPPING DESCRIPTION
1445        public static String SHIPPING_DESCRIPTION = "Electronic Invoice Shipping";
1446        public static String DEFAULT_BELOW_LINE_ITEM_DESCRIPTION = "Electronically entered amount";
1447
1448        public final static String DEFAULT_SHIPPING_DESCRIPTION = "Shipping";
1449        public final static String DEFAULT_SPECIAL_HANDLING_DESCRIPTION = "Handling";
1450
1451        public static String CXML_ADDRESS_SHIP_TO_ROLE_ID = "shipTo";
1452        public static String CXML_ADDRESS_BILL_TO_ROLE_ID = "billTo";
1453        public static String CXML_ADDRESS_REMIT_TO_ROLE_ID = "remitTo";
1454
1455        // name of our default address name we use (null for first available)
1456        public static String CXML_ADDRESS_SHIP_TO_NAME = null;
1457        public static String CXML_ADDRESS_BILL_TO_NAME = null;
1458        public static String CXML_ADDRESS_REMIT_TO_NAME = null;
1459
1460        /**
1461         * Here is a list of reject reason type codes
1462         */
1463        public final static String DUNS_INVALID = "INDU";
1464        public final static String INVOICE_ID_EMPTY = "IIDE";
1465        public final static String INVOICE_DATE_GREATER = "IDAG";
1466        public final static String INVOICE_DATE_INVALID = "IDIV";
1467        public final static String INFORMATION_ONLY = "INFO";
1468        public final static String FILE_FORMAT_INVALID = "INFF";
1469        public final static String HEADER_INVOICE_IND_ON = "HIIO";
1470        public final static String INVOICE_ORDERS_NOT_FOUND = "NOIV";
1471        public final static String DUNS_NOT_FOUND = "NODU";
1472        public final static String ITEM_MAPPING_NOT_AVAILABLE = "IMNA";
1473        public final static String DISCOUNT_SUMMARY_AMT_MISMATCH = "DSAM";
1474        public final static String SPL_HANDLING_SUMMARY_AMT_MISMATCH = "SSAM";
1475        public final static String SHIPPING_SUMMARY_AMT_MISMATCH = "SHSA";
1476        public final static String ITEM_TYPE_NAME_NOT_AVAILABLE = "ITNA";
1477        public final static String INVALID_NUMBER_FORMAT = "NFEX";
1478        public final static String PO_ID_EMPTY = "POIE";
1479        public final static String PO_ID_INVALID_FORMAT = "POII";
1480        public final static String PO_NOT_EXISTS = "PONE";
1481        public final static String PO_VENDOR_NOT_MATCHES_WITH_INVOICE_VENDOR = "PVNM";
1482        public final static String PO_NOT_OPEN = "PONO";
1483        public final static String NO_MATCHING_PO_ITEM = "IMLI";
1484        public final static String DUPLIATE_INVOICE_LINE_ITEM = "ICSL";
1485        public final static String INACTIVE_LINE_ITEM = "ILIA";
1486        public final static String CATALOG_NUMBER_MISMATCH = "IICN";
1487        public final static String UNIT_OF_MEASURE_MISMATCH = "IUOM";
1488        public final static String OUTSTANDING_ENCUMBERED_QTY_AVAILABLE = "UEOQ";
1489        public final static String INVOICE_QTY_EMPTY = "IIQE";
1490        public final static String PO_ITEM_QTY_LESSTHAN_INVOICE_ITEM_QTY = "PILI";
1491        public final static String OUTSTANDING_ENCUMBERED_AMT_AVAILABLE = "UEAA";
1492        public final static String PO_ITEM_AMT_LESSTHAN_INVOICE_ITEM_AMT = "PAIA";
1493        public final static String PO_COST_SOURCE_EMPTY = "CSEM";
1494        public final static String INVOICE_AMT_GREATER_THAN_UPPER_VARIANCE = "AGUV";
1495        public final static String INVOICE_AMT_LESSER_THAN_LOWER_VARIANCE = "ALLV";
1496        public final static String SALES_TAX_AMT_LESSER_THAN_LOWER_VARIANCE = "STLV";
1497        public final static String SALES_TAX_AMT_GREATER_THAN_UPPER_VARIANCE = "STUV";
1498        public final static String TAX_SUMMARY_AMT_EXISTS = "STNV";
1499        public final static String TAX_SUMMARY_AMT_MISMATCH = "TSAM";
1500        public final static String INVOICE_ORDER_DUPLICATE = "EIDU";
1501
1502        public final static String PREQ_WORKLOW_EXCEPTION = "PRWE";
1503        public final static String PREQ_DISCOUNT_ERROR = "PRDE";
1504        public final static String PREQ_ROUTING_FAILURE = "PRRF";
1505        public final static String PREQ_ROUTING_VALIDATION_ERROR = "PRVE";
1506        public final static String ERROR_ADDING_SCHEMA = "EASC";
1507
1508
1509        public static class RejectDocumentFields {
1510            public final static String INVOICE_FILE_NUMBER = "invoiceFileNumber";
1511            public final static String INVOICE_FILE_DATE = "invoiceFileDate";
1512
1513            //VendorID?
1514
1515            public final static String VENDOR_DUNS_NUMBER = "vendorDunsNumber";
1516            public final static String INVOICE_PO_ID = "invoiceOrderPurchaseOrderIdentifier";
1517            public final static String INVOICE_ITEM_LINE_NUMBER = "invoiceItemLineNumber";
1518            public final static String INVOICE_ITEM_QUANTITY = "invoiceItemQuantity";
1519            public final static String INVOICE_ITEM_UOM = "invoiceItemUnitOfMeasureCode";
1520            public final static String INVOICE_ITEM_CATALOG_NUMBER = "invoiceItemCatalogNumber";
1521            public final static String INVOICE_ITEM_UNIT_PRICE = "invoiceItemUnitPrice";
1522            public final static String INVOICE_ITEM_SUBTOTAL_MAT = "invoiceItemSubTotalAmount";
1523            public final static String INVOICE_ITEM_TAX_AMT = "invoiceItemTaxAmount";
1524            public final static String INVOICE_ITEM_SPL_HANDLING_AMT = "invoiceItemSpecialHandlingAmount";
1525            public final static String INVOICE_ITEM_SHIPPING_AMT = "invoiceItemShippingAmount";
1526            public final static String INVOICE_ITEM_DISCOUNT_AMT = "invoiceItemDiscountAmount";
1527            public final static String INVOICE_ITEM_NET_AMT = "invoiceItemNetAmount";
1528
1529        }
1530
1531    }
1532
1533    public static String PRODUCTION_ENVIRONMENT = "PRD";
1534
1535    public static String FAX_TEST_PHONE_NUMBER = "FAX_TEST_PHONE_NUMBER";
1536
1537    public static final String ELECTRONIC_INVOICE_FILE_TYPE_INDENTIFIER = "electronicInvoiceInputFileType";
1538    public static final String B2B_PO_RESPONSE_FILE_TYPE_INDENTIFIER = "b2bPOResponseFileType";
1539    public static final String B2B_PUNCH_OUT_ORDER_FILE_TYPE_INDENTIFIER = "b2bPunchOutOrderFileType";
1540    public static final String B2B_PUNCH_OUT_RESPONSE_FILE_TYPE_INDENTIFIER = "b2bPunchOutResponseFileType";
1541
1542    public static class CapitalAssetAvailability {
1543        public static final String NONE = "NONE";
1544        public static final String ONCE = "ONCE";
1545        public static final String EACH = "EACH";
1546    }
1547
1548    public static class CapitalAssetSystemTypes {
1549        public static final String ONE_SYSTEM = "ONE";
1550        public static final String INDIVIDUAL = "IND";
1551        public static final String MULTIPLE = "MUL";
1552    }
1553
1554    public static final class CAMS_REQUIREDNESS_FIELDS {
1555        private static final Map<String, String> getRequirednessFieldsByParameterNames() {
1556            Map<String, String> fieldsByParameterNames = new HashMap<String, String>();
1557            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_ASSET_NUMBER_ON_REQUISITION, "itemCapitalAssets.capitalAssetNumber");
1558            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_ASSET_TRANSACTION_TYPE_ON_REQUISITION, "capitalAssetTransactionTypeCode");
1559            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_ASSET_TYPE_ON_REQUISITION, "capitalAssetTypeCode");
1560            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_COMMENTS_ON_REQUISITION, "capitalAssetNoteText");
1561            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_DESCRIPTION_ON_REQUISITION, "capitalAssetSystemDescription");
1562            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_LOCATIONS_ADDRESS_ON_REQUISITION, "capitalAssetLocations.capitalAssetLine1Address");
1563            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_LOCATIONS_QUANTITY_ON_REQUISITION, "capitalAssetLocations.itemQuantity");
1564            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_MANUFACTURER_ON_REQUISITION, "capitalAssetManufacturerName");
1565            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_MODEL_ON_REQUISITION, "capitalAssetModelDescription");
1566            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_NOT_CURRENT_FISCAL_YEAR_ON_REQUISITION, "capitalAssetNotReceivedCurrentFiscalYearIndicator");
1567            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_NUMBER_OF_ASSETS_ON_REQUISITION, "capitalAssetCountAssetNumber");
1568
1569            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_ASSET_NUMBER_ON_PURCHASE_ORDER, "itemCapitalAssets.capitalAssetNumber");
1570            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_ASSET_TRANSACTION_TYPE_ON_PURCHASE_ORDER, "capitalAssetTransactionTypeCode");
1571            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_ASSET_TYPE_ON_PURCHASE_ORDER, "capitalAssetTypeCode");
1572            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_COMMENTS_ON_PURCHASE_ORDER, "capitalAssetNoteText");
1573            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_DESCRIPTION_ON_PURCHASE_ORDER, "capitalAssetSystemDescription");
1574            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_LOCATIONS_ADDRESS_ON_PURCHASE_ORDER, "capitalAssetLocations.capitalAssetLine1Address");
1575            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_LOCATIONS_QUANTITY_ON_PURCHASE_ORDER, "capitalAssetLocations.itemQuantity");
1576            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_MANUFACTURER_ON_PURCHASE_ORDER, "capitalAssetManufacturerName");
1577            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_MODEL_ON_PURCHASE_ORDER, "capitalAssetModelDescription");
1578            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_NOT_CURRENT_FISCAL_YEAR_ON_PURCHASE_ORDER, "capitalAssetNotReceivedCurrentFiscalYearIndicator");
1579            fieldsByParameterNames.put(PurapParameterConstants.CapitalAsset.CHARTS_REQUIRING_NUMBER_OF_ASSETS_ON_PURCHASE_ORDER, "capitalAssetCountAssetNumber");
1580
1581            return Collections.unmodifiableMap(fieldsByParameterNames);
1582        }
1583
1584        public static final Map<String, String> REQUIREDNESS_FIELDS_BY_PARAMETER_NAMES = getRequirednessFieldsByParameterNames();
1585    }
1586
1587    public static class CapitalAssetSystemStates {
1588        public static final String NEW = "NEW";
1589        public static final String MODIFY = "MOD";
1590    }
1591
1592    public static final class CAMS_AVAILABILITY_MATRIX {
1593
1594        public static final List<AvailabilityMatrix> MATRIX_LIST = getAllFromAvailabilityMatrix();
1595
1596        private static List<AvailabilityMatrix> getAllFromAvailabilityMatrix() {
1597            List<AvailabilityMatrix> result = new ArrayList<AvailabilityMatrix>();
1598            result.add(AvailabilityMatrix.TRAN_TYPE_ONE_NEW);
1599            result.add(AvailabilityMatrix.TRAN_TYPE_ONE_MOD);
1600            result.add(AvailabilityMatrix.TRAN_TYPE_IND_NEW);
1601            result.add(AvailabilityMatrix.TRAN_TYPE_IND_MOD);
1602            result.add(AvailabilityMatrix.TRAN_TYPE_MULT_NEW);
1603            result.add(AvailabilityMatrix.TRAN_TYPE_MULT_MOD);
1604
1605            result.add(AvailabilityMatrix.ASSET_NUMBER_ONE_NEW);
1606            result.add(AvailabilityMatrix.ASSET_NUMBER_ONE_MOD);
1607            result.add(AvailabilityMatrix.ASSET_NUMBER_IND_NEW);
1608            result.add(AvailabilityMatrix.ASSET_NUMBER_IND_MOD);
1609            result.add(AvailabilityMatrix.ASSET_NUMBER_MULT_NEW);
1610            result.add(AvailabilityMatrix.ASSET_NUMBER_MULT_MOD);
1611
1612            result.add(AvailabilityMatrix.COMMENTS_ONE_NEW);
1613            result.add(AvailabilityMatrix.COMMENTS_ONE_MOD);
1614            result.add(AvailabilityMatrix.COMMENTS_IND_NEW);
1615            result.add(AvailabilityMatrix.COMMENTS_IND_MOD);
1616            result.add(AvailabilityMatrix.COMMENTS_MULT_NEW);
1617            result.add(AvailabilityMatrix.COMMENTS_MULT_MOD);
1618
1619            result.add(AvailabilityMatrix.NOT_CURRENT_FY_ONE_NEW);
1620            result.add(AvailabilityMatrix.NOT_CURRENT_FY_ONE_MOD);
1621            result.add(AvailabilityMatrix.NOT_CURRENT_FY_IND_NEW);
1622            result.add(AvailabilityMatrix.NOT_CURRENT_FY_IND_MOD);
1623            result.add(AvailabilityMatrix.NOT_CURRENT_FY_MULT_NEW);
1624            result.add(AvailabilityMatrix.NOT_CURRENT_FY_MULT_MOD);
1625
1626            result.add(AvailabilityMatrix.ASSET_TYPE_ONE_NEW);
1627            result.add(AvailabilityMatrix.ASSET_TYPE_ONE_MOD);
1628            result.add(AvailabilityMatrix.ASSET_TYPE_IND_NEW);
1629            result.add(AvailabilityMatrix.ASSET_TYPE_IND_MOD);
1630            result.add(AvailabilityMatrix.ASSET_TYPE_MULT_NEW);
1631            result.add(AvailabilityMatrix.ASSET_TYPE_MULT_MOD);
1632
1633            result.add(AvailabilityMatrix.MANUFACTURER_ONE_NEW);
1634            result.add(AvailabilityMatrix.MANUFACTURER_ONE_MOD);
1635            result.add(AvailabilityMatrix.MANUFACTURER_IND_NEW);
1636            result.add(AvailabilityMatrix.MANUFACTURER_IND_MOD);
1637            result.add(AvailabilityMatrix.MANUFACTURER_MULT_NEW);
1638            result.add(AvailabilityMatrix.MANUFACTURER_MULT_MOD);
1639
1640            result.add(AvailabilityMatrix.MODEL_ONE_NEW);
1641            result.add(AvailabilityMatrix.MODEL_ONE_MOD);
1642            result.add(AvailabilityMatrix.MODEL_IND_NEW);
1643            result.add(AvailabilityMatrix.MODEL_IND_MOD);
1644            result.add(AvailabilityMatrix.MODEL_MULT_NEW);
1645            result.add(AvailabilityMatrix.MODEL_MULT_MOD);
1646
1647            result.add(AvailabilityMatrix.DESCRIPTION_ONE_NEW);
1648            result.add(AvailabilityMatrix.DESCRIPTION_ONE_MOD);
1649            result.add(AvailabilityMatrix.DESCRIPTION_IND_NEW);
1650            result.add(AvailabilityMatrix.DESCRIPTION_IND_MOD);
1651            result.add(AvailabilityMatrix.DESCRIPTION_MULT_NEW);
1652            result.add(AvailabilityMatrix.DESCRIPTION_MULT_MOD);
1653
1654            result.add(AvailabilityMatrix.LOC_QUANTITY_ONE_NEW);
1655            result.add(AvailabilityMatrix.LOC_QUANTITY_ONE_MOD);
1656            result.add(AvailabilityMatrix.LOC_QUANTITY_IND_NEW);
1657            result.add(AvailabilityMatrix.LOC_QUANTITY_IND_MOD);
1658            result.add(AvailabilityMatrix.LOC_QUANTITY_MULT_NEW);
1659            result.add(AvailabilityMatrix.LOC_QUANTITY_MULT_MOD);
1660
1661            result.add(AvailabilityMatrix.LOC_ADDRESS_ONE_NEW);
1662            result.add(AvailabilityMatrix.LOC_ADDRESS_ONE_MOD);
1663            result.add(AvailabilityMatrix.LOC_ADDRESS_IND_NEW);
1664            result.add(AvailabilityMatrix.LOC_ADDRESS_IND_MOD);
1665            result.add(AvailabilityMatrix.LOC_ADDRESS_MULT_NEW);
1666            result.add(AvailabilityMatrix.LOC_ADDRESS_MULT_MOD);
1667
1668            result.add(AvailabilityMatrix.HOW_MANY_ASSETS_ONE_NEW);
1669            result.add(AvailabilityMatrix.HOW_MANY_ASSETS_ONE_MOD);
1670            result.add(AvailabilityMatrix.HOW_MANY_ASSETS_IND_NEW);
1671            result.add(AvailabilityMatrix.HOW_MANY_ASSETS_IND_MOD);
1672            result.add(AvailabilityMatrix.HOW_MANY_ASSETS_MULT_NEW);
1673            result.add(AvailabilityMatrix.HOW_MANY_ASSETS_MULT_MOD);
1674
1675            return result;
1676        }
1677    }
1678
1679    public static final class CAMSWarningStatuses {
1680        public static final Set<String> REQUISITION_STATUS_WARNING_NO_CAMS_DATA = getRequisitionStatusCAMSWarnings();
1681        public static final Set<String> PURCHASEORDER_STATUS_WARNING_NO_CAMS_DATA = getPurchaseOrderStatusCAMSWarnings();
1682        public static final Set<String> PAYMENT_REQUEST_STATUS_WARNING_NO_CAMS_DATA = getPurchaseOrderStatusCAMSWarnings();
1683        public static final Set<String> CREDIT_MEMO_STATUS_WARNING_NO_CAMS_DATA = getPurchaseOrderStatusCAMSWarnings();
1684
1685        private static HashSet<String> getRequisitionStatusCAMSWarnings() {
1686            HashSet<String> statuses = new HashSet<String>();
1687            statuses.add(RequisitionStatuses.APPDOC_IN_PROCESS);
1688            statuses.add(RequisitionStatuses.APPDOC_AWAIT_CONTENT_REVIEW);
1689            statuses.add(RequisitionStatuses.APPDOC_AWAIT_FISCAL_REVIEW);
1690            return statuses;
1691        }
1692
1693        private static HashSet<String> getPurchaseOrderStatusCAMSWarnings() {
1694            HashSet<String> statuses = new HashSet<String>();
1695            statuses.add(PurchaseOrderStatuses.APPDOC_IN_PROCESS);
1696            statuses.add(PurchaseOrderStatuses.APPDOC_AWAIT_PURCHASING_REVIEW);
1697            return statuses;
1698        }
1699
1700        private static HashSet<String> getPaymentRequestStatusCAMSWarnings() {
1701            HashSet<String> statuses = new HashSet<String>();
1702            statuses.add(PaymentRequestStatuses.APPDOC_IN_PROCESS);
1703            return statuses;
1704        }
1705
1706        private static HashSet<String> getCreditMemoStatusCAMSWarnings() {
1707            HashSet<String> statuses = new HashSet<String>();
1708            statuses.add(CreditMemoStatuses.APPDOC_IN_PROCESS);
1709            return statuses;
1710        }
1711    }
1712
1713    public static final class AttachmentTypeCodes {
1714        public static final String ATTACHMENT_TYPE_CM_IMAGE = "Credit Memo Image";
1715        public static final String ATTACHMENT_TYPE_CONTRACTS = "Contracts";
1716        public static final String ATTACHMENT_TYPE_CONTRACT_AMENDMENTS = "Contract Amendments";
1717        public static final String ATTACHMENT_TYPE_OTHER = "Other";
1718        public static final String ATTACHMENT_TYPE_OTHER_RESTRICTED = "Other - Restricted";
1719        public static final String ATTACHMENT_TYPE_INVOICE_IMAGE = "Invoice Image";
1720        public static final String ATTACHMENT_TYPE_QUOTE = "Quotes";
1721        public static final String ATTACHMENT_TYPE_RFP = "RFPs";
1722        public static final String ATTACHMENT_TYPE_RFP_RESPONSES = "RFP Responses";
1723        public static final String ATTACHMENT_TYPE_TAX_DOCUMENTS = "Tax Documents";
1724    }
1725
1726    public static class LicenseRequestStatus {
1727        public static final String INITIATE_LICENSE_REQUEST = "ILR";
1728        public static final String NO_LICENSE_REQUIRED = "NLR";
1729        public static final String LICENSE_REQUEST_COMPLETE = "LRC";
1730        public static final String NEGOTIATION_FAILED = "NF";
1731
1732        public static final String ONE_SYSTEM = "ONE";
1733        public static final String INDIVIDUAL = "IND";
1734        public static final String MULTIPLE = "MUL";
1735    }
1736
1737//    public static final class AccountDistributionMethodCodes {
1738//        public static final String PROPORTIONAL_CODE = "P";
1739//        public static final String SEQUENTIAL_CODE = "S";
1740//        public static final String BOTH_WITH_DEFAULT_PROPORTIONAL_CODE = "P;S";
1741//        public static final String BOTH_WITH_DEFAULT_SEQUENTIAL_CODE = "S;P";
1742//
1743//        public static final String PROPORTIONAL_DESCRIPTION = "Proportional";
1744//        public static final String SEQUENTIAL_DESCRIPTION = "Sequential";
1745//        public static final String BOTH_WITH_DEFAULT_PROPORTIONAL_DESCRIPTION = "Both, with Proportional as default";
1746//        public static final String BOTH_WITH_DEFAULT_SEQUENTIAL_DESCRIPTION = "Both, with Sequential as default";
1747//    }
1748
1749    // CSU 6702 BEGIN
1750    public static class ParameterConstants {
1751        public static String INCLUDE_RETIRED_ASSETS_IND = "INCLUDE_RETIRED_ASSETS_IND";
1752    }
1753    // CSU 6702 BEGIN
1754
1755    public static class ValidationStrings {
1756        public static final String CAPITAL = "Capital";
1757        public static final String EXPENSE = "Expense";
1758        public static final String RECURRING = "Recurring";
1759        public static final String NON_RECURRING = "Non-recurring";
1760    }
1761
1762    public static final String APO_LIMIT = "REQ_GT_PO";
1763    public static final String REQ_TOT = "REQ_GT_ZE";
1764    public static final String VEN_NOT_SEL = "VEN_NOT_SEL_DB";
1765    public static final String ERR_RTV_VENDOR = "ERR_RTV_VEN_DB";
1766    public static final String VENDOR_RESTRICTED = "VEN_REST";
1767    public static final String REQ_WITH_NO_CONTRACT = "REQ_NO_CONT";
1768    public static final String ITM_RESTRICTED = "ITM_REST";
1769    public static final String REQ_CON_TRADEIN = "REQ_TRAD_IN";
1770    public static final String REQ_CON_ACC_LINE = "REQ_CON_ACC_LN";
1771    public static final String REQ_CON_CAP_ASSET_ITM = "REQ_CPT_ASST_ITM";
1772    public static final String RECUR_REQ_TYPE = "REQ_PAY_RECUR";
1773    public static final String PO_TOT_NOT_EXCEED = "PO_TOT_NOT_EXC";
1774    public static final String RECUR_PAY_TYPE = "REQ_PAY_RECUR";
1775    public static final String ALT_VEN_NAME_EXISTS = "ALT_VEN_NAM";
1776
1777
1778    public static class PaymentRequestDocumentStrings {
1779        public static final String CUSTOMER_INVOICE_DETAIL_UOM_DEFAULT = "EA"; //TODO: System parameter?
1780    }
1781
1782    public static class InvoiceDocumentStrings {
1783        public static final String CUSTOMER_INVOICE_DETAIL_UOM_DEFAULT = "EA"; //TODO: System parameter?
1784    }
1785
1786    public static final String PURAP_APPLICATION_DOCUMENT_ID_NOT_AVAILABLE = "Not Available";
1787    public static final String PURAP_APPLICATION_DOCUMENT_STATUS_NOT_AVAILABLE = "Not Available";
1788
1789    //MSU Contribution OLEMI-8582 DTT-330 OLECNTRB-943
1790    public static final String DELIVERY_BUILDING_NAME_INACTIVE_ERROR = "document.deliveryBuildingName";
1791    public static final String DELIVERY_ROOM_NUMBER_INACTIVE_ERROR = "document.deliveryBuildingRoomNumber";
1792
1793    //MSU Contribution OLEMI-8457 DTT-377 OLECNTRB-945
1794    public static final String PURAP_REQS_ORG_CD = "document.organizationCode";
1795}