1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.businessobject;
17
18 import org.kuali.ole.module.purap.document.PurchaseOrderDocument;
19 import org.kuali.ole.module.purap.document.RequisitionDocument;
20 import org.kuali.ole.sys.businessobject.AccountingLineParserBase;
21 import org.kuali.ole.sys.document.AccountingDocument;
22
23 import static org.kuali.ole.sys.OLEPropertyConstants.*;
24
25
26
27
28 public class PurApAccountingLineParser extends AccountingLineParserBase {
29 protected static final String[] PURAP_FORMAT = {CHART_OF_ACCOUNTS_CODE, ACCOUNT_NUMBER, SUB_ACCOUNT_NUMBER, FINANCIAL_OBJECT_CODE, FINANCIAL_SUB_OBJECT_CODE, PROJECT_CODE, ORGANIZATION_REFERENCE_ID, PERCENT};
30
31
32
33
34 public PurApAccountingLineParser() {
35 super();
36 }
37
38
39
40
41 @Override
42 public String[] getSourceAccountingLineFormat() {
43 return removeChartFromFormatIfNeeded(PURAP_FORMAT);
44 }
45
46
47
48
49 @Override
50 protected Class getSourceAccountingLineClass(final AccountingDocument accountingDocument) {
51 if (accountingDocument instanceof RequisitionDocument)
52 return RequisitionAccount.class;
53 else if (accountingDocument instanceof PurchaseOrderDocument)
54 return PurchaseOrderAccount.class;
55 else return super.getSourceAccountingLineClass(accountingDocument);
56 }
57
58 }