1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.businessobject;
17
18 import java.util.ArrayList;
19 import java.util.HashMap;
20 import java.util.LinkedHashMap;
21 import java.util.List;
22 import java.util.Map;
23
24 import org.apache.commons.lang.StringUtils;
25 import org.kuali.ole.integration.cam.CapitalAssetManagementAsset;
26 import org.kuali.ole.integration.cam.CapitalAssetManagementAssetType;
27 import org.kuali.ole.sys.OLEPropertyConstants;
28 import org.kuali.ole.sys.context.SpringContext;
29 import org.kuali.ole.vnd.businessobject.VendorDetail;
30 import org.kuali.rice.core.api.util.type.KualiDecimal;
31 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
32 import org.kuali.rice.krad.service.KualiModuleService;
33 import org.kuali.rice.krad.util.ObjectUtils;
34
35 public class CapitalAssetInformation extends PersistableBusinessObjectBase {
36
37
38 private String documentNumber;
39 private Integer capitalAssetLineNumber;
40
41 private Integer vendorHeaderGeneratedIdentifier;
42 private Integer vendorDetailAssignedIdentifier;
43 private String vendorName;
44 private Long capitalAssetNumber;
45 private Integer capitalAssetQuantity;
46 private String capitalAssetTypeCode;
47 private String capitalAssetManufacturerName;
48 private String capitalAssetDescription;
49 private String capitalAssetManufacturerModelNumber;
50 private KualiDecimal capitalAssetLineAmount;
51 private String capitalAssetActionIndicator;
52 private boolean capitalAssetProcessedIndicator;
53 private String distributionAmountCode;
54
55 private CapitalAssetManagementAsset capitalAssetManagementAsset;
56 private CapitalAssetManagementAssetType capitalAssetManagementAssetType;
57 private List<CapitalAssetInformationDetail> capitalAssetInformationDetails;
58 private List<CapitalAssetAccountsGroupDetails> capitalAssetAccountsGroupDetails;
59
60 private VendorDetail vendorDetail;
61
62
63
64
65 public CapitalAssetInformation() {
66 super();
67 setCapitalAssetLineAmount(KualiDecimal.ZERO);
68 capitalAssetInformationDetails = new ArrayList<CapitalAssetInformationDetail>();
69 capitalAssetAccountsGroupDetails = new ArrayList<CapitalAssetAccountsGroupDetails>();
70 }
71
72 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
73 LinkedHashMap m = new LinkedHashMap();
74 m.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
75 m.put(OLEPropertyConstants.CAPITAL_ASSET_LINE_NUMBER, this.getCapitalAssetLineNumber());
76
77 return m;
78 }
79
80 public String getCapitalAssetDescription() {
81 return capitalAssetDescription;
82 }
83
84 public void setCapitalAssetDescription(String capitalAssetDescription) {
85 this.capitalAssetDescription = capitalAssetDescription;
86 }
87
88 public String getCapitalAssetManufacturerModelNumber() {
89 return capitalAssetManufacturerModelNumber;
90 }
91
92 public void setCapitalAssetManufacturerModelNumber(String capitalAssetManufacturerModelNumber) {
93 this.capitalAssetManufacturerModelNumber = capitalAssetManufacturerModelNumber;
94 }
95
96 public String getCapitalAssetManufacturerName() {
97 return capitalAssetManufacturerName;
98 }
99
100 public void setCapitalAssetManufacturerName(String capitalAssetManufacturerName) {
101 this.capitalAssetManufacturerName = capitalAssetManufacturerName;
102 }
103
104 public Long getCapitalAssetNumber() {
105 return capitalAssetNumber;
106 }
107
108 public void setCapitalAssetNumber(Long capitalAssetNumber) {
109 this.capitalAssetNumber = capitalAssetNumber;
110 }
111
112 public Integer getCapitalAssetQuantity() {
113
114
115 if (this.capitalAssetQuantity != null) {
116 return this.capitalAssetQuantity;
117 }
118
119 if (ObjectUtils.isNotNull(capitalAssetInformationDetails) && !capitalAssetInformationDetails.isEmpty()) {
120 return capitalAssetInformationDetails.size();
121 }
122
123 return null;
124 }
125
126 public void setCapitalAssetQuantity(Integer capitalAssetQuantity) {
127 this.capitalAssetQuantity = capitalAssetQuantity;
128 }
129
130
131 public String getCapitalAssetTypeCode() {
132 return capitalAssetTypeCode;
133 }
134
135 public void setCapitalAssetTypeCode(String capitalAssetTypeCode) {
136 this.capitalAssetTypeCode = capitalAssetTypeCode;
137 }
138
139 public String getDocumentNumber() {
140 return documentNumber;
141 }
142
143 public void setDocumentNumber(String documentNumber) {
144 this.documentNumber = documentNumber;
145 }
146
147 public Integer getVendorDetailAssignedIdentifier() {
148 return vendorDetailAssignedIdentifier;
149 }
150
151 public void setVendorDetailAssignedIdentifier(Integer vendorDetailedAssignedIdentifier) {
152 this.vendorDetailAssignedIdentifier = vendorDetailedAssignedIdentifier;
153 }
154
155 public Integer getVendorHeaderGeneratedIdentifier() {
156 return vendorHeaderGeneratedIdentifier;
157 }
158
159 public void setVendorHeaderGeneratedIdentifier(Integer vendorHeaderGeneratedIdentifier) {
160 this.vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
161 }
162
163
164
165
166
167
168 public CapitalAssetManagementAsset getCapitalAssetManagementAsset() {
169 capitalAssetManagementAsset = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CapitalAssetManagementAsset.class).retrieveExternalizableBusinessObjectIfNecessary(this, capitalAssetManagementAsset, OLEPropertyConstants.CAPITAL_ASSET_MANAGEMENT_ASSET);
170 return capitalAssetManagementAsset;
171 }
172
173
174
175
176
177
178 public void setCapitalAssetManagementAsset(CapitalAssetManagementAsset capitalAssetManagementAsset) {
179 this.capitalAssetManagementAsset = capitalAssetManagementAsset;
180 }
181
182
183
184
185
186
187 public CapitalAssetManagementAssetType getCapitalAssetManagementAssetType() {
188 capitalAssetManagementAssetType = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CapitalAssetManagementAssetType.class).retrieveExternalizableBusinessObjectIfNecessary(this, capitalAssetManagementAssetType, OLEPropertyConstants.CAPITAL_ASSET_MANAGEMENT_ASSET_TYPE);
189 return capitalAssetManagementAssetType;
190 }
191
192
193
194
195
196
197 @Deprecated
198 public void setCapitalAssetManagementAssetType(CapitalAssetManagementAssetType capitalAssetManagementAssetType) {
199 this.capitalAssetManagementAssetType = capitalAssetManagementAssetType;
200 }
201
202
203
204
205
206
207 public VendorDetail getVendorDetail() {
208 return vendorDetail;
209 }
210
211
212
213
214
215
216 @Deprecated
217 public void setVendorDetail(VendorDetail vendorDetail) {
218 this.vendorDetail = vendorDetail;
219 }
220
221
222
223
224
225
226 public Map<String, Object> getValuesMap() {
227 Map<String, Object> simpleValues = new HashMap<String, Object>();
228
229 simpleValues.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.getDocumentNumber());
230 simpleValues.put(OLEPropertyConstants.VENDOR_HEADER_GENERATED_ID, this.getVendorHeaderGeneratedIdentifier());
231 simpleValues.put(OLEPropertyConstants.VENDOR_DETAIL_ASSIGNED_ID, this.getVendorDetailAssignedIdentifier());
232 simpleValues.put(OLEPropertyConstants.VENDOR_NAME, this.getVendorName());
233 simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_NUMBER, this.getCapitalAssetNumber());
234 simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_TYPE_CODE, this.getCapitalAssetTypeCode());
235 simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_LINE_AMOUNT, this.getCapitalAssetLineAmount());
236 simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_LINE_NUMBER, this.getCapitalAssetLineNumber());
237 simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_ACTION_INDICATOR, this.getCapitalAssetActionIndicator());
238 simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_QUANTITY, this.getCapitalAssetQuantity());
239 simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_PROCESSED_IND, this.isCapitalAssetProcessedIndicator());
240 simpleValues.put(OLEPropertyConstants.CPTLAST_DST_AMT_CD, this.getDistributionAmountCode());
241 return simpleValues;
242 }
243
244
245
246
247
248
249 public String getVendorName() {
250 if (ObjectUtils.isNotNull(vendorDetail)) {
251 vendorName = vendorDetail.getVendorName();
252 }
253 else if (StringUtils.isNotBlank(vendorName) && vendorName.indexOf(" > ") > 0){
254 vendorName = vendorName.substring(vendorName.indexOf(" > ") + 2, vendorName.length());
255 }
256
257 return vendorName;
258 }
259
260
261
262
263
264
265 public void setVendorName(String vendorName) {
266 this.vendorName = vendorName;
267 }
268
269
270
271
272
273
274 public List<CapitalAssetAccountsGroupDetails> getCapitalAssetAccountsGroupDetails() {
275 return capitalAssetAccountsGroupDetails;
276 }
277
278
279
280
281
282
283 public void setCapitalAssetAccountsGroupDetails(List<CapitalAssetAccountsGroupDetails> capitalAssetAccountsGroupDetails) {
284 this.capitalAssetAccountsGroupDetails = capitalAssetAccountsGroupDetails;
285 }
286
287
288
289
290
291
292 public List<CapitalAssetInformationDetail> getCapitalAssetInformationDetails() {
293 return capitalAssetInformationDetails;
294 }
295
296
297
298
299
300
301 public void setCapitalAssetInformationDetails(List<CapitalAssetInformationDetail> capitalAssetInformationDetails) {
302 this.capitalAssetInformationDetails = capitalAssetInformationDetails;
303 }
304
305
306
307
308
309 public Integer getCapitalAssetLineNumber() {
310 return capitalAssetLineNumber;
311 }
312
313
314
315
316
317 public void setCapitalAssetLineNumber(Integer capitalAssetLineNumber) {
318 this.capitalAssetLineNumber = capitalAssetLineNumber;
319 }
320
321
322
323
324 public KualiDecimal getCapitalAssetLineAmount() {
325 if (ObjectUtils.isNull(capitalAssetLineAmount)) {
326 return KualiDecimal.ZERO;
327 }
328 else {
329 return capitalAssetLineAmount;
330 }
331 }
332
333
334
335
336 public void setCapitalAssetLineAmount(KualiDecimal capitalAssetLineAmount) {
337 if (ObjectUtils.isNull(capitalAssetLineAmount)) {
338 this.capitalAssetLineAmount = KualiDecimal.ZERO;
339 }
340 else {
341 this.capitalAssetLineAmount = capitalAssetLineAmount;
342 }
343
344 this.capitalAssetLineAmount = capitalAssetLineAmount;
345 }
346
347
348
349
350
351
352
353
354 public String getCapitalAssetActionIndicator() {
355 return capitalAssetActionIndicator;
356 }
357
358
359
360
361
362
363 public void setCapitalAssetActionIndicator(String capitalAssetActionIndicator) {
364 this.capitalAssetActionIndicator = capitalAssetActionIndicator;
365 }
366
367
368
369
370
371
372
373 public boolean isCapitalAssetProcessedIndicator() {
374 return capitalAssetProcessedIndicator;
375 }
376
377
378
379
380
381
382 public void setCapitalAssetProcessedIndicator(boolean capitalAssetProcessedIndicator) {
383 this.capitalAssetProcessedIndicator = capitalAssetProcessedIndicator;
384 }
385
386
387
388
389
390
391
392 public String getDistributionAmountCode() {
393 return distributionAmountCode;
394 }
395
396
397
398
399
400
401 public void setDistributionAmountCode(String distributionAmountCode) {
402 this.distributionAmountCode = distributionAmountCode;
403 }
404 }