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