1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document.web.struts;
17
18 import java.util.Map;
19
20 import org.kuali.ole.fp.document.IndirectCostAdjustmentDocument;
21 import org.kuali.ole.fp.document.validation.impl.IndirectCostAdjustmentDocumentRuleConstants;
22 import org.kuali.ole.sys.OLEPropertyConstants;
23 import org.kuali.ole.sys.businessobject.SourceAccountingLine;
24 import org.kuali.ole.sys.businessobject.TargetAccountingLine;
25 import org.kuali.ole.sys.context.SpringContext;
26 import org.kuali.ole.sys.document.AccountingDocument;
27 import org.kuali.ole.sys.web.struts.KualiAccountingDocumentFormBase;
28 import org.kuali.rice.coreservice.framework.parameter.ParameterService;
29
30
31
32
33 public class IndirectCostAdjustmentForm extends KualiAccountingDocumentFormBase {
34
35
36
37
38 public IndirectCostAdjustmentForm() {
39 super();
40 }
41
42 @Override
43 protected String getDefaultDocumentTypeName() {
44 return "OLE_ICA";
45 }
46
47
48
49
50 public IndirectCostAdjustmentDocument getIndirectCostAdjustmentDocument() {
51 return (IndirectCostAdjustmentDocument) getDocument();
52 }
53
54
55
56
57 public void setIndirectCostAdjustmentDocument(IndirectCostAdjustmentDocument indirectCostAdjustmentDocument) {
58 setDocument(indirectCostAdjustmentDocument);
59 }
60
61
62
63
64 @Override
65 public SourceAccountingLine createNewSourceAccountingLine(AccountingDocument financialDocument) {
66 SourceAccountingLine sourceAccountingLine = super.createNewSourceAccountingLine(financialDocument);
67 String objectCode = SpringContext.getBean(ParameterService.class).getParameterValueAsString(IndirectCostAdjustmentDocument.class, IndirectCostAdjustmentDocumentRuleConstants.GRANT_OBJECT_CODE);
68
69 sourceAccountingLine.setFinancialObjectCode(objectCode);
70 return sourceAccountingLine;
71 }
72
73
74
75
76 @Override
77 public TargetAccountingLine createNewTargetAccountingLine(AccountingDocument financialDocument) {
78 TargetAccountingLine targetAccountingLine = super.createNewTargetAccountingLine(financialDocument);
79 String objectCode = SpringContext.getBean(ParameterService.class).getParameterValueAsString(IndirectCostAdjustmentDocument.class, IndirectCostAdjustmentDocumentRuleConstants.RECEIPT_OBJECT_CODE);
80
81 targetAccountingLine.setFinancialObjectCode(objectCode);
82 return targetAccountingLine;
83 }
84
85
86
87
88 @Override
89 public Map getForcedReadOnlyFields() {
90 Map map = super.getForcedReadOnlyFields();
91 map.put(OLEPropertyConstants.FINANCIAL_OBJECT_CODE, Boolean.TRUE);
92 return map;
93 }
94
95 }