01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.purap.fixtures;
17:
18: import org.kuali.module.purap.bo.PurApAccountingLine;
19: import org.kuali.module.purap.bo.PurApItem;
20: import org.kuali.module.purap.bo.RequisitionAccount;
21: import org.kuali.module.purap.bo.RequisitionItem;
22: import org.kuali.test.fixtures.AccountingLineFixture;
23:
24: public enum RequisitionAccountingLineFixture {
25: BASIC_REQ_ACCOUNT_1(PurApAccountingLineFixture.BASIC_ACCOUNT_1, // PurApAccountingLineFixture
26: AccountingLineFixture.LINE2 // AccountingLineFixture
27: ), APO_REQ_ACCOUNT_1(PurApAccountingLineFixture.BASIC_ACCOUNT_1, // PurApAccountingLineFixture
28: AccountingLineFixture.APO_LINE1 // AccountingLineFixture
29: ), APO_REQ_ACCOUNT_2(PurApAccountingLineFixture.ACCOUNT_50_PERCENT, // PurApAccountingLineFixture
30: AccountingLineFixture.APO_LINE2 // AccountingLineFixture
31: ), APO_REQ_ACCOUNT_3(PurApAccountingLineFixture.ACCOUNT_50_PERCENT, // PurApAccountingLineFixture
32: AccountingLineFixture.APO_LINE3 // AccountingLineFixture
33: ), APO_REQ_ACCOUNT_4(PurApAccountingLineFixture.BASIC_ACCOUNT_1, // PurApAccountingLineFixture
34: AccountingLineFixture.APO_LINE4 // AccountingLineFixture
35: ), REQ_ACCOUNT_MULTI_QUANTITY(
36: PurApAccountingLineFixture.REQ_ACCOUNT_MULTI, // PurApAccountingLineFixture
37: AccountingLineFixture.REQ_ACCOUNT_MULTI_QUANTITY // AccountingLineFixture
38: ), REQ_ACCOUNT_MULTI_NON_QUANTITY(
39: PurApAccountingLineFixture.REQ_ACCOUNT_MULTI, // PurApAccountingLineFixture
40: AccountingLineFixture.REQ_ACCOUNT_MULTI_NON_QUANTITY // AccountingLineFixture
41: );
42:
43: private PurApAccountingLineFixture purApAccountingLineFixture;
44: private AccountingLineFixture accountingLineFixture;
45:
46: private RequisitionAccountingLineFixture(
47: PurApAccountingLineFixture purApAccountingLineFixture,
48: AccountingLineFixture accountingLineFixture) {
49: this .purApAccountingLineFixture = purApAccountingLineFixture;
50: this .accountingLineFixture = accountingLineFixture;
51: }
52:
53: public PurApAccountingLine createPurApAccountingLine(Class clazz,
54: PurApAccountingLineFixture puralFixture,
55: AccountingLineFixture alFixture) {
56: PurApAccountingLine line = null;
57:
58: // TODO: what should this debit code really be
59: line = (PurApAccountingLine) puralFixture
60: .createPurApAccountingLine(RequisitionAccount.class,
61: alFixture);
62:
63: return line;
64: }
65:
66: public void addTo(RequisitionItem item) {
67: item.getSourceAccountingLines().add(
68: createPurApAccountingLine(
69: item.getAccountingLineClass(),
70: purApAccountingLineFixture,
71: accountingLineFixture));
72: }
73:
74: /**
75: * This method adds an account to an item
76: *
77: * @param document
78: * @param purApItemFixture
79: * @throws IllegalAccessException
80: * @throws InstantiationException
81: */
82: public void addTo(PurApItem item,
83: PurApAccountingLineFixture purApaccountFixture,
84: AccountingLineFixture alFixture)
85: throws IllegalAccessException, InstantiationException {
86: // purApaccountFixture.createPurApAccountingLine(RequisitionAccount.class, alFixture);
87: if (0 == 0)
88: ;
89: }
90:
91: }
|