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