1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.gl.businessobject;
18
19 import java.sql.Date;
20 import java.util.LinkedHashMap;
21
22 import org.apache.commons.lang.StringUtils;
23 import org.kuali.ole.coa.businessobject.Account;
24 import org.kuali.ole.coa.businessobject.AccountingPeriod;
25 import org.kuali.ole.coa.businessobject.BalanceType;
26 import org.kuali.ole.coa.businessobject.Chart;
27 import org.kuali.ole.coa.businessobject.ObjectCode;
28 import org.kuali.ole.coa.businessobject.ObjectType;
29 import org.kuali.ole.coa.businessobject.ProjectCode;
30 import org.kuali.ole.coa.businessobject.SubAccount;
31 import org.kuali.ole.coa.businessobject.SubObjectCode;
32 import org.kuali.ole.sys.OLEPropertyConstants;
33 import org.kuali.ole.sys.businessobject.SystemOptions;
34 import org.kuali.ole.sys.businessobject.UniversityDate;
35 import org.kuali.ole.sys.context.SpringContext;
36 import org.kuali.rice.core.api.util.type.KualiDecimal;
37 import org.kuali.rice.kew.api.doctype.DocumentTypeService;
38 import org.kuali.rice.kew.doctype.bo.DocumentType;
39 import org.kuali.rice.kew.doctype.bo.DocumentTypeEBO;
40 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
41
42
43
44
45 public class Reversal extends PersistableBusinessObjectBase implements Transaction {
46
47 private Date financialDocumentReversalDate;
48 private Integer universityFiscalYear;
49 private String chartOfAccountsCode;
50 private String accountNumber;
51 private String subAccountNumber;
52 private String financialObjectCode;
53 private String financialSubObjectCode;
54 private String financialBalanceTypeCode;
55 private String financialObjectTypeCode;
56 private String universityFiscalPeriodCode;
57 private String financialDocumentTypeCode;
58 private String financialSystemOriginationCode;
59 private String documentNumber;
60 private Integer transactionLedgerEntrySequenceNumber;
61 private String transactionLedgerEntryDescription;
62 private KualiDecimal transactionLedgerEntryAmount;
63 private String transactionDebitCreditCode;
64 private Date transactionDate;
65 private String organizationDocumentNumber;
66 private String projectCode;
67 private String organizationReferenceId;
68 private String referenceFinancialDocumentTypeCode;
69 private String referenceFinancialSystemOriginationCode;
70 private String referenceFinancialDocumentNumber;
71 private String transactionEncumbranceUpdateCode;
72 private Date transactionPostingDate;
73
74
75 private Account account;
76 private SubAccount subAccount;
77 private BalanceType balanceType;
78 private Chart chart;
79 private ObjectCode financialObject;
80 private SubObjectCode financialSubObject;
81 private ObjectType objectType;
82 private ProjectCode project;
83 private DocumentTypeEBO financialSystemDocumentTypeCode;
84 private UniversityDate universityDate;
85 private SystemOptions option;
86 private AccountingPeriod accountingPeriod;
87 private UniversityDate reversalDate;
88
89
90
91
92 public Reversal() {
93
94 }
95
96 public Reversal(Transaction t) {
97 setUniversityFiscalYear(t.getUniversityFiscalYear());
98 setChartOfAccountsCode(t.getChartOfAccountsCode());
99 setAccountNumber(t.getAccountNumber());
100 setSubAccountNumber(t.getSubAccountNumber());
101 setFinancialObjectCode(t.getFinancialObjectCode());
102 setFinancialSubObjectCode(t.getFinancialSubObjectCode());
103 setFinancialBalanceTypeCode(t.getFinancialBalanceTypeCode());
104 setFinancialObjectTypeCode(t.getFinancialObjectTypeCode());
105 setUniversityFiscalPeriodCode(t.getUniversityFiscalPeriodCode());
106 setFinancialDocumentTypeCode(t.getFinancialDocumentTypeCode());
107 setFinancialSystemOriginationCode(t.getFinancialSystemOriginationCode());
108 setDocumentNumber(t.getDocumentNumber());
109 setTransactionLedgerEntrySequenceNumber(t.getTransactionLedgerEntrySequenceNumber());
110 setTransactionLedgerEntryDescription(t.getTransactionLedgerEntryDescription());
111 setTransactionLedgerEntryAmount(t.getTransactionLedgerEntryAmount());
112 setTransactionDebitCreditCode(t.getTransactionDebitCreditCode());
113 setTransactionDate(t.getTransactionDate());
114 setOrganizationDocumentNumber(t.getOrganizationDocumentNumber());
115 setProjectCode(t.getProjectCode());
116 setOrganizationReferenceId(t.getOrganizationReferenceId());
117 setReferenceFinancialDocumentTypeCode(t.getReferenceFinancialDocumentTypeCode());
118 setReferenceFinancialSystemOriginationCode(t.getReferenceFinancialSystemOriginationCode());
119 setReferenceFinancialDocumentNumber(t.getReferenceFinancialDocumentNumber());
120 setFinancialDocumentReversalDate(t.getFinancialDocumentReversalDate());
121 setTransactionEncumbranceUpdateCode(t.getTransactionEncumbranceUpdateCode());
122 if (transactionPostingDate != null) {
123 setTransactionPostingDate(new Date(transactionPostingDate.getTime()));
124 }
125 }
126
127
128
129
130
131
132 @Override
133 public Date getFinancialDocumentReversalDate() {
134 return financialDocumentReversalDate;
135 }
136
137
138
139
140
141
142 public void setFinancialDocumentReversalDate(Date financialDocumentReversalDate) {
143 this.financialDocumentReversalDate = financialDocumentReversalDate;
144 }
145
146
147
148
149
150
151 @Override
152 public Integer getUniversityFiscalYear() {
153 return universityFiscalYear;
154 }
155
156
157
158
159
160
161 public void setUniversityFiscalYear(Integer universityFiscalYear) {
162 this.universityFiscalYear = universityFiscalYear;
163 }
164
165
166
167
168
169
170 @Override
171 public String getChartOfAccountsCode() {
172 return chartOfAccountsCode;
173 }
174
175
176
177
178
179
180 public void setChartOfAccountsCode(String chartOfAccountsCode) {
181 this.chartOfAccountsCode = chartOfAccountsCode;
182 }
183
184
185
186
187
188
189 @Override
190 public String getAccountNumber() {
191 return accountNumber;
192 }
193
194
195
196
197
198
199 public void setAccountNumber(String accountNumber) {
200 this.accountNumber = accountNumber;
201 }
202
203
204
205
206
207
208 @Override
209 public String getSubAccountNumber() {
210 return subAccountNumber;
211 }
212
213
214
215
216
217
218 public void setSubAccountNumber(String subAccountNumber) {
219 this.subAccountNumber = subAccountNumber;
220 }
221
222
223
224
225
226
227 @Override
228 public String getFinancialObjectCode() {
229 return financialObjectCode;
230 }
231
232
233
234
235
236
237 public void setFinancialObjectCode(String financialObjectCode) {
238 this.financialObjectCode = financialObjectCode;
239 }
240
241
242
243
244
245
246 @Override
247 public String getFinancialSubObjectCode() {
248 return financialSubObjectCode;
249 }
250
251
252
253
254
255
256 public void setFinancialSubObjectCode(String financialSubObjectCode) {
257 this.financialSubObjectCode = financialSubObjectCode;
258 }
259
260
261
262
263
264
265 @Override
266 public String getFinancialBalanceTypeCode() {
267 return financialBalanceTypeCode;
268 }
269
270
271
272
273
274
275 public void setFinancialBalanceTypeCode(String financialBalanceTypeCode) {
276 this.financialBalanceTypeCode = financialBalanceTypeCode;
277 }
278
279
280
281
282
283
284 @Override
285 public String getFinancialObjectTypeCode() {
286 return financialObjectTypeCode;
287 }
288
289
290
291
292
293
294 public void setFinancialObjectTypeCode(String financialObjectTypeCode) {
295 this.financialObjectTypeCode = financialObjectTypeCode;
296 }
297
298
299
300
301
302
303 @Override
304 public String getUniversityFiscalPeriodCode() {
305 return universityFiscalPeriodCode;
306 }
307
308
309
310
311
312
313 public void setUniversityFiscalPeriodCode(String universityFiscalPeriodCode) {
314 this.universityFiscalPeriodCode = universityFiscalPeriodCode;
315 }
316
317
318
319
320
321
322 @Override
323 public String getFinancialDocumentTypeCode() {
324 return financialDocumentTypeCode;
325 }
326
327
328
329
330
331
332 public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
333 this.financialDocumentTypeCode = financialDocumentTypeCode;
334 }
335
336
337
338
339
340
341 @Override
342 public String getFinancialSystemOriginationCode() {
343 return financialSystemOriginationCode;
344 }
345
346
347
348
349
350
351 public void setFinancialSystemOriginationCode(String financialSystemOriginationCode) {
352 this.financialSystemOriginationCode = financialSystemOriginationCode;
353 }
354
355
356
357
358
359
360 @Override
361 public String getDocumentNumber() {
362 return documentNumber;
363 }
364
365
366
367
368
369
370 public void setDocumentNumber(String documentNumber) {
371 this.documentNumber = documentNumber;
372 }
373
374
375
376
377
378
379 @Override
380 public Integer getTransactionLedgerEntrySequenceNumber() {
381 return transactionLedgerEntrySequenceNumber;
382 }
383
384
385
386
387
388
389 public void setTransactionLedgerEntrySequenceNumber(Integer transactionLedgerEntrySequenceNumber) {
390 this.transactionLedgerEntrySequenceNumber = transactionLedgerEntrySequenceNumber;
391 }
392
393
394
395
396
397
398 @Override
399 public String getTransactionLedgerEntryDescription() {
400 return transactionLedgerEntryDescription;
401 }
402
403
404
405
406
407
408 public void setTransactionLedgerEntryDescription(String transactionLedgerEntryDescription) {
409 this.transactionLedgerEntryDescription = transactionLedgerEntryDescription;
410 }
411
412
413
414
415
416
417 @Override
418 public KualiDecimal getTransactionLedgerEntryAmount() {
419 return transactionLedgerEntryAmount;
420 }
421
422
423
424
425
426
427 public void setTransactionLedgerEntryAmount(KualiDecimal transactionLedgerEntryAmount) {
428 this.transactionLedgerEntryAmount = transactionLedgerEntryAmount;
429 }
430
431
432
433
434
435
436 @Override
437 public String getTransactionDebitCreditCode() {
438 return transactionDebitCreditCode;
439 }
440
441
442
443
444
445
446 public void setTransactionDebitCreditCode(String transactionDebitCreditCode) {
447 this.transactionDebitCreditCode = transactionDebitCreditCode;
448 }
449
450
451
452
453
454
455 @Override
456 public Date getTransactionDate() {
457 return transactionDate;
458 }
459
460
461
462
463
464
465 public void setTransactionDate(Date transactionDate) {
466 this.transactionDate = transactionDate;
467 }
468
469
470
471
472
473
474 @Override
475 public String getOrganizationDocumentNumber() {
476 return organizationDocumentNumber;
477 }
478
479
480
481
482
483
484 public void setOrganizationDocumentNumber(String organizationDocumentNumber) {
485 this.organizationDocumentNumber = organizationDocumentNumber;
486 }
487
488
489
490
491
492
493 @Override
494 public String getProjectCode() {
495 return projectCode;
496 }
497
498
499
500
501
502
503 public void setProjectCode(String projectCode) {
504 this.projectCode = projectCode;
505 }
506
507
508
509
510
511
512 @Override
513 public String getOrganizationReferenceId() {
514 return organizationReferenceId;
515 }
516
517
518
519
520
521
522 public void setOrganizationReferenceId(String organizationReferenceId) {
523 this.organizationReferenceId = organizationReferenceId;
524 }
525
526
527
528
529
530
531 @Override
532 public String getReferenceFinancialDocumentTypeCode() {
533 return referenceFinancialDocumentTypeCode;
534 }
535
536
537
538
539
540
541 public void setReferenceFinancialDocumentTypeCode(String referenceFinancialDocumentTypeCode) {
542 this.referenceFinancialDocumentTypeCode = referenceFinancialDocumentTypeCode;
543 }
544
545
546
547
548
549
550 @Override
551 public String getReferenceFinancialSystemOriginationCode() {
552 return referenceFinancialSystemOriginationCode;
553 }
554
555
556
557
558
559
560 public void setReferenceFinancialSystemOriginationCode(String referenceFinancialSystemOriginationCode) {
561 this.referenceFinancialSystemOriginationCode = referenceFinancialSystemOriginationCode;
562 }
563
564
565
566
567
568
569 @Override
570 public String getReferenceFinancialDocumentNumber() {
571 return referenceFinancialDocumentNumber;
572 }
573
574
575
576
577
578
579 public void setReferenceFinancialDocumentNumber(String referenceFinancialDocumentNumber) {
580 this.referenceFinancialDocumentNumber = referenceFinancialDocumentNumber;
581 }
582
583
584
585
586
587
588 @Override
589 public String getTransactionEncumbranceUpdateCode() {
590 return transactionEncumbranceUpdateCode;
591 }
592
593
594
595
596
597
598 public void setTransactionEncumbranceUpdateCode(String transactionEncumbranceUpdateCode) {
599 this.transactionEncumbranceUpdateCode = transactionEncumbranceUpdateCode;
600 }
601
602
603
604
605
606
607 public Date getTransactionPostingDate() {
608 return transactionPostingDate;
609 }
610
611
612
613
614
615
616 public void setTransactionPostingDate(Date transactionPostingDate) {
617 this.transactionPostingDate = transactionPostingDate;
618 }
619
620 @Override
621 public Account getAccount() {
622 return account;
623 }
624
625 @Override
626 public void setAccount(Account account) {
627 this.account = account;
628 }
629
630 public AccountingPeriod getAccountingPeriod() {
631 return accountingPeriod;
632 }
633
634 public void setAccountingPeriod(AccountingPeriod accountingPeriod) {
635 this.accountingPeriod = accountingPeriod;
636 }
637
638 @Override
639 public BalanceType getBalanceType() {
640 return balanceType;
641 }
642
643 @Override
644 public void setBalanceType(BalanceType balanceType) {
645 this.balanceType = balanceType;
646 }
647
648 @Override
649 public Chart getChart() {
650 return chart;
651 }
652
653 @Override
654 public void setChart(Chart chart) {
655 this.chart = chart;
656 }
657
658 @Override
659 public DocumentTypeEBO getFinancialSystemDocumentTypeCode() {
660 if ( StringUtils.isBlank( financialDocumentTypeCode ) ) {
661 financialSystemDocumentTypeCode = null;
662 } else {
663 if ( financialSystemDocumentTypeCode == null || !StringUtils.equals(financialDocumentTypeCode, financialSystemDocumentTypeCode.getName() ) ) {
664 org.kuali.rice.kew.api.doctype.DocumentType docType = SpringContext.getBean(DocumentTypeService.class).getDocumentTypeByName(financialDocumentTypeCode);
665 if ( docType != null ) {
666 financialSystemDocumentTypeCode = DocumentType.from( docType );
667 } else {
668 financialSystemDocumentTypeCode = null;
669 }
670 }
671 }
672 return financialSystemDocumentTypeCode;
673 }
674
675 @Override
676 public ObjectCode getFinancialObject() {
677 return financialObject;
678 }
679
680 @Override
681 public void setFinancialObject(ObjectCode financialObject) {
682 this.financialObject = financialObject;
683 }
684
685 @Override
686 public SubObjectCode getFinancialSubObject() {
687 return financialSubObject;
688 }
689
690 public void setFinancialSubObject(SubObjectCode financialSubObject) {
691 this.financialSubObject = financialSubObject;
692 }
693
694 @Override
695 public ObjectType getObjectType() {
696 return objectType;
697 }
698
699 @Override
700 public void setObjectType(ObjectType objectType) {
701 this.objectType = objectType;
702 }
703
704 @Override
705 public SystemOptions getOption() {
706 return option;
707 }
708
709 @Override
710 public void setOption(SystemOptions option) {
711 this.option = option;
712 }
713
714 public ProjectCode getProject() {
715 return project;
716 }
717
718 public void setProject(ProjectCode project) {
719 this.project = project;
720 }
721
722 public UniversityDate getReversalDate() {
723 return reversalDate;
724 }
725
726 public void setReversalDate(UniversityDate reversalDate) {
727 this.reversalDate = reversalDate;
728 }
729
730 @Override
731 public SubAccount getSubAccount() {
732 return subAccount;
733 }
734
735 public void setSubAccount(SubAccount subAccount) {
736 this.subAccount = subAccount;
737 }
738
739 public UniversityDate getUniversityDate() {
740 return universityDate;
741 }
742
743 public void setUniversityDate(UniversityDate universityDate) {
744 this.universityDate = universityDate;
745 }
746
747 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
748 LinkedHashMap map = new LinkedHashMap();
749 map.put("universityFiscalYear", getUniversityFiscalYear());
750 map.put("chartOfAccountsCode", getChartOfAccountsCode());
751 map.put("accountNumber", getAccountNumber());
752 map.put("subAccountNumber", getSubAccountNumber());
753 map.put("financialObjectCode", getFinancialObjectCode());
754 map.put("financialSubObjectCode", getFinancialSubObjectCode());
755 map.put("financialBalanceTypeCode", getFinancialBalanceTypeCode());
756 map.put("financialObjectTypeCode", getFinancialObjectTypeCode());
757 map.put("universityFiscalPeriodCode", getUniversityFiscalPeriodCode());
758 map.put("financialDocumentTypeCode", getFinancialDocumentTypeCode());
759 map.put("financialSystemOriginationCode", getFinancialSystemOriginationCode());
760 map.put(OLEPropertyConstants.DOCUMENT_NUMBER, getDocumentNumber());
761 map.put("transactionLedgerEntrySequenceNumber", getTransactionLedgerEntrySequenceNumber());
762 return map;
763 }
764 }