1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.coa.businessobject;
18
19 import java.sql.Date;
20 import java.util.ArrayList;
21 import java.util.Calendar;
22 import java.util.HashMap;
23 import java.util.List;
24 import java.util.Map;
25
26 import org.apache.commons.lang.StringUtils;
27 import org.apache.commons.lang.time.DateUtils;
28 import org.kuali.ole.coa.service.SubFundGroupService;
29 import org.kuali.ole.sys.OLEConstants;
30 import org.kuali.ole.sys.context.SpringContext;
31 import org.kuali.rice.core.api.datetime.DateTimeService;
32 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
33 import org.kuali.rice.kim.api.identity.Person;
34 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
35 import org.kuali.rice.krad.service.KualiModuleService;
36 import org.kuali.rice.krad.service.ModuleService;
37 import org.kuali.rice.location.api.LocationConstants;
38 import org.kuali.rice.location.framework.campus.CampusEbo;
39 import org.kuali.rice.location.framework.postalcode.PostalCodeEbo;
40 import org.kuali.rice.location.framework.state.StateEbo;
41
42
43
44
45 public class PriorYearAccount extends PersistableBusinessObjectBase implements AccountIntf, MutableInactivatable {
46 protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(PriorYearAccount.class);
47
48 protected String chartOfAccountsCode;
49 protected String accountNumber;
50 protected String accountName;
51 protected boolean accountsFringesBnftIndicator;
52 protected Date accountRestrictedStatusDate;
53 protected String accountCityName;
54 protected String accountStateCode;
55 protected String accountStreetAddress;
56 protected String accountZipCode;
57 protected Date accountCreateDate;
58 protected Date accountEffectiveDate;
59 protected Date accountExpirationDate;
60 protected String acctIndirectCostRcvyTypeCd;
61 protected String acctCustomIndCstRcvyExclCd;
62 protected String financialIcrSeriesIdentifier;
63 protected boolean accountInFinancialProcessingIndicator;
64 protected String budgetRecordingLevelCode;
65 protected String accountSufficientFundsCode;
66 protected boolean pendingAcctSufficientFundsIndicator;
67 protected boolean extrnlFinEncumSufficntFndIndicator;
68 protected boolean intrnlFinEncumSufficntFndIndicator;
69 protected boolean finPreencumSufficientFundIndicator;
70 protected boolean financialObjectivePrsctrlIndicator;
71 protected String accountCfdaNumber;
72 protected boolean accountOffCampusIndicator;
73 protected boolean active;
74
75 protected String accountFiscalOfficerSystemIdentifier;
76 protected String accountsSupervisorySystemsIdentifier;
77 protected String accountManagerSystemIdentifier;
78 protected String organizationCode;
79 protected String accountTypeCode;
80 protected String accountPhysicalCampusCode;
81 protected String subFundGroupCode;
82 protected String financialHigherEdFunctionCd;
83 protected String accountRestrictedStatusCode;
84 protected String reportsToChartOfAccountsCode;
85 protected String reportsToAccountNumber;
86 protected String continuationFinChrtOfAcctCd;
87 protected String continuationAccountNumber;
88 protected String endowmentIncomeAcctFinCoaCd;
89 protected String endowmentIncomeAccountNumber;
90 protected String contractControlFinCoaCode;
91 protected String contractControlAccountNumber;
92 protected String incomeStreamFinancialCoaCode;
93 protected String incomeStreamAccountNumber;
94
95 protected Chart chartOfAccounts;
96 protected Organization organization;
97 protected AccountType accountType;
98 protected CampusEbo accountPhysicalCampus;
99 protected StateEbo accountState;
100 protected SubFundGroup subFundGroup;
101 protected HigherEducationFunction financialHigherEdFunction;
102 protected RestrictedStatus accountRestrictedStatus;
103 protected Account reportsToAccount;
104 protected Account continuationAccount;
105 protected Account endowmentIncomeAccount;
106 protected Account contractControlAccount;
107 protected Account incomeStreamAccount;
108 protected Person accountFiscalOfficerUser;
109 protected Person accountSupervisoryUser;
110 protected Person accountManagerUser;
111 protected PostalCodeEbo postalZipCode;
112 protected BudgetRecordingLevel budgetRecordingLevel;
113 protected SufficientFundsCode sufficientFundsCode;
114
115
116 protected String accountResponsibilitySectionBlank;
117 protected String accountResponsibilitySection;
118 protected String contractsAndGrantsSectionBlank;
119 protected String contractsAndGrantsSection;
120 protected String guidelinesAndPurposeSectionBlank;
121 protected String guidelinesAndPurposeSection;
122 protected String accountDescriptionSectionBlank;
123 protected String accountDescriptionSection;
124
125 protected AccountGuideline accountGuideline;
126 protected AccountDescription accountDescription;
127
128 protected List subAccounts;
129 protected Boolean forContractsAndGrants;
130
131 protected List<PriorYearIndirectCostRecoveryAccount> indirectCostRecoveryAccounts;
132
133
134
135
136 public PriorYearAccount() {
137 indirectCostRecoveryAccounts = new ArrayList<PriorYearIndirectCostRecoveryAccount>();
138 }
139
140
141
142
143 public PriorYearAccount(Account account) {
144 chartOfAccountsCode = account.getChartOfAccountsCode();
145 accountNumber = account.getAccountNumber();
146 accountName = account.getAccountName();
147 accountsFringesBnftIndicator = account.isAccountsFringesBnftIndicator();
148 accountRestrictedStatusDate = account.getAccountRestrictedStatusDate();
149 accountCityName = account.getAccountCityName();
150 accountStateCode = account.getAccountStateCode();
151 accountStreetAddress = account.getAccountStreetAddress();
152 accountZipCode = account.getAccountZipCode();
153 accountCreateDate = account.getAccountCreateDate();
154 accountEffectiveDate = account.getAccountEffectiveDate();
155 accountExpirationDate = account.getAccountExpirationDate();
156 acctIndirectCostRcvyTypeCd = account.getAcctIndirectCostRcvyTypeCd();
157 acctCustomIndCstRcvyExclCd = account.getAcctCustomIndCstRcvyExclCd();
158 financialIcrSeriesIdentifier = account.getFinancialIcrSeriesIdentifier();
159 accountInFinancialProcessingIndicator = account.getAccountInFinancialProcessingIndicator();
160 budgetRecordingLevelCode = account.getBudgetRecordingLevelCode();
161 accountSufficientFundsCode = account.getAccountSufficientFundsCode();
162 pendingAcctSufficientFundsIndicator = account.isPendingAcctSufficientFundsIndicator();
163 extrnlFinEncumSufficntFndIndicator = account.isExtrnlFinEncumSufficntFndIndicator();
164 intrnlFinEncumSufficntFndIndicator = account.isIntrnlFinEncumSufficntFndIndicator();
165 finPreencumSufficientFundIndicator = account.isFinPreencumSufficientFundIndicator();
166 financialObjectivePrsctrlIndicator = account.isFinancialObjectivePrsctrlIndicator();
167 accountCfdaNumber = account.getAccountCfdaNumber();
168 accountOffCampusIndicator = account.isAccountOffCampusIndicator();
169 active = account.isActive();
170
171 accountFiscalOfficerSystemIdentifier = account.getAccountFiscalOfficerSystemIdentifier();
172 accountsSupervisorySystemsIdentifier = account.getAccountsSupervisorySystemsIdentifier();
173 accountManagerSystemIdentifier = account.getAccountManagerSystemIdentifier();
174 organizationCode = account.getOrganizationCode();
175 accountTypeCode = account.getAccountTypeCode();
176 accountPhysicalCampusCode = account.getAccountPhysicalCampusCode();
177 subFundGroupCode = account.getSubFundGroupCode();
178 financialHigherEdFunctionCd = account.getFinancialHigherEdFunctionCd();
179 accountRestrictedStatusCode = account.getAccountRestrictedStatusCode();
180 reportsToChartOfAccountsCode = account.getReportsToChartOfAccountsCode();
181 reportsToAccountNumber = account.getReportsToAccountNumber();
182 continuationFinChrtOfAcctCd = account.getContinuationFinChrtOfAcctCd();
183 continuationAccountNumber = account.getContinuationAccountNumber();
184 endowmentIncomeAcctFinCoaCd = account.getEndowmentIncomeAcctFinCoaCd();
185 endowmentIncomeAccountNumber = account.getEndowmentIncomeAccountNumber();
186 contractControlFinCoaCode = account.getContractControlFinCoaCode();
187 contractControlAccountNumber = account.getContractControlAccountNumber();
188 incomeStreamFinancialCoaCode = account.getIncomeStreamFinancialCoaCode();
189 incomeStreamAccountNumber = account.getIncomeStreamAccountNumber();
190
191 refresh();
192 }
193
194
195
196
197
198
199 @Override
200 public String getAccountNumber() {
201 return accountNumber;
202 }
203
204
205
206
207
208
209 @Override
210 public void setAccountNumber(String accountNumber) {
211 this.accountNumber = accountNumber;
212 }
213
214
215
216
217
218
219 @Override
220 public String getAccountName() {
221 return accountName;
222 }
223
224
225
226
227
228
229 @Override
230 public void setAccountName(String accountName) {
231 this.accountName = accountName;
232 }
233
234
235
236
237
238
239 @Override
240 public boolean isAccountsFringesBnftIndicator() {
241 return accountsFringesBnftIndicator;
242 }
243
244
245
246
247
248
249 @Override
250 public void setAccountsFringesBnftIndicator(boolean _AccountsFringesBnftIndicator_) {
251 this.accountsFringesBnftIndicator = _AccountsFringesBnftIndicator_;
252 }
253
254
255
256
257
258
259 @Override
260 public Date getAccountRestrictedStatusDate() {
261 return accountRestrictedStatusDate;
262 }
263
264
265
266
267
268
269 @Override
270 public void setAccountRestrictedStatusDate(Date accountRestrictedStatusDate) {
271 this.accountRestrictedStatusDate = accountRestrictedStatusDate;
272 }
273
274
275
276
277
278
279 @Override
280 public String getAccountCityName() {
281 return accountCityName;
282 }
283
284
285
286
287
288
289 @Override
290 public void setAccountCityName(String accountCityName) {
291 this.accountCityName = accountCityName;
292 }
293
294
295
296
297
298
299 @Override
300 public String getAccountStateCode() {
301 return accountStateCode;
302 }
303
304
305
306
307
308
309 @Override
310 public void setAccountStateCode(String accountStateCode) {
311 this.accountStateCode = accountStateCode;
312 }
313
314
315
316
317
318
319 @Override
320 public String getAccountStreetAddress() {
321 return accountStreetAddress;
322 }
323
324
325
326
327
328
329 @Override
330 public void setAccountStreetAddress(String accountStreetAddress) {
331 this.accountStreetAddress = accountStreetAddress;
332 }
333
334
335
336
337
338
339 @Override
340 public String getAccountZipCode() {
341 return accountZipCode;
342 }
343
344
345
346
347
348
349 @Override
350 public void setAccountZipCode(String accountZipCode) {
351 this.accountZipCode = accountZipCode;
352 }
353
354
355
356
357
358
359 @Override
360 public Date getAccountCreateDate() {
361 return accountCreateDate;
362 }
363
364
365
366
367
368
369 @Override
370 public void setAccountCreateDate(Date accountCreateDate) {
371 this.accountCreateDate = accountCreateDate;
372 }
373
374
375
376
377
378
379 @Override
380 public Date getAccountEffectiveDate() {
381 return accountEffectiveDate;
382 }
383
384
385
386
387
388
389 @Override
390 public void setAccountEffectiveDate(Date accountEffectiveDate) {
391 this.accountEffectiveDate = accountEffectiveDate;
392 }
393
394
395
396
397
398
399 @Override
400 public Date getAccountExpirationDate() {
401 return accountExpirationDate;
402 }
403
404
405
406
407
408
409 @Override
410 public void setAccountExpirationDate(Date accountExpirationDate) {
411 this.accountExpirationDate = accountExpirationDate;
412 }
413
414
415
416
417
418
419
420
421
422 @Override
423 public boolean isExpired() {
424 LOG.debug("entering isExpired()");
425
426 if (this.accountExpirationDate == null) {
427 return false;
428 }
429
430 return this.isExpired(SpringContext.getBean(DateTimeService.class).getCurrentCalendar());
431 }
432
433
434
435
436
437
438
439
440
441
442
443 @Override
444 public boolean isExpired(Calendar testDate) {
445 if (LOG.isDebugEnabled()) {
446 LOG.debug("entering isExpired(" + testDate + ")");
447 }
448
449
450 if (this.accountExpirationDate == null) {
451 return false;
452 }
453
454
455 testDate = DateUtils.truncate(testDate, Calendar.DAY_OF_MONTH);
456
457
458
459 Calendar acctDate = Calendar.getInstance();
460 acctDate.setTime(this.accountExpirationDate);
461 acctDate = DateUtils.truncate(acctDate, Calendar.DAY_OF_MONTH);
462
463
464 if (acctDate.before(testDate)) {
465 return true;
466 }
467 else {
468 return false;
469 }
470 }
471
472
473
474
475
476
477
478
479
480
481
482 @Override
483 public boolean isExpired(Date testDate) {
484
485
486 if (this.accountExpirationDate == null) {
487 return false;
488 }
489
490 Calendar acctDate = Calendar.getInstance();
491 acctDate.setTime(testDate);
492 return isExpired(acctDate);
493 }
494
495
496
497
498
499
500 @Override
501 public String getAcctIndirectCostRcvyTypeCd() {
502 return acctIndirectCostRcvyTypeCd;
503 }
504
505
506
507
508
509
510 @Override
511 public void setAcctIndirectCostRcvyTypeCd(String acctIndirectCostRcvyTypeCd) {
512 this.acctIndirectCostRcvyTypeCd = acctIndirectCostRcvyTypeCd;
513 }
514
515
516
517
518
519
520 @Override
521 public String getAcctCustomIndCstRcvyExclCd() {
522 return acctCustomIndCstRcvyExclCd;
523 }
524
525
526
527
528
529
530 @Override
531 public void setAcctCustomIndCstRcvyExclCd(String acctCustomIndCstRcvyExclCd) {
532 this.acctCustomIndCstRcvyExclCd = acctCustomIndCstRcvyExclCd;
533 }
534
535
536
537
538
539
540 @Override
541 public String getFinancialIcrSeriesIdentifier() {
542 return financialIcrSeriesIdentifier;
543 }
544
545
546
547
548
549
550 @Override
551 public void setFinancialIcrSeriesIdentifier(String financialIcrSeriesIdentifier) {
552 this.financialIcrSeriesIdentifier = financialIcrSeriesIdentifier;
553 }
554
555
556
557
558
559
560 @Override
561 public boolean getAccountInFinancialProcessingIndicator() {
562 return accountInFinancialProcessingIndicator;
563 }
564
565
566
567
568
569
570 @Override
571 public void setAccountInFinancialProcessingIndicator(boolean accountInFinancialProcessingIndicator) {
572 this.accountInFinancialProcessingIndicator = accountInFinancialProcessingIndicator;
573 }
574
575
576
577
578
579
580 @Override
581 public String getBudgetRecordingLevelCode() {
582 return budgetRecordingLevelCode;
583 }
584
585
586
587
588
589
590 @Override
591 public void setBudgetRecordingLevelCode(String budgetRecordingLevelCode) {
592 this.budgetRecordingLevelCode = budgetRecordingLevelCode;
593 }
594
595
596
597
598
599
600 @Override
601 public String getAccountSufficientFundsCode() {
602 return accountSufficientFundsCode;
603 }
604
605
606
607
608
609
610 @Override
611 public void setAccountSufficientFundsCode(String accountSufficientFundsCode) {
612 this.accountSufficientFundsCode = accountSufficientFundsCode;
613 }
614
615
616
617
618
619
620 @Override
621 public boolean isPendingAcctSufficientFundsIndicator() {
622 return pendingAcctSufficientFundsIndicator;
623 }
624
625
626
627
628
629
630 @Override
631 public void setPendingAcctSufficientFundsIndicator(boolean pendingAcctSufficientFundsIndicator) {
632 this.pendingAcctSufficientFundsIndicator = pendingAcctSufficientFundsIndicator;
633 }
634
635
636
637
638
639
640 @Override
641 public boolean isExtrnlFinEncumSufficntFndIndicator() {
642 return extrnlFinEncumSufficntFndIndicator;
643 }
644
645
646
647
648
649
650 @Override
651 public void setExtrnlFinEncumSufficntFndIndicator(boolean extrnlFinEncumSufficntFndIndicator) {
652 this.extrnlFinEncumSufficntFndIndicator = extrnlFinEncumSufficntFndIndicator;
653 }
654
655
656
657
658
659
660 @Override
661 public boolean isIntrnlFinEncumSufficntFndIndicator() {
662 return intrnlFinEncumSufficntFndIndicator;
663 }
664
665
666
667
668
669
670 @Override
671 public void setIntrnlFinEncumSufficntFndIndicator(boolean intrnlFinEncumSufficntFndIndicator) {
672 this.intrnlFinEncumSufficntFndIndicator = intrnlFinEncumSufficntFndIndicator;
673 }
674
675
676
677
678
679
680 @Override
681 public boolean isFinPreencumSufficientFundIndicator() {
682 return finPreencumSufficientFundIndicator;
683 }
684
685
686
687
688
689
690 @Override
691 public void setFinPreencumSufficientFundIndicator(boolean finPreencumSufficientFundIndicator) {
692 this.finPreencumSufficientFundIndicator = finPreencumSufficientFundIndicator;
693 }
694
695
696
697
698
699
700 @Override
701 public boolean isFinancialObjectivePrsctrlIndicator() {
702 return financialObjectivePrsctrlIndicator;
703 }
704
705
706
707
708
709
710 @Override
711 public void setFinancialObjectivePrsctrlIndicator(boolean _FinancialObjectivePrsctrlIndicator_) {
712 this.financialObjectivePrsctrlIndicator = _FinancialObjectivePrsctrlIndicator_;
713 }
714
715
716
717
718
719
720 @Override
721 public String getAccountCfdaNumber() {
722 return accountCfdaNumber;
723 }
724
725
726
727
728
729
730 @Override
731 public void setAccountCfdaNumber(String accountCfdaNumber) {
732 this.accountCfdaNumber = accountCfdaNumber;
733 }
734
735
736
737
738
739
740 @Override
741 public boolean isAccountOffCampusIndicator() {
742 return accountOffCampusIndicator;
743 }
744
745
746
747
748
749
750 @Override
751 public void setAccountOffCampusIndicator(boolean accountOffCampusIndicator) {
752 this.accountOffCampusIndicator = accountOffCampusIndicator;
753 }
754
755
756
757
758
759
760 @Override
761 public boolean isActive() {
762 return active;
763 }
764
765
766
767
768
769
770 @Override
771 public void setActive(boolean active) {
772 this.active = active;
773 }
774
775
776
777
778
779
780 @Override
781 public Chart getChartOfAccounts() {
782 return chartOfAccounts;
783 }
784
785
786
787
788
789
790
791 @Override
792 public void setChartOfAccounts(Chart chartOfAccounts) {
793 this.chartOfAccounts = chartOfAccounts;
794 }
795
796
797
798
799
800
801 @Override
802 public Organization getOrganization() {
803 return organization;
804 }
805
806
807
808
809
810
811
812 @Override
813 public void setOrganization(Organization organization) {
814 this.organization = organization;
815 }
816
817
818
819
820
821
822 @Override
823 public AccountType getAccountType() {
824 return accountType;
825 }
826
827
828
829
830
831
832
833 @Override
834 public void setAccountType(AccountType accountType) {
835 this.accountType = accountType;
836 }
837
838
839
840
841
842
843 @Override
844 public CampusEbo getAccountPhysicalCampus() {
845 if ( StringUtils.isBlank(accountPhysicalCampusCode) ) {
846 accountPhysicalCampus = null;
847 } else {
848 if ( accountPhysicalCampus == null || !StringUtils.equals( accountPhysicalCampus.getCode(),accountPhysicalCampusCode) ) {
849 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CampusEbo.class);
850 if ( moduleService != null ) {
851 Map<String,Object> keys = new HashMap<String, Object>(1);
852 keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountPhysicalCampusCode);
853 accountPhysicalCampus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);
854 } else {
855 throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
856 }
857 }
858 }
859 return accountPhysicalCampus;
860 }
861
862
863
864
865
866
867
868 @Override
869 public void setAccountPhysicalCampus(CampusEbo accountPhysicalCampus) {
870 this.accountPhysicalCampus = accountPhysicalCampus;
871 }
872
873
874
875
876
877
878 @Override
879 public StateEbo getAccountState() {
880 if ( StringUtils.isBlank(accountStateCode) || StringUtils.isBlank(OLEConstants.COUNTRY_CODE_UNITED_STATES ) ) {
881 accountState = null;
882 } else {
883 if ( accountState == null || !StringUtils.equals( accountState.getCode(),accountStateCode) || !StringUtils.equals(accountState.getCountryCode(), OLEConstants.COUNTRY_CODE_UNITED_STATES ) ) {
884 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(StateEbo.class);
885 if ( moduleService != null ) {
886 Map<String,Object> keys = new HashMap<String, Object>(2);
887 keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, OLEConstants.COUNTRY_CODE_UNITED_STATES);
888 keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountStateCode);
889 accountState = moduleService.getExternalizableBusinessObject(StateEbo.class, keys);
890 } else {
891 throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
892 }
893 }
894 }
895 return accountState;
896 }
897
898
899
900
901
902
903
904 @Override
905 public void setAccountState(StateEbo state) {
906 this.accountState = state;
907 }
908
909
910
911
912
913
914 @Override
915 public SubFundGroup getSubFundGroup() {
916 return subFundGroup;
917 }
918
919
920
921
922
923
924
925 @Override
926 public void setSubFundGroup(SubFundGroup subFundGroup) {
927 this.subFundGroup = subFundGroup;
928 }
929
930
931
932
933
934
935 @Override
936 public HigherEducationFunction getFinancialHigherEdFunction() {
937 return financialHigherEdFunction;
938 }
939
940
941
942
943
944
945
946 @Override
947 public void setFinancialHigherEdFunction(HigherEducationFunction financialHigherEdFunction) {
948 this.financialHigherEdFunction = financialHigherEdFunction;
949 }
950
951
952
953
954
955
956 @Override
957 public RestrictedStatus getAccountRestrictedStatus() {
958 return accountRestrictedStatus;
959 }
960
961
962
963
964
965
966
967 @Override
968 public void setAccountRestrictedStatus(RestrictedStatus accountRestrictedStatus) {
969 this.accountRestrictedStatus = accountRestrictedStatus;
970 }
971
972
973
974
975
976
977 @Override
978 public Account getReportsToAccount() {
979 return reportsToAccount;
980 }
981
982
983
984
985
986
987
988 @Override
989 public void setReportsToAccount(Account reportsToAccount) {
990 this.reportsToAccount = reportsToAccount;
991 }
992
993
994
995
996
997
998 @Override
999 public Account getEndowmentIncomeAccount() {
1000 return endowmentIncomeAccount;
1001 }
1002
1003
1004
1005
1006
1007
1008
1009 @Override
1010 public void setEndowmentIncomeAccount(Account endowmentIncomeAccount) {
1011 this.endowmentIncomeAccount = endowmentIncomeAccount;
1012 }
1013
1014
1015
1016
1017
1018
1019 @Override
1020 public Account getContractControlAccount() {
1021 return contractControlAccount;
1022 }
1023
1024
1025
1026
1027
1028
1029
1030 @Override
1031 public void setContractControlAccount(Account contractControlAccount) {
1032 this.contractControlAccount = contractControlAccount;
1033 }
1034
1035
1036
1037
1038
1039
1040
1041 @Override
1042 public Account getIncomeStreamAccount() {
1043 return incomeStreamAccount;
1044 }
1045
1046
1047
1048
1049
1050
1051
1052 @Override
1053 public void setIncomeStreamAccount(Account incomeStreamAccount) {
1054 this.incomeStreamAccount = incomeStreamAccount;
1055 }
1056
1057 @Override
1058 public Person getAccountFiscalOfficerUser() {
1059 accountFiscalOfficerUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountFiscalOfficerSystemIdentifier, accountFiscalOfficerUser);
1060 return accountFiscalOfficerUser;
1061 }
1062
1063
1064
1065
1066
1067
1068 @Override
1069 public void setAccountFiscalOfficerUser(Person accountFiscalOfficerUser) {
1070 this.accountFiscalOfficerUser = accountFiscalOfficerUser;
1071 }
1072
1073 @Override
1074 public Person getAccountManagerUser() {
1075 accountManagerUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountManagerSystemIdentifier, accountManagerUser);
1076 return accountManagerUser;
1077 }
1078
1079
1080
1081
1082
1083 @Override
1084 public void setAccountManagerUser(Person accountManagerUser) {
1085 this.accountManagerUser = accountManagerUser;
1086 }
1087
1088
1089 @Override
1090 public Person getAccountSupervisoryUser() {
1091 accountSupervisoryUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountsSupervisorySystemsIdentifier, accountSupervisoryUser);
1092 return accountSupervisoryUser;
1093 }
1094
1095
1096
1097
1098
1099
1100 @Override
1101 public void setAccountSupervisoryUser(Person accountSupervisoryUser) {
1102 this.accountSupervisoryUser = accountSupervisoryUser;
1103 }
1104
1105
1106
1107
1108
1109 @Override
1110 public Account getContinuationAccount() {
1111 return continuationAccount;
1112 }
1113
1114
1115
1116
1117
1118
1119 @Override
1120 public void setContinuationAccount(Account continuationAccount) {
1121 this.continuationAccount = continuationAccount;
1122 }
1123
1124
1125
1126
1127
1128 @Override
1129 public AccountGuideline getAccountGuideline() {
1130 return accountGuideline;
1131 }
1132
1133
1134
1135
1136
1137 @Override
1138 public void setAccountGuideline(AccountGuideline accountGuideline) {
1139 this.accountGuideline = accountGuideline;
1140 }
1141
1142
1143
1144
1145
1146
1147
1148 @Override
1149 public AccountDescription getAccountDescription() {
1150 return accountDescription;
1151 }
1152
1153
1154
1155
1156
1157
1158 @Override
1159 public void setAccountDescription(AccountDescription accountDescription) {
1160 this.accountDescription = accountDescription;
1161 }
1162
1163
1164
1165
1166 @Override
1167 public List getSubAccounts() {
1168 return subAccounts;
1169 }
1170
1171
1172
1173
1174
1175 @Override
1176 public void setSubAccounts(List subAccounts) {
1177 this.subAccounts = subAccounts;
1178 }
1179
1180
1181
1182
1183
1184 @Override
1185 public String getChartOfAccountsCode() {
1186 return chartOfAccountsCode;
1187 }
1188
1189
1190
1191
1192
1193 @Override
1194 public void setChartOfAccountsCode(String chartOfAccountsCode) {
1195 this.chartOfAccountsCode = chartOfAccountsCode;
1196 }
1197
1198
1199
1200
1201
1202 @Override
1203 public String getAccountFiscalOfficerSystemIdentifier() {
1204 return accountFiscalOfficerSystemIdentifier;
1205 }
1206
1207
1208
1209
1210 @Override
1211 public void setAccountFiscalOfficerSystemIdentifier(String accountFiscalOfficerSystemIdentifier) {
1212 this.accountFiscalOfficerSystemIdentifier = accountFiscalOfficerSystemIdentifier;
1213 }
1214
1215
1216
1217
1218 @Override
1219 public String getAccountManagerSystemIdentifier() {
1220 return accountManagerSystemIdentifier;
1221 }
1222
1223
1224
1225
1226 @Override
1227 public void setAccountManagerSystemIdentifier(String accountManagerSystemIdentifier) {
1228 this.accountManagerSystemIdentifier = accountManagerSystemIdentifier;
1229 }
1230
1231
1232
1233
1234 @Override
1235 public String getAccountPhysicalCampusCode() {
1236 return accountPhysicalCampusCode;
1237 }
1238
1239
1240
1241
1242 @Override
1243 public void setAccountPhysicalCampusCode(String accountPhysicalCampusCode) {
1244 this.accountPhysicalCampusCode = accountPhysicalCampusCode;
1245 }
1246
1247
1248
1249
1250 @Override
1251 public String getAccountRestrictedStatusCode() {
1252 return accountRestrictedStatusCode;
1253 }
1254
1255
1256
1257
1258 @Override
1259 public void setAccountRestrictedStatusCode(String accountRestrictedStatusCode) {
1260 this.accountRestrictedStatusCode = accountRestrictedStatusCode;
1261 }
1262
1263
1264
1265
1266 @Override
1267 public String getAccountsSupervisorySystemsIdentifier() {
1268 return accountsSupervisorySystemsIdentifier;
1269 }
1270
1271
1272
1273
1274 @Override
1275 public void setAccountsSupervisorySystemsIdentifier(String accountsSupervisorySystemsIdentifier) {
1276 this.accountsSupervisorySystemsIdentifier = accountsSupervisorySystemsIdentifier;
1277 }
1278
1279
1280
1281
1282 @Override
1283 public String getAccountTypeCode() {
1284 return accountTypeCode;
1285 }
1286
1287
1288
1289
1290 @Override
1291 public void setAccountTypeCode(String accountTypeCode) {
1292 this.accountTypeCode = accountTypeCode;
1293 }
1294
1295
1296
1297
1298 @Override
1299 public String getContinuationAccountNumber() {
1300 return continuationAccountNumber;
1301 }
1302
1303
1304
1305
1306 @Override
1307 public void setContinuationAccountNumber(String continuationAccountNumber) {
1308 this.continuationAccountNumber = continuationAccountNumber;
1309 }
1310
1311
1312
1313
1314 @Override
1315 public String getContinuationFinChrtOfAcctCd() {
1316 return continuationFinChrtOfAcctCd;
1317 }
1318
1319
1320
1321
1322 @Override
1323 public void setContinuationFinChrtOfAcctCd(String continuationFinChrtOfAcctCd) {
1324 this.continuationFinChrtOfAcctCd = continuationFinChrtOfAcctCd;
1325 }
1326
1327
1328
1329
1330 @Override
1331 public String getContractControlAccountNumber() {
1332 return contractControlAccountNumber;
1333 }
1334
1335
1336
1337
1338 @Override
1339 public void setContractControlAccountNumber(String contractControlAccountNumber) {
1340 this.contractControlAccountNumber = contractControlAccountNumber;
1341 }
1342
1343
1344
1345
1346 @Override
1347 public String getContractControlFinCoaCode() {
1348 return contractControlFinCoaCode;
1349 }
1350
1351
1352
1353
1354 @Override
1355 public void setContractControlFinCoaCode(String contractControlFinCoaCode) {
1356 this.contractControlFinCoaCode = contractControlFinCoaCode;
1357 }
1358
1359
1360
1361
1362 @Override
1363 public String getEndowmentIncomeAccountNumber() {
1364 return endowmentIncomeAccountNumber;
1365 }
1366
1367
1368
1369
1370 @Override
1371 public void setEndowmentIncomeAccountNumber(String endowmentIncomeAccountNumber) {
1372 this.endowmentIncomeAccountNumber = endowmentIncomeAccountNumber;
1373 }
1374
1375
1376
1377
1378 @Override
1379 public String getEndowmentIncomeAcctFinCoaCd() {
1380 return endowmentIncomeAcctFinCoaCd;
1381 }
1382
1383
1384
1385
1386 @Override
1387 public void setEndowmentIncomeAcctFinCoaCd(String endowmentIncomeAcctFinCoaCd) {
1388 this.endowmentIncomeAcctFinCoaCd = endowmentIncomeAcctFinCoaCd;
1389 }
1390
1391
1392
1393
1394 @Override
1395 public String getFinancialHigherEdFunctionCd() {
1396 return financialHigherEdFunctionCd;
1397 }
1398
1399
1400
1401
1402 @Override
1403 public void setFinancialHigherEdFunctionCd(String financialHigherEdFunctionCd) {
1404 this.financialHigherEdFunctionCd = financialHigherEdFunctionCd;
1405 }
1406
1407
1408
1409
1410 @Override
1411 public String getIncomeStreamAccountNumber() {
1412 return incomeStreamAccountNumber;
1413 }
1414
1415
1416
1417
1418 @Override
1419 public void setIncomeStreamAccountNumber(String incomeStreamAccountNumber) {
1420 this.incomeStreamAccountNumber = incomeStreamAccountNumber;
1421 }
1422
1423
1424
1425
1426 @Override
1427 public String getIncomeStreamFinancialCoaCode() {
1428 return incomeStreamFinancialCoaCode;
1429 }
1430
1431
1432
1433
1434 @Override
1435 public void setIncomeStreamFinancialCoaCode(String incomeStreamFinancialCoaCode) {
1436 this.incomeStreamFinancialCoaCode = incomeStreamFinancialCoaCode;
1437 }
1438
1439
1440
1441
1442 @Override
1443 public String getOrganizationCode() {
1444 return organizationCode;
1445 }
1446
1447
1448
1449
1450 @Override
1451 public void setOrganizationCode(String organizationCode) {
1452 this.organizationCode = organizationCode;
1453 }
1454
1455
1456
1457
1458 @Override
1459 public String getReportsToAccountNumber() {
1460 return reportsToAccountNumber;
1461 }
1462
1463
1464
1465
1466 @Override
1467 public void setReportsToAccountNumber(String reportsToAccountNumber) {
1468 this.reportsToAccountNumber = reportsToAccountNumber;
1469 }
1470
1471
1472
1473
1474 @Override
1475 public String getReportsToChartOfAccountsCode() {
1476 return reportsToChartOfAccountsCode;
1477 }
1478
1479
1480
1481
1482 @Override
1483 public void setReportsToChartOfAccountsCode(String reportsToChartOfAccountsCode) {
1484 this.reportsToChartOfAccountsCode = reportsToChartOfAccountsCode;
1485 }
1486
1487
1488
1489
1490 @Override
1491 public String getSubFundGroupCode() {
1492 return subFundGroupCode;
1493 }
1494
1495
1496
1497
1498 @Override
1499 public void setSubFundGroupCode(String subFundGroupCode) {
1500 this.subFundGroupCode = subFundGroupCode;
1501 forContractsAndGrants = null;
1502 }
1503
1504
1505
1506
1507
1508
1509 @Override
1510 public PostalCodeEbo getPostalZipCode() {
1511 if ( StringUtils.isBlank(accountZipCode) || StringUtils.isBlank(OLEConstants.COUNTRY_CODE_UNITED_STATES ) ) {
1512 postalZipCode = null;
1513 } else {
1514 if ( postalZipCode == null || !StringUtils.equals( postalZipCode.getCode(),accountZipCode) || !StringUtils.equals(postalZipCode.getCountryCode(), OLEConstants.COUNTRY_CODE_UNITED_STATES ) ) {
1515 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(PostalCodeEbo.class);
1516 if ( moduleService != null ) {
1517 Map<String,Object> keys = new HashMap<String, Object>(2);
1518 keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, OLEConstants.COUNTRY_CODE_UNITED_STATES);
1519 keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountZipCode);
1520 postalZipCode = moduleService.getExternalizableBusinessObject(PostalCodeEbo.class, keys);
1521 } else {
1522 throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
1523 }
1524 }
1525 }
1526 return postalZipCode;
1527 }
1528
1529
1530
1531
1532
1533
1534 @Override
1535 public void setPostalZipCode(PostalCodeEbo postalZipCode) {
1536 this.postalZipCode = postalZipCode;
1537 }
1538
1539
1540
1541
1542
1543
1544 @Override
1545 public BudgetRecordingLevel getBudgetRecordingLevel() {
1546 return budgetRecordingLevel;
1547 }
1548
1549
1550
1551
1552
1553
1554 @Override
1555 public void setBudgetRecordingLevel(BudgetRecordingLevel budgetRecordingLevel) {
1556 this.budgetRecordingLevel = budgetRecordingLevel;
1557 }
1558
1559
1560
1561
1562
1563
1564 @Override
1565 public SufficientFundsCode getSufficientFundsCode() {
1566 return sufficientFundsCode;
1567 }
1568
1569
1570
1571
1572
1573
1574 @Override
1575 public void setSufficientFundsCode(SufficientFundsCode sufficientFundsCode) {
1576 this.sufficientFundsCode = sufficientFundsCode;
1577 }
1578
1579
1580
1581
1582
1583
1584 @Override
1585 public boolean equals(Object obj) {
1586 boolean equal = false;
1587
1588 if (obj != null) {
1589 if (this.getClass().equals(obj.getClass())) {
1590 Account other = (Account) obj;
1591
1592 if (StringUtils.equals(this.getChartOfAccountsCode(), other.getChartOfAccountsCode())) {
1593 if (StringUtils.equals(this.getAccountNumber(), other.getAccountNumber())) {
1594 equal = true;
1595 }
1596 }
1597 }
1598 }
1599
1600 return equal;
1601 }
1602
1603
1604
1605
1606
1607
1608
1609
1610 @Override
1611 public int hashCode() {
1612 String hashString = getChartOfAccountsCode() + "|" + getAccountNumber();
1613
1614 return hashString.hashCode();
1615 }
1616
1617
1618
1619
1620
1621
1622
1623
1624 @Override
1625 public String getAccountKey() {
1626 String key = getChartOfAccountsCode() + ":" + getAccountNumber();
1627 return key;
1628 }
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641 @Override
1642 public String getAccountResponsibilitySection() {
1643 return accountResponsibilitySection;
1644 }
1645
1646
1647
1648
1649
1650
1651 @Override
1652 public void setAccountResponsibilitySection(String accountResponsibilitySection) {
1653 this.accountResponsibilitySection = accountResponsibilitySection;
1654 }
1655
1656
1657
1658
1659
1660
1661 @Override
1662 public String getContractsAndGrantsSection() {
1663 return contractsAndGrantsSection;
1664 }
1665
1666
1667
1668
1669
1670
1671 @Override
1672 public void setContractsAndGrantsSection(String contractsAndGrantsSection) {
1673 this.contractsAndGrantsSection = contractsAndGrantsSection;
1674 }
1675
1676
1677
1678
1679
1680
1681 @Override
1682 public String getAccountDescriptionSection() {
1683 return accountDescriptionSection;
1684 }
1685
1686
1687
1688
1689
1690
1691 @Override
1692 public void setAccountDescriptionSection(String accountDescriptionSection) {
1693 this.accountDescriptionSection = accountDescriptionSection;
1694 }
1695
1696
1697
1698
1699
1700
1701 @Override
1702 public String getGuidelinesAndPurposeSection() {
1703 return guidelinesAndPurposeSection;
1704 }
1705
1706
1707
1708
1709
1710
1711 @Override
1712 public void setGuidelinesAndPurposeSection(String guidelinesAndPurposeSection) {
1713 this.guidelinesAndPurposeSection = guidelinesAndPurposeSection;
1714 }
1715
1716
1717
1718
1719
1720
1721 @Override
1722 public String getAccountResponsibilitySectionBlank() {
1723 return accountResponsibilitySectionBlank;
1724 }
1725
1726
1727
1728
1729
1730
1731 @Override
1732 public String getContractsAndGrantsSectionBlank() {
1733 return contractsAndGrantsSectionBlank;
1734 }
1735
1736
1737
1738
1739
1740
1741 @Override
1742 public String getAccountDescriptionSectionBlank() {
1743 return accountDescriptionSectionBlank;
1744 }
1745
1746
1747
1748
1749
1750
1751 @Override
1752 public String getGuidelinesAndPurposeSectionBlank() {
1753 return guidelinesAndPurposeSectionBlank;
1754 }
1755
1756
1757
1758
1759
1760
1761 @Override
1762 public boolean isForContractsAndGrants() {
1763 if ( forContractsAndGrants == null ) {
1764 forContractsAndGrants = SpringContext.getBean(SubFundGroupService.class).isForContractsAndGrants(getSubFundGroup());
1765 }
1766 return forContractsAndGrants;
1767 }
1768
1769
1770
1771
1772 @Override
1773 public boolean isClosed() {
1774 return !active;
1775 }
1776
1777 @Override
1778 public List<PriorYearIndirectCostRecoveryAccount> getIndirectCostRecoveryAccounts() {
1779 return indirectCostRecoveryAccounts;
1780 }
1781
1782 @Override
1783 public void setIndirectCostRecoveryAccounts(List<? extends IndirectCostRecoveryAccount> indirectCostRecoveryAccounts) {
1784 List<PriorYearIndirectCostRecoveryAccount> priorYearAccountIcrList = new ArrayList<PriorYearIndirectCostRecoveryAccount>();
1785 for (IndirectCostRecoveryAccount icr : indirectCostRecoveryAccounts){
1786 priorYearAccountIcrList.add(new PriorYearIndirectCostRecoveryAccount(icr));
1787 }
1788 this.indirectCostRecoveryAccounts = priorYearAccountIcrList;
1789 }
1790
1791 }