1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.coa.businessobject;
17
18 import java.util.LinkedHashMap;
19
20 import org.apache.commons.lang.StringUtils;
21 import org.kuali.ole.coa.service.ChartService;
22 import org.kuali.ole.sys.OLEConstants;
23 import org.kuali.ole.sys.context.SpringContext;
24 import org.kuali.rice.kim.api.identity.Person;
25 import org.kuali.rice.kim.api.identity.PersonService;
26 import org.kuali.rice.krad.bo.KualiCode;
27 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
28
29
30
31
32 public class Chart extends PersistableBusinessObjectBase implements KualiCode {
33
34 private static final long serialVersionUID = 4129020803214027609L;
35
36 public static final String CACHE_NAME = OLEConstants.APPLICATION_NAMESPACE_CODE + "/" + "Chart";
37
38 protected String finChartOfAccountDescription;
39 protected boolean active;
40 protected String finCoaManagerPrincipalId;
41 protected String reportsToChartOfAccountsCode;
42 protected String chartOfAccountsCode;
43 protected String finAccountsPayableObjectCode;
44 protected String finExternalEncumbranceObjCd;
45 protected String finPreEncumbranceObjectCode;
46 protected String financialCashObjectCode;
47 protected String icrIncomeFinancialObjectCode;
48 protected String finAccountsReceivableObjCode;
49 protected String finInternalEncumbranceObjCd;
50 protected String icrExpenseFinancialObjectCd;
51 protected String incBdgtEliminationsFinObjCd;
52 protected String expBdgtEliminationsFinObjCd;
53 protected String fundBalanceObjectCode;
54
55 protected ObjectCode incBdgtEliminationsFinObj;
56 protected ObjectCode expBdgtEliminationsFinObj;
57 protected ObjectCode finAccountsPayableObject;
58 protected ObjectCode finExternalEncumbranceObj;
59 protected ObjectCode finPreEncumbranceObject;
60 protected ObjectCode financialCashObject;
61 protected ObjectCode icrIncomeFinancialObject;
62 protected ObjectCode finAccountsReceivableObj;
63 protected ObjectCode finInternalEncumbranceObj;
64 protected ObjectCode icrExpenseFinancialObject;
65 protected ObjectCode fundBalanceObject;
66 protected Person finCoaManager;
67 protected Chart reportsToChartOfAccounts;
68
69 private static transient ChartService chartService;
70
71
72
73
74
75
76 public String getFinChartOfAccountDescription() {
77 return finChartOfAccountDescription;
78 }
79
80
81
82
83
84
85 public void setFinChartOfAccountDescription(String finChartOfAccountDescription) {
86 this.finChartOfAccountDescription = finChartOfAccountDescription;
87 }
88
89
90
91
92
93
94 public boolean isActive() {
95 return active;
96 }
97
98
99
100
101
102
103 public void setActive(boolean active) {
104 this.active = active;
105 }
106
107
108
109
110
111
112
113 public ObjectCode getFinAccountsPayableObject() {
114 return finAccountsPayableObject;
115 }
116
117
118
119
120
121
122
123 public void setFinAccountsPayableObject(ObjectCode finAccountsPayableObject) {
124 this.finAccountsPayableObject = finAccountsPayableObject;
125 }
126
127
128
129
130
131
132
133 public ObjectCode getFinExternalEncumbranceObj() {
134 return finExternalEncumbranceObj;
135 }
136
137
138
139
140
141
142
143 public void setFinExternalEncumbranceObj(ObjectCode finExternalEncumbranceObj) {
144 this.finExternalEncumbranceObj = finExternalEncumbranceObj;
145 }
146
147
148
149
150
151
152 public ObjectCode getFinPreEncumbranceObject() {
153 return finPreEncumbranceObject;
154 }
155
156
157
158
159
160
161
162 public void setFinPreEncumbranceObject(ObjectCode finPreEncumbranceObject) {
163 this.finPreEncumbranceObject = finPreEncumbranceObject;
164 }
165
166
167
168
169
170
171 public ObjectCode getFinancialCashObject() {
172 return financialCashObject;
173 }
174
175
176
177
178
179
180
181 public void setFinancialCashObject(ObjectCode financialCashObject) {
182 this.financialCashObject = financialCashObject;
183 }
184
185
186
187
188
189
190 public ObjectCode getIcrIncomeFinancialObject() {
191 return icrIncomeFinancialObject;
192 }
193
194
195
196
197
198
199
200 public void setIcrIncomeFinancialObject(ObjectCode icrIncomeFinancialObject) {
201 this.icrIncomeFinancialObject = icrIncomeFinancialObject;
202 }
203
204
205
206
207
208
209 public ObjectCode getFinAccountsReceivableObj() {
210 return finAccountsReceivableObj;
211 }
212
213
214
215
216
217
218
219 public void setFinAccountsReceivableObj(ObjectCode finAccountsReceivableObj) {
220 this.finAccountsReceivableObj = finAccountsReceivableObj;
221 }
222
223 public Person getFinCoaManager() {
224 finCoaManager = SpringContext.getBean(PersonService.class).updatePersonIfNecessary(getFinCoaManagerPrincipalId(), finCoaManager);
225 return finCoaManager;
226 }
227
228
229
230
231
232
233
234 public void setFinCoaManager(Person finCoaManagerUniversal) {
235 this.finCoaManager = finCoaManagerUniversal;
236 }
237
238
239
240
241
242
243 public Chart getReportsToChartOfAccounts() {
244 return reportsToChartOfAccounts;
245 }
246
247
248
249
250
251
252
253 public void setReportsToChartOfAccounts(Chart reportsToChartOfAccounts) {
254 this.reportsToChartOfAccounts = reportsToChartOfAccounts;
255 }
256
257
258
259
260
261
262 public ObjectCode getFinInternalEncumbranceObj() {
263 return finInternalEncumbranceObj;
264 }
265
266
267
268
269
270
271
272 public void setFinInternalEncumbranceObj(ObjectCode finInternalEncumbranceObj) {
273 this.finInternalEncumbranceObj = finInternalEncumbranceObj;
274 }
275
276
277
278
279
280
281 public ObjectCode getIcrExpenseFinancialObject() {
282 return icrExpenseFinancialObject;
283 }
284
285
286
287
288
289
290
291 public void setIcrExpenseFinancialObject(ObjectCode icrExpenseFinancialObject) {
292 this.icrExpenseFinancialObject = icrExpenseFinancialObject;
293 }
294
295
296
297
298
299
300 public String getChartOfAccountsCode() {
301 return chartOfAccountsCode;
302 }
303
304
305
306
307
308
309 public void setChartOfAccountsCode(String chartOfAccountsCode) {
310 this.chartOfAccountsCode = chartOfAccountsCode;
311 }
312
313
314
315
316
317
318 public ObjectCode getExpBdgtEliminationsFinObj() {
319 return expBdgtEliminationsFinObj;
320 }
321
322
323
324
325
326
327
328 public void setExpBdgtEliminationsFinObj(ObjectCode expBdgtEliminationsFinObj) {
329 this.expBdgtEliminationsFinObj = expBdgtEliminationsFinObj;
330 }
331
332
333
334
335
336
337 public ObjectCode getIncBdgtEliminationsFinObj() {
338 return incBdgtEliminationsFinObj;
339 }
340
341
342
343
344
345
346
347 public void setIncBdgtEliminationsFinObj(ObjectCode incBdgtEliminationsFinObj) {
348 this.incBdgtEliminationsFinObj = incBdgtEliminationsFinObj;
349 }
350
351
352
353
354 @SuppressWarnings("unchecked")
355 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
356 LinkedHashMap m = new LinkedHashMap();
357
358 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
359
360 return m;
361 }
362
363
364
365
366
367
368 public String getFinAccountsPayableObjectCode() {
369 return finAccountsPayableObjectCode;
370 }
371
372
373
374
375
376
377 public void setFinAccountsPayableObjectCode(String finAccountsPayableObjectCode) {
378 this.finAccountsPayableObjectCode = finAccountsPayableObjectCode;
379 }
380
381
382
383
384
385
386 public String getFinAccountsReceivableObjCode() {
387 return finAccountsReceivableObjCode;
388 }
389
390
391
392
393
394
395 public void setFinAccountsReceivableObjCode(String finAccountsReceivableObjCode) {
396 this.finAccountsReceivableObjCode = finAccountsReceivableObjCode;
397 }
398
399
400
401
402
403
404 public String getFinancialCashObjectCode() {
405 return financialCashObjectCode;
406 }
407
408
409
410
411
412
413 public void setFinancialCashObjectCode(String financialCashObjectCode) {
414 this.financialCashObjectCode = financialCashObjectCode;
415 }
416
417
418
419
420
421
422 public String getFinExternalEncumbranceObjCd() {
423 return finExternalEncumbranceObjCd;
424 }
425
426
427
428
429
430
431 public void setFinExternalEncumbranceObjCd(String finExternalEncumbranceObjCd) {
432 this.finExternalEncumbranceObjCd = finExternalEncumbranceObjCd;
433 }
434
435
436
437
438
439
440 public String getFinInternalEncumbranceObjCd() {
441 return finInternalEncumbranceObjCd;
442 }
443
444
445
446
447
448
449 public void setFinInternalEncumbranceObjCd(String finInternalEncumbranceObjCd) {
450 this.finInternalEncumbranceObjCd = finInternalEncumbranceObjCd;
451 }
452
453
454
455
456
457
458 public String getFinPreEncumbranceObjectCode() {
459 return finPreEncumbranceObjectCode;
460 }
461
462
463
464
465
466
467 public void setFinPreEncumbranceObjectCode(String finPreEncumbranceObjectCode) {
468 this.finPreEncumbranceObjectCode = finPreEncumbranceObjectCode;
469 }
470
471
472
473
474
475
476 public String getIcrExpenseFinancialObjectCd() {
477 return icrExpenseFinancialObjectCd;
478 }
479
480
481
482
483
484
485 public void setIcrExpenseFinancialObjectCd(String icrExpenseFinancialObjectCd) {
486 this.icrExpenseFinancialObjectCd = icrExpenseFinancialObjectCd;
487 }
488
489
490
491
492
493
494 public String getIcrIncomeFinancialObjectCode() {
495 return icrIncomeFinancialObjectCode;
496 }
497
498
499
500
501
502
503 public void setIcrIncomeFinancialObjectCode(String icrIncomeFinancialObjectCode) {
504 this.icrIncomeFinancialObjectCode = icrIncomeFinancialObjectCode;
505 }
506
507
508
509
510
511
512 public String getExpBdgtEliminationsFinObjCd() {
513 return expBdgtEliminationsFinObjCd;
514 }
515
516
517
518
519
520
521 public void setExpBdgtEliminationsFinObjCd(String expBdgtEliminationsFinObjCd) {
522 this.expBdgtEliminationsFinObjCd = expBdgtEliminationsFinObjCd;
523 }
524
525
526
527
528
529
530 public String getIncBdgtEliminationsFinObjCd() {
531 return incBdgtEliminationsFinObjCd;
532 }
533
534
535
536
537
538
539 public void setIncBdgtEliminationsFinObjCd(String incBdgtEliminationsFinObjCd) {
540 this.incBdgtEliminationsFinObjCd = incBdgtEliminationsFinObjCd;
541 }
542
543
544
545
546
547
548 public String getFinCoaManagerPrincipalId() {
549 if (StringUtils.isNotBlank(chartOfAccountsCode) && StringUtils.isBlank(finCoaManagerPrincipalId)) {
550 Person chartManager = getChartService().getChartManager(chartOfAccountsCode);
551 if (chartManager != null) {
552 finCoaManager = chartManager;
553 finCoaManagerPrincipalId = chartManager.getPrincipalId();
554 } else {
555 finCoaManagerPrincipalId = null;
556 finCoaManager = null;
557 }
558 }
559 return finCoaManagerPrincipalId;
560 }
561
562
563
564
565
566
567 public void setFinCoaManagerPrincipalId(String finCoaManagerPrincipalId) {
568 this.finCoaManagerPrincipalId = finCoaManagerPrincipalId;
569 }
570
571
572
573
574 public String getReportsToChartOfAccountsCode() {
575 return reportsToChartOfAccountsCode;
576 }
577
578
579
580
581 public void setReportsToChartOfAccountsCode(String reportsToChartOfAccountsCode) {
582 this.reportsToChartOfAccountsCode = reportsToChartOfAccountsCode;
583 }
584
585
586
587
588
589
590 public ObjectCode getFundBalanceObject() {
591 return fundBalanceObject;
592 }
593
594
595
596
597
598
599
600 public void setFundBalanceObject(ObjectCode fundBalanceObject) {
601 this.fundBalanceObject = fundBalanceObject;
602 }
603
604
605
606
607
608
609 public String getFundBalanceObjectCode() {
610 return fundBalanceObjectCode;
611 }
612
613
614
615
616
617
618 public void setFundBalanceObjectCode(String fundBalanceObjectCode) {
619 this.fundBalanceObjectCode = fundBalanceObjectCode;
620 }
621
622
623
624
625 public String getCodeAndDescription() {
626 if (StringUtils.isNotBlank(getChartOfAccountsCode()) && StringUtils.isNotBlank(getFinChartOfAccountDescription()))
627 return getChartOfAccountsCode() + " - " + getFinChartOfAccountDescription();
628 else
629 return "";
630 }
631
632 public String getCode() {
633 return this.chartOfAccountsCode;
634 }
635
636 public String getName() {
637 return this.finChartOfAccountDescription;
638 }
639
640 protected static ChartService getChartService() {
641 if ( chartService == null ) {
642 chartService = SpringContext.getBean(ChartService.class);
643 }
644 return chartService;
645 }
646
647 public void setCode(String chartOfAccountsCode) {
648 setChartOfAccountsCode(chartOfAccountsCode);
649 }
650
651 public void setName(String finChartOfAccountDescription) {
652 setFinChartOfAccountDescription(finChartOfAccountDescription);
653 }
654
655 public String getChartCodeForReport() {
656 return this.chartOfAccountsCode;
657 }
658 }
659