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.math.BigDecimal;
019:
020: import org.kuali.core.util.KualiDecimal;
021: import org.kuali.module.purap.bo.PurApItem;
022:
023: public enum PurApItemFixture {
024: BASIC_QTY_ITEM_1(null, // itemIdentifier
025: new Integer(1), // itemLineNumber
026: null, // capitalAssetTransactionTypeCode
027: "PCS", // itemUnitOfMeasureCode
028: "", // itemCatalogNumber
029: "description", // itemDescription
030: "", // itemCapitalAssetNoteText
031: new BigDecimal(1), // itemUnitPrice
032: "ITEM", // itemTypeCode
033: "", // itemAuxiliaryPartIdentifier
034: "", // externalOrganizationB2bProductReferenceNumber
035: "", // externalOrganizationB2bProductTypeName
036: false, // itemAssignedToTradeInIndicator
037: new KualiDecimal(1), // extendedPrice
038: new KualiDecimal(1) // itemQuantity
039: ), BASIC_QTY_ITEM_2(null, // itemIdentifier
040: new Integer(2), // itemLineNumber
041: null, // capitalAssetTransactionTypeCode
042: "PCS", // itemUnitOfMeasureCode
043: "", // itemCatalogNumber
044: "description", // itemDescription
045: "", // itemCapitalAssetNoteText
046: new BigDecimal(1), // itemUnitPrice
047: "ITEM", // itemTypeCode
048: "", // itemAuxiliaryPartIdentifier
049: "", // externalOrganizationB2bProductReferenceNumber
050: "", // externalOrganizationB2bProductTypeName
051: false, // itemAssignedToTradeInIndicator
052: new KualiDecimal(1), // extendedPrice
053: new KualiDecimal(1) // itemQuantity
054: ), APO_QTY_ITEM_1(null, // itemIdentifier
055: new Integer(1), // itemLineNumber
056: null, // capitalAssetTransactionTypeCode
057: "PCS", // itemUnitOfMeasureCode
058: "", // itemCatalogNumber
059: "description", // itemDescription
060: "", // itemCapitalAssetNoteText
061: new BigDecimal(1.99), // itemUnitPrice
062: "ITEM", // itemTypeCode
063: "", // itemAuxiliaryPartIdentifier
064: "", // externalOrganizationB2bProductReferenceNumber
065: "", // externalOrganizationB2bProductTypeName
066: false, // itemAssignedToTradeInIndicator
067: new KualiDecimal(995.00), // extendedPrice
068: new KualiDecimal(500) // itemQuantity
069: ), APO_SERVICE_ITEM_1(null, // itemIdentifier
070: new Integer(2), // itemLineNumber
071: null, // capitalAssetTransactionTypeCode
072: "", // itemUnitOfMeasureCode
073: "", // itemCatalogNumber
074: "description", // itemDescription
075: "", // itemCapitalAssetNoteText
076: new BigDecimal(239.99), // itemUnitPrice
077: "SRVC", // itemTypeCode
078: "", // itemAuxiliaryPartIdentifier
079: "", // externalOrganizationB2bProductReferenceNumber
080: "", // externalOrganizationB2bProductTypeName
081: false, // itemAssignedToTradeInIndicator
082: new KualiDecimal(239.99), // extendedPrice
083: null // itemQuantity
084: ), APO_FREIGHT_ITEM_1(null, // itemIdentifier
085: new Integer(3), // itemLineNumber
086: null, // capitalAssetTransactionTypeCode
087: "", // itemUnitOfMeasureCode
088: "", // itemCatalogNumber
089: "freight", // itemDescription
090: "", // itemCapitalAssetNoteText
091: new BigDecimal(12.49), // itemUnitPrice
092: "FRHT", // itemTypeCode
093: "", // itemAuxiliaryPartIdentifier
094: "", // externalOrganizationB2bProductReferenceNumber
095: "", // externalOrganizationB2bProductTypeName
096: false, // itemAssignedToTradeInIndicator
097: new KualiDecimal(12.49), // extendedPrice
098: null // itemQuantity
099: ), BASIC_QTY_ITEM_NO_APO(null, // itemIdentifier
100: new Integer(2), // itemLineNumber
101: null, // capitalAssetTransactionTypeCode
102: "PCS", // itemUnitOfMeasureCode
103: "", // itemCatalogNumber
104: "description", // itemDescription
105: "", // itemCapitalAssetNoteText
106: new BigDecimal(100), // itemUnitPrice
107: "ITEM", // itemTypeCode
108: "", // itemAuxiliaryPartIdentifier
109: "", // externalOrganizationB2bProductReferenceNumber
110: "", // externalOrganizationB2bProductTypeName
111: false, // itemAssignedToTradeInIndicator
112: new KualiDecimal(10000), // extendedPrice
113: new KualiDecimal(100) // itemQuantity
114: ), REQ_MULTI_ITEM_QUANTITY(null, // itemIdentifier
115: new Integer(1), // itemLineNumber
116: null, // capitalAssetTransactionTypeCode
117: "PCS", // itemUnitOfMeasureCode
118: "P10M980", // itemCatalogNumber
119: "Copy Paper - 8 1/2 x 11, White, 92, 20lb", // itemDescription
120: "", // itemCapitalAssetNoteText
121: new BigDecimal(30.20), // itemUnitPrice
122: "ITEM", // itemTypeCode
123: "", // itemAuxiliaryPartIdentifier
124: "", // externalOrganizationB2bProductReferenceNumber
125: "", // externalOrganizationB2bProductTypeName
126: false, // itemAssignedToTradeInIndicator
127: new KualiDecimal(604), // extendedPrice
128: new KualiDecimal(20) // itemQuantity
129: ), REQ_MULTI_ITEM_NON_QUANTITY(null, // itemIdentifier
130: new Integer(1), // itemLineNumber
131: null, // capitalAssetTransactionTypeCode
132: "", // itemUnitOfMeasureCode
133: "", // itemCatalogNumber
134: "consulting", // itemDescription
135: "", // itemCapitalAssetNoteText
136: new BigDecimal(5000), // itemUnitPrice
137: "SRVC", // itemTypeCode
138: "", // itemAuxiliaryPartIdentifier
139: "", // externalOrganizationB2bProductReferenceNumber
140: "", // externalOrganizationB2bProductTypeName
141: false, // itemAssignedToTradeInIndicator
142: new KualiDecimal(5000), // extendedPrice
143: null // itemQuantity
144: );
145:
146: private Integer itemIdentifier;
147: private Integer itemLineNumber;
148: private String capitalAssetTransactionTypeCode;
149: private String itemUnitOfMeasureCode;
150: private String itemCatalogNumber;
151: private String itemDescription;
152: private String itemCapitalAssetNoteText;
153: private BigDecimal itemUnitPrice;
154: private String itemTypeCode;
155: private String itemAuxiliaryPartIdentifier;
156: private String externalOrganizationB2bProductReferenceNumber;
157: private String externalOrganizationB2bProductTypeName;
158: private boolean itemAssignedToTradeInIndicator;
159: private KualiDecimal extendedPrice;
160: private KualiDecimal itemQuantity;
161:
162: private PurApItemFixture(Integer itemIdentifier,
163: Integer itemLineNumber,
164: String capitalAssetTransactionTypeCode,
165: String itemUnitOfMeasureCode, String itemCatalogNumber,
166: String itemDescription, String itemCapitalAssetNoteText,
167: BigDecimal itemUnitPrice, String itemTypeCode,
168: String itemAuxiliaryPartIdentifier,
169: String externalOrganizationB2bProductReferenceNumber,
170: String externalOrganizationB2bProductTypeName,
171: boolean itemAssignedToTradeInIndicator,
172: KualiDecimal extendedPrice, KualiDecimal itemQuantity) {
173: this .itemIdentifier = itemIdentifier;
174: this .itemLineNumber = itemLineNumber;
175: this .capitalAssetTransactionTypeCode = capitalAssetTransactionTypeCode;
176: this .itemUnitOfMeasureCode = itemUnitOfMeasureCode;
177: this .itemCatalogNumber = itemCatalogNumber;
178: this .itemDescription = itemDescription;
179: this .itemCapitalAssetNoteText = itemCapitalAssetNoteText;
180: this .itemUnitPrice = itemUnitPrice;
181: this .itemTypeCode = itemTypeCode;
182: this .itemAuxiliaryPartIdentifier = itemAuxiliaryPartIdentifier;
183: this .externalOrganizationB2bProductReferenceNumber = externalOrganizationB2bProductReferenceNumber;
184: this .externalOrganizationB2bProductTypeName = externalOrganizationB2bProductTypeName;
185: this .itemAssignedToTradeInIndicator = itemAssignedToTradeInIndicator;
186: this .extendedPrice = extendedPrice;
187: this .itemQuantity = itemQuantity;
188:
189: // add accounts here
190: }
191:
192: public PurApItem createPurApItem(Class clazz) {
193: PurApItem item = null;
194: try {
195: item = (PurApItem) clazz.newInstance();
196: } catch (InstantiationException e) {
197: throw new RuntimeException("item creation failed. class = "
198: + clazz);
199: } catch (IllegalAccessException e) {
200: throw new RuntimeException("item creation failed. class = "
201: + clazz);
202: }
203: item.setItemIdentifier(itemIdentifier);
204: item.setItemLineNumber(itemLineNumber);
205: item
206: .setCapitalAssetTransactionTypeCode(capitalAssetTransactionTypeCode);
207: item.setItemUnitOfMeasureCode(itemUnitOfMeasureCode);
208: item.setItemCatalogNumber(itemCatalogNumber);
209: item.setItemDescription(itemDescription);
210: item.setItemCapitalAssetNoteText(itemCapitalAssetNoteText);
211: item.setItemUnitPrice(itemUnitPrice);
212: item.setItemTypeCode(itemTypeCode);
213: item
214: .setItemAuxiliaryPartIdentifier(itemAuxiliaryPartIdentifier);
215: item
216: .setExternalOrganizationB2bProductReferenceNumber(externalOrganizationB2bProductReferenceNumber);
217: item
218: .setExternalOrganizationB2bProductTypeName(externalOrganizationB2bProductTypeName);
219: item
220: .setItemAssignedToTradeInIndicator(itemAssignedToTradeInIndicator);
221: item.setExtendedPrice(extendedPrice);
222: item.setItemQuantity(itemQuantity);
223:
224: item.refreshNonUpdateableReferences();
225: return item;
226: }
227: }
|