1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.sys.businessobject;
18
19 import java.io.Serializable;
20 import java.sql.Date;
21 import java.sql.Timestamp;
22 import java.util.LinkedHashMap;
23
24 import org.apache.commons.lang.StringUtils;
25 import org.kuali.ole.coa.businessobject.A21SubAccount;
26 import org.kuali.ole.coa.businessobject.Account;
27 import org.kuali.ole.coa.businessobject.AccountingPeriod;
28 import org.kuali.ole.coa.businessobject.BalanceType;
29 import org.kuali.ole.coa.businessobject.Chart;
30 import org.kuali.ole.coa.businessobject.ObjectCode;
31 import org.kuali.ole.coa.businessobject.ObjectType;
32 import org.kuali.ole.coa.businessobject.ProjectCode;
33 import org.kuali.ole.coa.businessobject.SubAccount;
34 import org.kuali.ole.coa.businessobject.SubObjectCode;
35 import org.kuali.ole.gl.businessobject.Transaction;
36 import org.kuali.ole.gl.businessobject.TransientBalanceInquiryAttributes;
37 import org.kuali.ole.sys.OLEPropertyConstants;
38 import org.kuali.ole.sys.context.SpringContext;
39 import org.kuali.ole.sys.document.validation.impl.AccountingDocumentRuleBaseConstants.GENERAL_LEDGER_PENDING_ENTRY_CODE;
40 import org.kuali.rice.core.api.util.type.KualiDecimal;
41 import org.kuali.rice.core.web.format.CurrencyFormatter;
42 import org.kuali.rice.kew.api.doctype.DocumentTypeService;
43 import org.kuali.rice.kew.doctype.bo.DocumentType;
44 import org.kuali.rice.kew.doctype.bo.DocumentTypeEBO;
45 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
46
47
48
49
50 public class GeneralLedgerPendingEntry extends PersistableBusinessObjectBase implements Transaction, Serializable, Cloneable {
51 private static final long serialVersionUID = 4041748389323105932L;
52 private String financialSystemOriginationCode;
53 private String documentNumber;
54 private Integer transactionLedgerEntrySequenceNumber;
55 private String chartOfAccountsCode;
56 private String accountNumber;
57 private String subAccountNumber;
58 private String financialObjectCode;
59 private String financialSubObjectCode;
60 private String financialBalanceTypeCode;
61 private String financialObjectTypeCode;
62 private Integer universityFiscalYear;
63 private String universityFiscalPeriodCode;
64 private String transactionLedgerEntryDescription;
65 private KualiDecimal transactionLedgerEntryAmount;
66 private String transactionDebitCreditCode;
67 private Date transactionDate;
68 private String financialDocumentTypeCode;
69 private String organizationDocumentNumber;
70 private String projectCode;
71 private String organizationReferenceId;
72 private String referenceFinancialDocumentTypeCode;
73 private String referenceFinancialSystemOriginationCode;
74 private String referenceFinancialDocumentNumber;
75 private Date financialDocumentReversalDate;
76 private String transactionEncumbranceUpdateCode;
77 private String financialDocumentApprovedCode;
78 private String acctSufficientFundsFinObjCd;
79 private boolean transactionEntryOffsetIndicator;
80 private Timestamp transactionEntryProcessedTs;
81
82 private DocumentTypeEBO financialSystemDocumentTypeCode;
83 private FinancialSystemDocumentHeader documentHeader;
84
85 private SystemOptions option;
86 private Chart chart;
87 private Account account;
88 private SubAccount subAccount;
89 private ObjectCode financialObject;
90 private SubObjectCode financialSubObject;
91 private BalanceType balanceType;
92 private ObjectType objectType;
93 private A21SubAccount a21SubAccount;
94 private TransientBalanceInquiryAttributes dummyBusinessObject;
95 private OriginationCode originationCode;
96 private ProjectCode project;
97 private OriginationCode referenceOriginationCode;
98 private DocumentTypeEBO referenceFinancialSystemDocumentTypeCode;
99
100 @Deprecated
101 private transient AccountingPeriod accountingPeriod;
102
103
104
105
106 public GeneralLedgerPendingEntry() {
107 this.objectType = new ObjectType();
108 this.balanceType = new BalanceType();
109 this.dummyBusinessObject = new TransientBalanceInquiryAttributes();
110 this.financialObject = new ObjectCode();
111 }
112
113
114
115
116
117
118 public GeneralLedgerPendingEntry(GeneralLedgerPendingEntry original) {
119 financialSystemOriginationCode = original.getFinancialSystemOriginationCode();
120 documentNumber = original.getDocumentNumber();
121 transactionLedgerEntrySequenceNumber = original.getTransactionLedgerEntrySequenceNumber();
122 chartOfAccountsCode = original.getChartOfAccountsCode();
123 accountNumber = original.getAccountNumber();
124 subAccountNumber = original.getSubAccountNumber();
125 financialObjectCode = original.getFinancialObjectCode();
126 financialSubObjectCode = original.getFinancialSubObjectCode();
127 financialBalanceTypeCode = original.getFinancialBalanceTypeCode();
128 financialObjectTypeCode = original.getFinancialObjectTypeCode();
129 universityFiscalYear = original.getUniversityFiscalYear();
130 universityFiscalPeriodCode = original.getUniversityFiscalPeriodCode();
131 transactionLedgerEntryDescription = original.getTransactionLedgerEntryDescription();
132 transactionLedgerEntryAmount = original.getTransactionLedgerEntryAmount();
133 transactionDebitCreditCode = original.getTransactionDebitCreditCode();
134 transactionDate = original.getTransactionDate();
135 financialDocumentTypeCode = original.getFinancialDocumentTypeCode();
136 organizationDocumentNumber = original.getOrganizationDocumentNumber();
137 projectCode = original.getProjectCode();
138 organizationReferenceId = original.getOrganizationReferenceId();
139 referenceFinancialDocumentTypeCode = original.getReferenceFinancialDocumentTypeCode();
140 referenceFinancialSystemOriginationCode = original.getReferenceFinancialSystemOriginationCode();
141 referenceFinancialDocumentNumber = original.getReferenceFinancialDocumentNumber();
142 financialDocumentReversalDate = original.getFinancialDocumentReversalDate();
143 transactionEncumbranceUpdateCode = original.getTransactionEncumbranceUpdateCode();
144 financialDocumentApprovedCode = original.getFinancialDocumentApprovedCode();
145 acctSufficientFundsFinObjCd = original.getAcctSufficientFundsFinObjCd();
146 transactionEntryOffsetIndicator = original.isTransactionEntryOffsetIndicator();
147 transactionEntryProcessedTs = original.getTransactionEntryProcessedTs();
148
149 financialSystemDocumentTypeCode = original.getFinancialSystemDocumentTypeCode();
150 documentHeader = original.getDocumentHeader();
151
152 option = original.getOption();
153 chart = original.getChart();
154 account = original.getAccount();
155 subAccount = original.getSubAccount();
156 financialObject = original.getFinancialObject();
157 financialSubObject = original.getFinancialSubObject();
158 balanceType = original.getBalanceType();
159 a21SubAccount = original.getA21SubAccount();
160 dummyBusinessObject = original.getDummyBusinessObject();
161 originationCode = original.getOriginationCode();
162 project = original.getProject();
163 referenceOriginationCode = original.getReferenceOriginationCode();
164 referenceFinancialSystemDocumentTypeCode = original.getReferenceFinancialSystemDocumentTypeCode();
165 }
166
167 public DocumentTypeEBO getReferenceFinancialSystemDocumentTypeCode() {
168 if ( StringUtils.isBlank( referenceFinancialDocumentTypeCode ) ) {
169 referenceFinancialSystemDocumentTypeCode = null;
170 } else {
171 if ( referenceFinancialSystemDocumentTypeCode == null || !StringUtils.equals(referenceFinancialDocumentTypeCode, referenceFinancialSystemDocumentTypeCode.getName() ) ) {
172 org.kuali.rice.kew.api.doctype.DocumentType temp = SpringContext.getBean(DocumentTypeService.class).getDocumentTypeByName(referenceFinancialDocumentTypeCode);
173 if ( temp != null ) {
174 referenceFinancialSystemDocumentTypeCode = DocumentType.from( temp );
175 } else {
176 referenceFinancialSystemDocumentTypeCode = null;
177 }
178 }
179 }
180 return referenceFinancialSystemDocumentTypeCode;
181 }
182
183 public OriginationCode getReferenceOriginationCode() {
184 return referenceOriginationCode;
185 }
186
187 public void setReferenceOriginationCode(OriginationCode referenceOriginationCode) {
188 this.referenceOriginationCode = referenceOriginationCode;
189 }
190
191 public ProjectCode getProject() {
192 return project;
193 }
194
195 public void setProject(ProjectCode project) {
196 this.project = project;
197 }
198
199 public OriginationCode getOriginationCode() {
200 return originationCode;
201 }
202
203 public void setOriginationCode(OriginationCode originationCode) {
204 this.originationCode = originationCode;
205 }
206
207 @Override
208 public void setOption(SystemOptions option) {
209 this.option = option;
210 }
211
212 @Override
213 public SystemOptions getOption() {
214 return option;
215 }
216
217
218
219
220
221
222 @Override
223 public String getDocumentNumber() {
224 return documentNumber;
225 }
226
227
228
229
230
231
232 public void setDocumentNumber(String documentNumber) {
233 this.documentNumber = documentNumber;
234 }
235
236
237
238
239
240
241 @Override
242 public Integer getTransactionLedgerEntrySequenceNumber() {
243 return transactionLedgerEntrySequenceNumber;
244 }
245
246
247
248
249
250
251 public void setTransactionLedgerEntrySequenceNumber(Integer transactionLedgerEntrySequenceNumber) {
252 this.transactionLedgerEntrySequenceNumber = transactionLedgerEntrySequenceNumber;
253 }
254
255
256
257
258
259
260 @Override
261 public String getChartOfAccountsCode() {
262 return chartOfAccountsCode;
263 }
264
265
266
267
268
269
270 public void setChartOfAccountsCode(String chartOfAccountsCode) {
271 this.chartOfAccountsCode = chartOfAccountsCode;
272 }
273
274
275
276
277
278
279 @Override
280 public String getAccountNumber() {
281 return accountNumber;
282 }
283
284
285
286
287
288
289 public void setAccountNumber(String accountNumber) {
290 this.accountNumber = accountNumber;
291 }
292
293
294
295
296
297
298 @Override
299 public String getSubAccountNumber() {
300 return subAccountNumber;
301 }
302
303
304
305
306
307
308 public void setSubAccountNumber(String subAccountNumber) {
309 this.subAccountNumber = subAccountNumber;
310 }
311
312
313
314
315
316
317 @Override
318 public String getFinancialObjectCode() {
319 return financialObjectCode;
320 }
321
322
323
324
325
326
327 public void setFinancialObjectCode(String financialObjectCode) {
328 this.financialObjectCode = financialObjectCode;
329 }
330
331
332
333
334
335
336 @Override
337 public String getFinancialSubObjectCode() {
338 return financialSubObjectCode;
339 }
340
341
342
343
344
345
346 public void setFinancialSubObjectCode(String financialSubObjectCode) {
347 this.financialSubObjectCode = financialSubObjectCode;
348 }
349
350
351
352
353
354
355 @Override
356 public String getFinancialBalanceTypeCode() {
357 return financialBalanceTypeCode;
358 }
359
360
361
362
363
364
365 public void setFinancialBalanceTypeCode(String financialBalanceTypeCode) {
366 this.financialBalanceTypeCode = financialBalanceTypeCode;
367 }
368
369
370
371
372
373
374 @Override
375 public String getFinancialObjectTypeCode() {
376 return financialObjectTypeCode;
377 }
378
379
380
381
382
383
384
385 public void setFinancialObjectTypeCode(String financialObjectTypeCode) {
386 this.financialObjectTypeCode = financialObjectTypeCode;
387 }
388
389
390
391
392
393
394 @Override
395 public Integer getUniversityFiscalYear() {
396 return universityFiscalYear;
397 }
398
399
400
401
402
403
404
405 public void setUniversityFiscalYear(Integer universityFiscalYear) {
406 this.universityFiscalYear = universityFiscalYear;
407 }
408
409
410
411
412
413
414 @Override
415 public String getUniversityFiscalPeriodCode() {
416 return universityFiscalPeriodCode;
417 }
418
419
420
421
422
423
424 public void setUniversityFiscalPeriodCode(String universityFiscalPeriodCode) {
425 this.universityFiscalPeriodCode = universityFiscalPeriodCode;
426 }
427
428
429
430
431
432
433 @Override
434 public String getTransactionLedgerEntryDescription() {
435 return transactionLedgerEntryDescription;
436 }
437
438
439
440
441
442
443 public void setTransactionLedgerEntryDescription(String transactionLedgerEntryDescription) {
444 this.transactionLedgerEntryDescription = transactionLedgerEntryDescription;
445 }
446
447
448
449
450
451
452 @Override
453 public KualiDecimal getTransactionLedgerEntryAmount() {
454 return transactionLedgerEntryAmount;
455 }
456
457
458
459
460
461
462 public void setTransactionLedgerEntryAmount(KualiDecimal transactionLedgerEntryAmount) {
463 this.transactionLedgerEntryAmount = transactionLedgerEntryAmount;
464 }
465
466
467
468
469
470
471 @Override
472 public String getTransactionDebitCreditCode() {
473 return transactionDebitCreditCode;
474 }
475
476
477
478
479
480
481 public void setTransactionDebitCreditCode(String transactionDebitCreditCode) {
482 this.transactionDebitCreditCode = transactionDebitCreditCode;
483 }
484
485
486
487
488
489
490 @Override
491 public Date getTransactionDate() {
492 return transactionDate;
493 }
494
495
496
497
498
499
500 public void setTransactionDate(Date transactionDate) {
501 this.transactionDate = transactionDate;
502 }
503
504
505
506
507
508
509 @Override
510 public String getFinancialDocumentTypeCode() {
511 return financialDocumentTypeCode;
512 }
513
514
515
516
517
518
519 public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
520 this.financialDocumentTypeCode = financialDocumentTypeCode;
521 }
522
523
524
525
526
527
528 @Override
529 public String getOrganizationDocumentNumber() {
530 return organizationDocumentNumber;
531 }
532
533
534
535
536
537
538 public void setOrganizationDocumentNumber(String organizationDocumentNumber) {
539 this.organizationDocumentNumber = organizationDocumentNumber;
540 }
541
542
543
544
545
546
547 @Override
548 public String getProjectCode() {
549 return projectCode;
550 }
551
552
553
554
555
556
557 public void setProjectCode(String projectCode) {
558 this.projectCode = projectCode;
559 }
560
561
562
563
564
565
566 @Override
567 public String getOrganizationReferenceId() {
568 return organizationReferenceId;
569 }
570
571
572
573
574
575
576 public void setOrganizationReferenceId(String organizationReferenceId) {
577 this.organizationReferenceId = organizationReferenceId;
578 }
579
580
581
582
583
584
585 @Override
586 public String getReferenceFinancialDocumentTypeCode() {
587 return referenceFinancialDocumentTypeCode;
588 }
589
590
591
592
593
594
595 public void setReferenceFinancialDocumentTypeCode(String referenceFinancialDocumentTypeCode) {
596 this.referenceFinancialDocumentTypeCode = referenceFinancialDocumentTypeCode;
597 }
598
599
600
601
602
603
604 @Override
605 public String getReferenceFinancialSystemOriginationCode() {
606 return referenceFinancialSystemOriginationCode;
607 }
608
609
610
611
612
613
614 public void setReferenceFinancialSystemOriginationCode(String referenceFinancialSystemOriginationCode) {
615 this.referenceFinancialSystemOriginationCode = referenceFinancialSystemOriginationCode;
616 }
617
618
619
620
621
622
623 @Override
624 public String getReferenceFinancialDocumentNumber() {
625 return referenceFinancialDocumentNumber;
626 }
627
628
629
630
631
632
633 public void setReferenceFinancialDocumentNumber(String referenceFinancialDocumentNumber) {
634 this.referenceFinancialDocumentNumber = referenceFinancialDocumentNumber;
635 }
636
637
638
639
640
641
642 @Override
643 public Date getFinancialDocumentReversalDate() {
644 return financialDocumentReversalDate;
645 }
646
647
648
649
650
651
652 public void setFinancialDocumentReversalDate(Date financialDocumentReversalDate) {
653 this.financialDocumentReversalDate = financialDocumentReversalDate;
654 }
655
656
657
658
659
660
661 @Override
662 public String getTransactionEncumbranceUpdateCode() {
663 return transactionEncumbranceUpdateCode;
664 }
665
666
667
668
669
670
671 public void setTransactionEncumbranceUpdateCode(String transactionEncumbranceUpdateCode) {
672 this.transactionEncumbranceUpdateCode = transactionEncumbranceUpdateCode;
673 }
674
675
676
677
678
679
680 public String getFinancialDocumentApprovedCode() {
681 return financialDocumentApprovedCode;
682 }
683
684
685
686
687
688
689
690 public void setFinancialDocumentApprovedCode(String financialDocumentApprovedCode) {
691 this.financialDocumentApprovedCode = financialDocumentApprovedCode;
692 }
693
694
695
696
697
698
699 public String getAcctSufficientFundsFinObjCd() {
700 return acctSufficientFundsFinObjCd;
701 }
702
703
704
705
706
707
708 public void setAcctSufficientFundsFinObjCd(String acctSufficientFundsFinObjCd) {
709 this.acctSufficientFundsFinObjCd = acctSufficientFundsFinObjCd;
710 }
711
712
713
714
715
716
717 public boolean isTransactionEntryOffsetIndicator() {
718 return transactionEntryOffsetIndicator;
719 }
720
721
722
723
724
725
726 public void setTransactionEntryOffsetIndicator(boolean transactionEntryOffsetIndicator) {
727 this.transactionEntryOffsetIndicator = transactionEntryOffsetIndicator;
728 }
729
730
731
732
733
734
735 public Timestamp getTransactionEntryProcessedTs() {
736 return transactionEntryProcessedTs;
737 }
738
739
740
741
742
743
744 public void setTransactionEntryProcessedTs(Timestamp transactionEntryProcessedTs) {
745 this.transactionEntryProcessedTs = transactionEntryProcessedTs;
746 }
747
748
749
750
751 @Override
752 public String getFinancialSystemOriginationCode() {
753 return financialSystemOriginationCode;
754 }
755
756
757
758
759 public void setFinancialSystemOriginationCode(String financialSystemOriginationCode) {
760 this.financialSystemOriginationCode = financialSystemOriginationCode;
761 }
762
763
764
765
766 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
767 LinkedHashMap m = new LinkedHashMap();
768 m.put("financialSystemOriginationCode", this.financialSystemOriginationCode);
769 m.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
770 if (transactionLedgerEntrySequenceNumber == null) {
771 m.put("transactionLedgerEntrySequenceNumber", null);
772 }
773 else {
774 m.put("transactionLedgerEntrySequenceNumber", this.transactionLedgerEntrySequenceNumber.toString());
775 }
776 return m;
777 }
778
779
780
781
782
783 @Override
784 public DocumentTypeEBO getFinancialSystemDocumentTypeCode() {
785 if ( StringUtils.isBlank( financialDocumentTypeCode ) ) {
786 financialSystemDocumentTypeCode = null;
787 } else {
788 if ( financialSystemDocumentTypeCode == null || !StringUtils.equals(financialDocumentTypeCode, financialSystemDocumentTypeCode.getName() ) ) {
789 org.kuali.rice.kew.api.doctype.DocumentType temp = SpringContext.getBean(DocumentTypeService.class).getDocumentTypeByName(financialDocumentTypeCode);
790 if ( temp != null ) {
791 financialSystemDocumentTypeCode = DocumentType.from( temp );
792 } else {
793 financialSystemDocumentTypeCode = null;
794 }
795 }
796 }
797 return financialSystemDocumentTypeCode;
798 }
799
800
801
802
803
804
805 public FinancialSystemDocumentHeader getDocumentHeader() {
806 return documentHeader;
807 }
808
809
810
811
812
813
814 public void setDocumentHeader(FinancialSystemDocumentHeader documentHeader) {
815 this.documentHeader = documentHeader;
816 }
817
818
819
820
821
822
823 @Override
824 public Account getAccount() {
825 return account;
826 }
827
828
829
830
831
832
833 @Override
834 public void setAccount(Account account) {
835 this.account = account;
836 }
837
838
839
840
841
842
843 @Override
844 public BalanceType getBalanceType() {
845 return balanceType;
846 }
847
848
849
850
851
852
853 @Override
854 public void setBalanceType(BalanceType balanceType) {
855 this.balanceType = balanceType;
856 }
857
858
859
860
861
862
863 @Override
864 public Chart getChart() {
865 return chart;
866 }
867
868
869
870
871
872
873 @Override
874 public void setChart(Chart chart) {
875 this.chart = chart;
876 }
877
878
879
880
881
882
883 @Override
884 public ObjectCode getFinancialObject() {
885 return financialObject;
886 }
887
888
889
890
891
892
893 @Override
894 public void setFinancialObject(ObjectCode financialObject) {
895 this.financialObject = financialObject;
896 }
897
898
899
900
901
902
903 @Override
904 public ObjectType getObjectType() {
905 return objectType;
906 }
907
908
909
910
911
912
913 @Override
914 public void setObjectType(ObjectType objectType) {
915 this.objectType = objectType;
916 }
917
918
919
920
921
922
923 public A21SubAccount getA21SubAccount() {
924 return this.a21SubAccount;
925 }
926
927
928
929
930
931
932 public void setA21SubAccount(A21SubAccount a21SubAccount) {
933 this.a21SubAccount = a21SubAccount;
934 }
935
936
937
938
939
940
941 public TransientBalanceInquiryAttributes getDummyBusinessObject() {
942 return this.dummyBusinessObject;
943 }
944
945
946
947
948
949
950 public void setDummyBusinessObject(TransientBalanceInquiryAttributes dummyBusinessObject) {
951 this.dummyBusinessObject = dummyBusinessObject;
952 }
953
954 @Override
955 public SubAccount getSubAccount() {
956 return subAccount;
957 }
958
959 public void setSubAccount(SubAccount subAccount) {
960 this.subAccount = subAccount;
961 }
962
963 @Override
964 public SubObjectCode getFinancialSubObject() {
965 return financialSubObject;
966 }
967
968 public void setFinancialSubObject(SubObjectCode financialSubObject) {
969 this.financialSubObject = financialSubObject;
970 }
971
972 public boolean isSubAccountNumberBlank() {
973 return subAccountNumber == null || GENERAL_LEDGER_PENDING_ENTRY_CODE.getBlankSubAccountNumber().equals(subAccountNumber);
974 }
975
976 public boolean isFinancialObjectCodeBlank() {
977 return financialObjectCode == null || GENERAL_LEDGER_PENDING_ENTRY_CODE.getBlankFinancialObjectCode().equals(financialObjectCode);
978 }
979
980 public boolean isFinancialSubObjectCodeBlank() {
981 return financialSubObjectCode == null || GENERAL_LEDGER_PENDING_ENTRY_CODE.getBlankFinancialSubObjectCode().equals(financialSubObjectCode);
982 }
983
984 public boolean isProjectCodeBlank() {
985 return projectCode == null || GENERAL_LEDGER_PENDING_ENTRY_CODE.getBlankProjectCode().equals(projectCode);
986 }
987
988 public boolean isFinancialObjectTypeCodeBlank() {
989 return financialObjectTypeCode == null || GENERAL_LEDGER_PENDING_ENTRY_CODE.getBlankFinancialObjectType().equals(financialObjectTypeCode);
990 }
991
992 @Deprecated
993 public AccountingPeriod getAccountingPeriod() {
994 return accountingPeriod;
995 }
996
997 @Deprecated
998 public void setAccountingPeriod(AccountingPeriod accountingPeriod) {
999 this.accountingPeriod = accountingPeriod;
1000 }
1001
1002
1003
1004
1005 public String getCurrencyFormattedTransactionLedgerEntryAmount() {
1006 return (String) new CurrencyFormatter().format(getTransactionLedgerEntryAmount());
1007 }
1008 }