1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.fp.document;
18
19 import java.util.List;
20
21 import org.kuali.ole.integration.cam.CapitalAssetManagementModuleService;
22 import org.kuali.ole.sys.OLEConstants;
23 import org.kuali.ole.sys.businessobject.ElectronicPaymentClaim;
24 import org.kuali.ole.sys.context.SpringContext;
25 import org.kuali.ole.sys.document.AmountTotaling;
26 import org.kuali.ole.sys.document.Correctable;
27 import org.kuali.ole.sys.document.ElectronicPaymentClaiming;
28 import org.kuali.ole.sys.service.ElectronicPaymentClaimingService;
29 import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange;
30 import org.kuali.rice.kns.service.DataDictionaryService;
31 import org.kuali.rice.krad.document.Copyable;
32 import org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent;
33 import org.kuali.rice.krad.rules.rule.event.SaveDocumentEvent;
34
35
36
37
38
39 public class DistributionOfIncomeAndExpenseDocument extends CapitalAccountingLinesDocumentBase implements Copyable, Correctable, AmountTotaling, ElectronicPaymentClaiming {
40 protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(DistributionOfIncomeAndExpenseDocument.class);
41
42 protected List<ElectronicPaymentClaim> electronicPaymentClaims;
43 protected transient CapitalAssetManagementModuleService capitalAssetManagementModuleService;
44
45
46
47
48 public DistributionOfIncomeAndExpenseDocument() {
49 super();
50 }
51
52
53
54
55 @Override
56 public String getSourceAccountingLinesSectionTitle() {
57 return OLEConstants.FROM;
58 }
59
60
61
62
63 @Override
64 public String getTargetAccountingLinesSectionTitle() {
65 return OLEConstants.TO;
66 }
67
68
69
70
71
72 public void declaimElectronicPaymentClaims() {
73 SpringContext.getBean(ElectronicPaymentClaimingService.class).declaimElectronicPaymentClaimsForDocument(this);
74 }
75
76
77
78
79
80
81 public List<ElectronicPaymentClaim> getElectronicPaymentClaims() {
82 return electronicPaymentClaims;
83 }
84
85
86
87
88
89
90
91 public void setElectronicPaymentClaims(List<ElectronicPaymentClaim> electronicPaymentClaims) {
92 this.electronicPaymentClaims = electronicPaymentClaims;
93 }
94
95
96
97
98 @Override
99 public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
100 super.doRouteStatusChange(statusChangeEvent);
101 this.getCapitalAssetManagementModuleService().deleteDocumentAssetLocks(this);
102 }
103
104
105
106
107 @Override
108 public void postProcessSave(KualiDocumentEvent event) {
109 super.postProcessSave(event);
110 if (!(event instanceof SaveDocumentEvent)) {
111 String documentTypeName = SpringContext.getBean(DataDictionaryService.class).getDocumentTypeNameByClass(this.getClass());
112 this.getCapitalAssetManagementModuleService().generateCapitalAssetLock(this, documentTypeName);
113 }
114 }
115
116
117
118
119 CapitalAssetManagementModuleService getCapitalAssetManagementModuleService() {
120 if (capitalAssetManagementModuleService == null) {
121 capitalAssetManagementModuleService = SpringContext.getBean(CapitalAssetManagementModuleService.class);
122 }
123 return capitalAssetManagementModuleService;
124 }
125 }