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