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.CreditMemoAccount;
19: import org.kuali.module.purap.bo.CreditMemoItem;
20: import org.kuali.module.purap.bo.PurApAccountingLine;
21: import org.kuali.module.purap.bo.PurApItem;
22: import org.kuali.test.fixtures.AccountingLineFixture;
23:
24: public enum CreditMemoAccountingLineFixture {
25: BASIC_CM_ACCOUNT_1(PurApAccountingLineFixture.BASIC_ACCOUNT_1, // PurApAccountingLineFixture
26: AccountingLineFixture.LINE2 // AccountingLineFixture
27: );
28:
29: private PurApAccountingLineFixture purApAccountingLineFixture;
30: private AccountingLineFixture accountingLineFixture;
31:
32: private CreditMemoAccountingLineFixture(
33: PurApAccountingLineFixture purApAccountingLineFixture,
34: AccountingLineFixture accountingLineFixture) {
35: this .purApAccountingLineFixture = purApAccountingLineFixture;
36: this .accountingLineFixture = accountingLineFixture;
37: }
38:
39: public PurApAccountingLine createPurApAccountingLine(Class clazz,
40: PurApAccountingLineFixture puralFixture,
41: AccountingLineFixture alFixture) {
42: PurApAccountingLine line = null;
43:
44: // TODO: what should this debit code really be
45: line = (PurApAccountingLine) puralFixture
46: .createPurApAccountingLine(CreditMemoAccount.class,
47: alFixture);
48:
49: return line;
50: }
51:
52: public void addTo(CreditMemoItem item) {
53: item.getSourceAccountingLines().add(
54: createPurApAccountingLine(
55: item.getAccountingLineClass(),
56: purApAccountingLineFixture,
57: accountingLineFixture));
58: }
59:
60: /**
61: * This method adds an account to an item
62: *
63: * @param document
64: * @param purApItemFixture
65: * @throws IllegalAccessException
66: * @throws InstantiationException
67: */
68: public void addTo(PurApItem item,
69: PurApAccountingLineFixture purApaccountFixture,
70: AccountingLineFixture alFixture)
71: throws IllegalAccessException, InstantiationException {
72: // purApaccountFixture.createPurApAccountingLine(CreditMemoAccount.class, alFixture);
73: if (0 == 0)
74: ;
75: }
76:
77: }
|