1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.kuali.ole.fp.businessobject.CapitalAssetAccountsGroupDetails;
22 import org.kuali.ole.fp.businessobject.CapitalAssetInformation;
23 import org.kuali.ole.fp.businessobject.CapitalAssetInformationDetail;
24 import org.kuali.ole.integration.cab.CapitalAssetBuilderModuleService;
25 import org.kuali.ole.sys.businessobject.AccountingLine;
26 import org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntrySourceDetail;
27 import org.kuali.ole.sys.context.SpringContext;
28 import org.kuali.ole.sys.document.AccountingDocumentBase;
29 import org.kuali.ole.sys.document.service.DebitDeterminerService;
30 import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange;
31 import org.kuali.rice.krad.util.ObjectUtils;
32
33
34
35
36 public class CapitalAssetInformationDocumentBase extends AccountingDocumentBase implements CapitalAssetEditable {
37 protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(CapitalAssetInformationDocumentBase.class);
38 protected Integer nextCapitalAssetLineNumber;
39
40
41 protected List<CapitalAssetInformation> capitalAssetInformation;
42
43
44
45
46 public CapitalAssetInformationDocumentBase() {
47 super();
48
49 this.setCapitalAssetInformation(new ArrayList());
50 this.setNextCapitalAssetLineNumber(1);
51 }
52
53
54
55
56 @Override
57 public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
58 super.doRouteStatusChange(statusChangeEvent);
59
60 String documentNumber = getDocumentHeader().getDocumentNumber();
61
62 SpringContext.getBean(CapitalAssetBuilderModuleService.class).markProcessedGLEntryLine(documentNumber);
63 }
64
65
66
67
68 @Override
69 public List buildListOfDeletionAwareLists() {
70 List<List> managedLists = super.buildListOfDeletionAwareLists();
71
72 List<CapitalAssetInformation> capitalAssets = new ArrayList<CapitalAssetInformation>();
73 capitalAssets.addAll(this.getCapitalAssetInformation());
74
75 managedLists.add(capitalAssets);
76
77 return managedLists;
78 }
79
80
81
82
83
84
85
86
87
88
89
90 public boolean isDebit(GeneralLedgerPendingEntrySourceDetail postable) {
91 DebitDeterminerService isDebitUtils = SpringContext.getBean(DebitDeterminerService.class);
92 return isDebitUtils.isDebitConsideringSectionAndTypePositiveOnly(this, (AccountingLine) postable);
93 }
94
95
96
97
98 public List<CapitalAssetInformation> getCapitalAssetInformation() {
99 return ObjectUtils.isNull(capitalAssetInformation) ? null : capitalAssetInformation;
100 }
101
102
103
104
105 public void setCapitalAssetInformation(List<CapitalAssetInformation> capitalAssetInformation) {
106 this.capitalAssetInformation = capitalAssetInformation;
107 }
108
109
110
111
112
113
114
115 public Integer getNextCapitalAssetLineNumber() {
116 return nextCapitalAssetLineNumber;
117 }
118
119
120
121
122
123
124 public void setNextCapitalAssetLineNumber(Integer nextCapitalAssetLineNumber) {
125 this.nextCapitalAssetLineNumber = nextCapitalAssetLineNumber;
126 }
127 }