001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.module.purap.fixtures;
017:
018: import java.sql.Date;
019:
020: import org.kuali.module.purap.document.AccountsPayableDocument;
021: import org.kuali.module.purap.document.CreditMemoDocument;
022: import org.kuali.module.purap.document.PaymentRequestDocument;
023:
024: public enum AccountsPayableDocumentFixture {
025:
026: // PAYMENT REQUEST FIXTURES
027: PREQ_ONLY_REQUIRED_FIELDS(null, // accountsPayableApprovalDate
028: null, // lastActionPerformedByUniversalUserId
029: null, // accountsPayableProcessorIdentifier
030: false, // holdIndicator
031: null, // extractedDate
032: 1000, // purchaseOrderIdentifier
033: null, // processingCampusCode
034: null, // noteLine1Text
035: null, // noteLine2Text
036: null, // noteLine3Text
037: false, // continuationAccountIndicator
038: false, // closePurchaseOrderIndicator
039: false // reopenPurchaseOrderIndicator
040: ),
041:
042: // Credit Memo FIXTURES
043: CM_ONLY_REQUIRED_FIELDS(null, // accountsPayableApprovalDate
044: null, // lastActionPerformedByUniversalUserId
045: null, // accountsPayableProcessorIdentifier
046: false, // holdIndicator
047: null, // extractedDate
048: null, // purchaseOrderIdentifier
049: "BL", // processingCampusCode
050: null, // noteLine1Text
051: null, // noteLine2Text
052: null, // noteLine3Text
053: false, // continuationAccountIndicator
054: false, // closePurchaseOrderIndicator
055: false // reopenPurchaseOrderIndicator
056: );
057:
058: // SHARED FIELDS BETWEEN PAYMENT REQUEST AND CREDIT MEMO
059: public final Date accountsPayableApprovalDate;
060: public final String lastActionPerformedByUniversalUserId;
061: public final String accountsPayableProcessorIdentifier;
062: public final boolean holdIndicator;
063: public final Date extractedDate;
064: public final Integer purchaseOrderIdentifier;
065: public final String processingCampusCode;
066: public final String noteLine1Text;
067: public final String noteLine2Text;
068: public final String noteLine3Text;
069: public final boolean continuationAccountIndicator;
070: public final boolean closePurchaseOrderIndicator;
071: public final boolean reopenPurchaseOrderIndicator;
072:
073: // TODO: decide if we need to do anything for not persisted attributes
074: /*
075: * private boolean unmatchedOverride; // not persisted // NOT PERSISTED IN DB // BELOW USED BY ROUTING private String
076: * chartOfAccountsCode; private String organizationCode; // NOT PERSISTED IN DB // BELOW USED BY GL ENTRY CREATION private
077: * boolean generateEncumbranceEntries; private String debitCreditCodeForGLEntries;
078: */
079: private AccountsPayableDocumentFixture(
080: Date accountsPayableApprovalDate,
081: String lastActionPerformedByUniversalUserId,
082: String accountsPayableProcessorIdentifier,
083: boolean holdIndicator, Date extractedDate,
084: Integer purchaseOrderIdentifier,
085: String processingCampusCode, String noteLine1Text,
086: String noteLine2Text, String noteLine3Text,
087: boolean continuationAccountIndicator,
088: boolean closePurchaseOrderIndicator,
089: boolean reopenPurchaseOrderIndicator) {
090: this .accountsPayableApprovalDate = accountsPayableApprovalDate;
091: this .lastActionPerformedByUniversalUserId = lastActionPerformedByUniversalUserId;
092: this .accountsPayableProcessorIdentifier = accountsPayableProcessorIdentifier;
093: this .holdIndicator = holdIndicator;
094: this .extractedDate = extractedDate;
095: this .purchaseOrderIdentifier = purchaseOrderIdentifier;
096: this .processingCampusCode = processingCampusCode;
097: this .noteLine1Text = noteLine1Text;
098: this .noteLine2Text = noteLine2Text;
099: this .noteLine3Text = noteLine3Text;
100: this .continuationAccountIndicator = continuationAccountIndicator;
101: this .closePurchaseOrderIndicator = closePurchaseOrderIndicator;
102: this .reopenPurchaseOrderIndicator = reopenPurchaseOrderIndicator;
103: }
104:
105: public PaymentRequestDocument createPaymentRequestDocument(
106: PurchasingAccountsPayableDocumentFixture purapFixture) {
107: return (PaymentRequestDocument) createAccountsPayableDocument(
108: PaymentRequestDocument.class, purapFixture);
109: }
110:
111: public CreditMemoDocument createCreditMemoDocument(
112: PurchasingAccountsPayableDocumentFixture purapFixture) {
113: return (CreditMemoDocument) createAccountsPayableDocument(
114: CreditMemoDocument.class, purapFixture);
115: }
116:
117: private AccountsPayableDocument createAccountsPayableDocument(
118: Class clazz,
119: PurchasingAccountsPayableDocumentFixture purapFixture) {
120: AccountsPayableDocument doc = (AccountsPayableDocument) purapFixture
121: .createPurchasingAccountsPayableDocument(clazz);
122: doc
123: .setAccountsPayableApprovalDate(this .accountsPayableApprovalDate);
124: doc
125: .setLastActionPerformedByUniversalUserId(this .lastActionPerformedByUniversalUserId);
126: doc
127: .setAccountsPayableProcessorIdentifier(this .accountsPayableProcessorIdentifier);
128: doc.setHoldIndicator(this .holdIndicator);
129: doc.setExtractedDate(this .extractedDate);
130: doc.setPurchaseOrderIdentifier(this .purchaseOrderIdentifier);
131: doc.setProcessingCampusCode(this .processingCampusCode);
132: doc.setNoteLine1Text(this .noteLine1Text);
133: doc.setNoteLine2Text(this .noteLine2Text);
134: doc.setNoteLine3Text(this .noteLine3Text);
135: doc
136: .setContinuationAccountIndicator(this .continuationAccountIndicator);
137: // TODO: are these needed?
138: /*
139: * We don't have setters for these doc.setClosePurchaseOrderIndicator(this.closePurchaseOrderIndicator);
140: * doc.setReopenPurchaseOrderIndicator(this.reopenPurchaseOrderIndicator);
141: */
142: return doc;
143: }
144:
145: }
|