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