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