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.Collection;
23 import java.util.HashMap;
24 import java.util.List;
25 import java.util.Map;
26
27 import org.apache.commons.lang.StringUtils;
28 import org.apache.commons.lang.time.DateUtils;
29 import org.kuali.ole.coa.service.SubFundGroupService;
30 import org.kuali.ole.gl.businessobject.SufficientFundRebuild;
31 import org.kuali.ole.integration.cg.ContractsAndGrantsAccountAwardInformation;
32 import org.kuali.ole.integration.cg.ContractsAndGrantsModuleService;
33 import org.kuali.ole.select.businessobject.OleLegacyFundCode;
34 import org.kuali.ole.select.businessobject.OleStewardshipRequirement;
35 import org.kuali.ole.select.businessobject.OleSufficientFundCheck;
36 import org.kuali.ole.sys.OLEConstants;
37 import org.kuali.ole.sys.OLEPropertyConstants;
38 import org.kuali.ole.sys.context.SpringContext;
39 import org.kuali.ole.vnd.businessobject.VendorDetail;
40 import org.kuali.rice.core.api.datetime.DateTimeService;
41 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
42 import org.kuali.rice.core.api.util.type.KualiDecimal;
43 import org.kuali.rice.kim.api.identity.Person;
44 import org.kuali.rice.krad.bo.PersistableBusinessObject;
45 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
46 import org.kuali.rice.krad.service.BusinessObjectService;
47 import org.kuali.rice.krad.service.KualiModuleService;
48 import org.kuali.rice.krad.service.ModuleService;
49 import org.kuali.rice.krad.util.ObjectUtils;
50 import org.kuali.rice.location.api.LocationConstants;
51 import org.kuali.rice.location.framework.campus.CampusEbo;
52 import org.kuali.rice.location.framework.postalcode.PostalCodeEbo;
53 import org.kuali.rice.location.framework.state.StateEbo;
54
55
56
57
58 public class Account extends PersistableBusinessObjectBase implements AccountIntf, MutableInactivatable {
59 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(Account.class);
60 public static final String CACHE_NAME = OLEConstants.APPLICATION_NAMESPACE_CODE + "/" + "Account";
61
62 protected String chartOfAccountsCode;
63 protected String accountNumber;
64 protected String accountName;
65 protected boolean accountsFringesBnftIndicator;
66 protected Date accountRestrictedStatusDate;
67 protected String accountCityName;
68 protected String accountStateCode;
69 protected String accountStreetAddress;
70 protected String accountZipCode;
71 protected String accountCountryCode = OLEConstants.COUNTRY_CODE_UNITED_STATES;
72 protected Date accountCreateDate;
73 protected Date accountEffectiveDate;
74 protected Date accountExpirationDate;
75 protected String acctIndirectCostRcvyTypeCd;
76 protected String acctCustomIndCstRcvyExclCd;
77 protected String financialIcrSeriesIdentifier;
78 protected boolean accountInFinancialProcessingIndicator;
79 protected String budgetRecordingLevelCode;
80 protected String accountSufficientFundsCode;
81 protected boolean pendingAcctSufficientFundsIndicator;
82 protected boolean extrnlFinEncumSufficntFndIndicator;
83 protected boolean intrnlFinEncumSufficntFndIndicator;
84 protected boolean finPreencumSufficientFundIndicator;
85 protected boolean financialObjectivePrsctrlIndicator;
86 protected String accountCfdaNumber;
87 protected boolean accountOffCampusIndicator;
88 protected boolean active;
89
90 protected String accountFiscalOfficerSystemIdentifier;
91 protected String accountsSupervisorySystemsIdentifier;
92 protected String accountManagerSystemIdentifier;
93 protected String organizationCode;
94 protected String accountTypeCode;
95 protected String accountPhysicalCampusCode;
96 protected String subFundGroupCode;
97 protected String financialHigherEdFunctionCd;
98 protected String accountRestrictedStatusCode;
99 protected String reportsToChartOfAccountsCode;
100 protected String reportsToAccountNumber;
101 protected String continuationFinChrtOfAcctCd;
102 protected String continuationAccountNumber;
103 protected String endowmentIncomeAcctFinCoaCd;
104 protected String endowmentIncomeAccountNumber;
105 protected String contractControlFinCoaCode;
106 protected String contractControlAccountNumber;
107 protected String incomeStreamFinancialCoaCode;
108 protected String incomeStreamAccountNumber;
109 protected Integer contractsAndGrantsAccountResponsibilityId;
110
111 protected Chart chartOfAccounts;
112 protected Chart endowmentIncomeChartOfAccounts;
113 protected Organization organization;
114 protected AccountType accountType;
115 protected CampusEbo accountPhysicalCampus;
116 protected StateEbo accountState;
117 protected SubFundGroup subFundGroup;
118 protected HigherEducationFunction financialHigherEdFunction;
119 protected RestrictedStatus accountRestrictedStatus;
120 protected Account reportsToAccount;
121 protected Account continuationAccount;
122 protected Account endowmentIncomeAccount;
123 protected Account contractControlAccount;
124 protected Account incomeStreamAccount;
125 protected IndirectCostRecoveryType acctIndirectCostRcvyType;
126 protected Person accountFiscalOfficerUser;
127 protected Person accountSupervisoryUser;
128 protected Person accountManagerUser;
129 protected PostalCodeEbo postalZipCode;
130 protected BudgetRecordingLevel budgetRecordingLevel;
131 protected SufficientFundsCode sufficientFundsCode;
132 protected CFDA cfda;
133
134 protected Chart fringeBenefitsChartOfAccount;
135 protected Chart continuationChartOfAccount;
136 protected Chart incomeStreamChartOfAccounts;
137 protected Chart contractControlChartOfAccounts;
138
139
140 protected String accountResponsibilitySectionBlank;
141 protected String accountResponsibilitySection;
142 protected String contractsAndGrantsSectionBlank;
143 protected String contractsAndGrantsSection;
144 protected String guidelinesAndPurposeSectionBlank;
145 protected String guidelinesAndPurposeSection;
146 protected String accountDescriptionSectionBlank;
147 protected String accountDescriptionSection;
148
149 protected Boolean forContractsAndGrants;
150
151 protected AccountGuideline accountGuideline;
152 protected AccountDescription accountDescription;
153
154 protected List subAccounts;
155 protected List<ContractsAndGrantsAccountAwardInformation> awards;
156 protected List<IndirectCostRecoveryAccount> indirectCostRecoveryAccounts;
157
158 protected String laborBenefitRateCategoryCode;
159
160
161 protected List<OleStewardshipRequirement> oleStewardshipRequirements;
162 protected List<OleLegacyFundCode> oleLegacyFundCodes;
163
164
165 protected String universityAccountNumber;
166
167 protected OleStewardshipRequirement stewardshipRequirement;
168
169 protected boolean restricted;
170
171
172 protected OleLegacyFundCode oleLegacyFundCode;
173
174 protected Integer vendorHeaderGeneratedIdentifier;
175 protected Integer vendorDetailAssignedIdentifier;
176 protected VendorDetail vendorDetail;
177 private boolean vendorDepositAccount;
178 private OleSufficientFundCheck oleSufficientFundCheck;
179 protected String vendorName;
180 protected KualiDecimal thresholdPercentage;
181 protected KualiDecimal thresholdAmount;
182
183 public OleSufficientFundCheck getOleSufficientFundCheck() {
184 return oleSufficientFundCheck;
185 }
186
187 public void setOleSufficientFundCheck(OleSufficientFundCheck oleSufficientFundCheck) {
188 this.oleSufficientFundCheck = oleSufficientFundCheck;
189 }
190
191
192
193
194
195 public boolean isVendorDepositAccount() {
196 return vendorDepositAccount;
197 }
198
199
200
201
202
203 public void setVendorDepositAccount(boolean vendorDepositAccount) {
204 this.vendorDepositAccount = vendorDepositAccount;
205 }
206
207
208
209
210
211 public String getVendorName() {
212 VendorDetail tempVendorDetail = new VendorDetail();
213 tempVendorDetail.setVendorHeaderGeneratedIdentifier(vendorHeaderGeneratedIdentifier);
214 tempVendorDetail.setVendorDetailAssignedIdentifier(vendorDetailAssignedIdentifier);
215 String headerId = "";
216 String detailId = "";
217 String vendorName = "";
218 if (ObjectUtils.isNotNull(this.vendorHeaderGeneratedIdentifier)) {
219 headerId = this.vendorHeaderGeneratedIdentifier.toString();
220 }
221 if (ObjectUtils.isNotNull(this.vendorDetailAssignedIdentifier)) {
222 detailId = this.vendorDetailAssignedIdentifier.toString();
223 }
224 if (!StringUtils.isEmpty(headerId) && !StringUtils.isEmpty(detailId)) {
225 VendorDetail vendorDetail;
226 Map<String, String> pkMap = new HashMap<String, String>();
227 pkMap.put("vendorHeaderGeneratedIdentifier", headerId);
228 pkMap.put("vendorDetailAssignedIdentifier", detailId);
229 vendorDetail = SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(VendorDetail.class,
230 pkMap);
231 vendorName = vendorDetail.getVendorName();
232 }
233 return vendorName;
234 }
235
236
237
238
239
240
241 public void setVendorName(String vendorName) {
242 VendorDetail tempVendorDetail = new VendorDetail();
243 tempVendorDetail.setVendorName(vendorName);
244 if (StringUtils.isEmpty(vendorName)) {
245 vendorHeaderGeneratedIdentifier = null;
246 vendorDetailAssignedIdentifier = null;
247 return;
248 }
249 }
250
251
252
253
254
255 public Integer getVendorHeaderGeneratedIdentifier() {
256 return vendorHeaderGeneratedIdentifier;
257 }
258
259
260
261
262
263 public void setVendorHeaderGeneratedIdentifier(Integer vendorHeaderGeneratedIdentifier) {
264 this.vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
265 }
266
267
268
269
270
271 public Integer getVendorDetailAssignedIdentifier() {
272 return vendorDetailAssignedIdentifier;
273 }
274
275
276
277
278
279 public void setVendorDetailAssignedIdentifier(Integer vendorDetailAssignedIdentifier) {
280 this.vendorDetailAssignedIdentifier = vendorDetailAssignedIdentifier;
281 }
282
283
284
285
286
287 public VendorDetail getVendorDetail() {
288 return vendorDetail;
289 }
290
291
292
293
294
295 public void setVendorDetail(VendorDetail vendorDetail) {
296 this.vendorDetail = vendorDetail;
297 }
298
299
300
301
302
303
304 public boolean isRestricted() {
305 return restricted;
306 }
307
308
309
310
311
312 public void setRestricted(boolean restricted) {
313 this.restricted = restricted;
314 }
315
316
317
318
319
320 public OleStewardshipRequirement getStewardshipRequirement() {
321 return stewardshipRequirement;
322 }
323
324
325
326
327
328 public void setStewardshipRequirement(OleStewardshipRequirement stewardshipRequirement) {
329 this.stewardshipRequirement = stewardshipRequirement;
330 }
331
332
333 public OleLegacyFundCode getOleLegacyFundCode() {
334 return oleLegacyFundCode;
335 }
336
337 public void setOleLegacyFundCode(OleLegacyFundCode oleLegacyFundCode) {
338 this.oleLegacyFundCode = oleLegacyFundCode;
339 }
340
341 public String getUniversityAccountNumber() {
342 return universityAccountNumber;
343 }
344
345 public void setUniversityAccountNumber(String universityAccountNumber) {
346 this.universityAccountNumber = universityAccountNumber;
347 }
348
349 public List<OleLegacyFundCode> getOleLegacyFundCodes() {
350 return oleLegacyFundCodes;
351 }
352
353 public void setOleLegacyFundCodes(List<OleLegacyFundCode> oleLegacyFundCodes) {
354 this.oleLegacyFundCodes = oleLegacyFundCodes;
355 }
356
357 public List<OleStewardshipRequirement> getOleStewardshipRequirements() {
358 return oleStewardshipRequirements;
359 }
360
361 public void setOleStewardshipRequirements(List<OleStewardshipRequirement> oleStewardshipRequirements) {
362 this.oleStewardshipRequirements = oleStewardshipRequirements;
363 }
364
365
366
367
368 public Account() {
369 active = true;
370 indirectCostRecoveryAccounts = new ArrayList<IndirectCostRecoveryAccount>();
371 oleStewardshipRequirements = new ArrayList<OleStewardshipRequirement>();
372 oleLegacyFundCodes = new ArrayList<OleLegacyFundCode>();
373 }
374
375
376
377
378 public List<PersistableBusinessObject> generateDeactivationsToPersist() {
379 BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
380
381
382 List<SubAccount> bosToDeactivate = new ArrayList<SubAccount>();
383 if (!isActive()) {
384 Map<String, Object> fieldValues = new HashMap<String,Object>();
385 fieldValues.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, getChartOfAccountsCode());
386 fieldValues.put(OLEPropertyConstants.ACCOUNT_NUMBER, getAccountNumber());
387 fieldValues.put(OLEPropertyConstants.ACTIVE, true);
388 Collection<SubAccount> existingSubAccounts = SpringContext.getBean(BusinessObjectService.class).findMatching(SubAccount.class, fieldValues);
389 bosToDeactivate.addAll(existingSubAccounts);
390 }
391
392 for (SubAccount subAccount : bosToDeactivate) {
393 subAccount.setActive(false);
394 }
395 return new ArrayList<PersistableBusinessObject>(bosToDeactivate);
396 }
397
398
399
400
401
402
403 @Override
404 public String getAccountNumber() {
405 return accountNumber;
406 }
407
408
409
410
411
412
413 @Override
414 public void setAccountNumber(String accountNumber) {
415 this.accountNumber = accountNumber;
416 }
417
418
419
420
421
422
423 @Override
424 public String getAccountName() {
425 return accountName;
426 }
427
428
429
430
431
432
433 @Override
434 public void setAccountName(String accountName) {
435 this.accountName = accountName;
436 }
437
438
439
440
441
442
443 @Override
444 public boolean isAccountsFringesBnftIndicator() {
445 return accountsFringesBnftIndicator;
446 }
447
448
449
450
451
452
453 @Override
454 public void setAccountsFringesBnftIndicator(boolean _AccountsFringesBnftIndicator_) {
455 this.accountsFringesBnftIndicator = _AccountsFringesBnftIndicator_;
456 }
457
458
459
460
461
462
463 @Override
464 public Date getAccountRestrictedStatusDate() {
465 return accountRestrictedStatusDate;
466 }
467
468
469
470
471
472
473 @Override
474 public void setAccountRestrictedStatusDate(Date accountRestrictedStatusDate) {
475 this.accountRestrictedStatusDate = accountRestrictedStatusDate;
476 }
477
478
479
480
481
482
483 @Override
484 public String getAccountCityName() {
485 return accountCityName;
486 }
487
488
489
490
491
492
493 @Override
494 public void setAccountCityName(String accountCityName) {
495 this.accountCityName = accountCityName;
496 }
497
498
499
500
501
502
503 @Override
504 public String getAccountStateCode() {
505 return accountStateCode;
506 }
507
508
509
510
511
512
513 @Override
514 public void setAccountStateCode(String accountStateCode) {
515 this.accountStateCode = accountStateCode;
516 }
517
518
519
520
521
522
523 @Override
524 public String getAccountStreetAddress() {
525 return accountStreetAddress;
526 }
527
528
529
530
531
532
533 @Override
534 public void setAccountStreetAddress(String accountStreetAddress) {
535 this.accountStreetAddress = accountStreetAddress;
536 }
537
538
539
540
541
542
543 @Override
544 public String getAccountZipCode() {
545 return accountZipCode;
546 }
547
548
549
550
551
552
553 @Override
554 public void setAccountZipCode(String accountZipCode) {
555 this.accountZipCode = accountZipCode;
556 }
557
558
559
560
561
562
563 @Override
564 public Date getAccountCreateDate() {
565 return accountCreateDate;
566 }
567
568
569
570
571
572
573 @Override
574 public void setAccountCreateDate(Date accountCreateDate) {
575 this.accountCreateDate = accountCreateDate;
576 }
577
578
579
580
581
582
583 @Override
584 public Date getAccountEffectiveDate() {
585 return accountEffectiveDate;
586 }
587
588
589
590
591
592
593 @Override
594 public void setAccountEffectiveDate(Date accountEffectiveDate) {
595 this.accountEffectiveDate = accountEffectiveDate;
596 }
597
598
599
600
601
602
603 @Override
604 public Date getAccountExpirationDate() {
605 return accountExpirationDate;
606 }
607
608
609
610
611
612
613 @Override
614 public void setAccountExpirationDate(Date accountExpirationDate) {
615 this.accountExpirationDate = accountExpirationDate;
616 }
617
618
619
620
621
622
623
624
625
626 @Override
627 public boolean isExpired() {
628 LOG.debug("entering isExpired()");
629
630 if (accountExpirationDate == null) {
631 return false;
632 }
633
634 return isExpired(SpringContext.getBean(DateTimeService.class).getCurrentCalendar());
635 }
636
637
638
639
640
641
642
643
644
645
646
647 @Override
648 public boolean isExpired(Calendar testDate) {
649 if (LOG.isDebugEnabled()) {
650 LOG.debug("entering isExpired(" + testDate + ")");
651 }
652
653
654 if (accountExpirationDate == null) {
655 return false;
656 }
657
658
659 testDate = DateUtils.truncate(testDate, Calendar.DAY_OF_MONTH);
660
661
662
663 Calendar acctDate = Calendar.getInstance();
664 acctDate.setTime(this.accountExpirationDate);
665 acctDate = DateUtils.truncate(acctDate, Calendar.DAY_OF_MONTH);
666
667
668 return acctDate.before(testDate);
669 }
670
671
672
673
674
675
676
677
678
679
680
681 @Override
682 public boolean isExpired(Date testDate) {
683
684
685 if (accountExpirationDate == null) {
686 return false;
687 }
688
689 Calendar acctDate = Calendar.getInstance();
690 acctDate.setTime(testDate);
691 return isExpired(acctDate);
692 }
693
694
695
696
697
698
699 @Override
700 public String getAcctIndirectCostRcvyTypeCd() {
701 return acctIndirectCostRcvyTypeCd;
702 }
703
704
705
706
707
708
709 @Override
710 public void setAcctIndirectCostRcvyTypeCd(String acctIndirectCostRcvyTypeCd) {
711 this.acctIndirectCostRcvyTypeCd = acctIndirectCostRcvyTypeCd;
712 }
713
714
715
716
717
718
719 @Override
720 public String getAcctCustomIndCstRcvyExclCd() {
721 return acctCustomIndCstRcvyExclCd;
722 }
723
724
725
726
727
728
729 @Override
730 public void setAcctCustomIndCstRcvyExclCd(String acctCustomIndCstRcvyExclCd) {
731 this.acctCustomIndCstRcvyExclCd = acctCustomIndCstRcvyExclCd;
732 }
733
734
735
736
737
738
739 @Override
740 public String getFinancialIcrSeriesIdentifier() {
741 return financialIcrSeriesIdentifier;
742 }
743
744
745
746
747
748
749 @Override
750 public void setFinancialIcrSeriesIdentifier(String financialIcrSeriesIdentifier) {
751 this.financialIcrSeriesIdentifier = financialIcrSeriesIdentifier;
752 }
753
754
755
756
757
758
759 @Override
760 public boolean getAccountInFinancialProcessingIndicator() {
761 return accountInFinancialProcessingIndicator;
762 }
763
764
765
766
767
768
769 @Override
770 public void setAccountInFinancialProcessingIndicator(boolean accountInFinancialProcessingIndicator) {
771 this.accountInFinancialProcessingIndicator = accountInFinancialProcessingIndicator;
772 }
773
774
775
776
777
778
779 @Override
780 public String getBudgetRecordingLevelCode() {
781 return budgetRecordingLevelCode;
782 }
783
784
785
786
787
788
789 @Override
790 public void setBudgetRecordingLevelCode(String budgetRecordingLevelCode) {
791 this.budgetRecordingLevelCode = budgetRecordingLevelCode;
792 }
793
794
795
796
797
798
799 @Override
800 public String getAccountSufficientFundsCode() {
801 return accountSufficientFundsCode;
802 }
803
804
805
806
807
808
809 @Override
810 public void setAccountSufficientFundsCode(String accountSufficientFundsCode) {
811 this.accountSufficientFundsCode = accountSufficientFundsCode;
812 }
813
814
815
816
817
818
819 @Override
820 public boolean isPendingAcctSufficientFundsIndicator() {
821 return pendingAcctSufficientFundsIndicator;
822 }
823
824
825
826
827
828
829 @Override
830 public void setPendingAcctSufficientFundsIndicator(boolean pendingAcctSufficientFundsIndicator) {
831 this.pendingAcctSufficientFundsIndicator = pendingAcctSufficientFundsIndicator;
832 }
833
834
835
836
837
838
839 @Override
840 public boolean isExtrnlFinEncumSufficntFndIndicator() {
841 return extrnlFinEncumSufficntFndIndicator;
842 }
843
844
845
846
847
848
849 @Override
850 public void setExtrnlFinEncumSufficntFndIndicator(boolean extrnlFinEncumSufficntFndIndicator) {
851 this.extrnlFinEncumSufficntFndIndicator = extrnlFinEncumSufficntFndIndicator;
852 }
853
854
855
856
857
858
859 @Override
860 public boolean isIntrnlFinEncumSufficntFndIndicator() {
861 return intrnlFinEncumSufficntFndIndicator;
862 }
863
864
865
866
867
868
869 @Override
870 public void setIntrnlFinEncumSufficntFndIndicator(boolean intrnlFinEncumSufficntFndIndicator) {
871 this.intrnlFinEncumSufficntFndIndicator = intrnlFinEncumSufficntFndIndicator;
872 }
873
874
875
876
877
878
879 @Override
880 public boolean isFinPreencumSufficientFundIndicator() {
881 return finPreencumSufficientFundIndicator;
882 }
883
884
885
886
887
888
889 @Override
890 public void setFinPreencumSufficientFundIndicator(boolean finPreencumSufficientFundIndicator) {
891 this.finPreencumSufficientFundIndicator = finPreencumSufficientFundIndicator;
892 }
893
894
895
896
897
898
899 @Override
900 public boolean isFinancialObjectivePrsctrlIndicator() {
901 return financialObjectivePrsctrlIndicator;
902 }
903
904
905
906
907
908
909 @Override
910 public void setFinancialObjectivePrsctrlIndicator(boolean _FinancialObjectivePrsctrlIndicator_) {
911 this.financialObjectivePrsctrlIndicator = _FinancialObjectivePrsctrlIndicator_;
912 }
913
914
915
916
917
918
919 @Override
920 public String getAccountCfdaNumber() {
921 return accountCfdaNumber;
922 }
923
924
925
926
927
928
929 @Override
930 public void setAccountCfdaNumber(String accountCfdaNumber) {
931 this.accountCfdaNumber = accountCfdaNumber;
932 }
933
934
935
936
937
938
939 public CFDA getCfda() {
940 return cfda ;
941 }
942
943
944
945
946
947 public void setCfda(CFDA cfda) {
948 this.cfda = cfda;
949 }
950
951 public List<ContractsAndGrantsAccountAwardInformation> getAwards() {
952
953
954 awards = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(ContractsAndGrantsAccountAwardInformation.class).retrieveExternalizableBusinessObjectsList(this, "awards", ContractsAndGrantsAccountAwardInformation.class);
955 return awards;
956 }
957
958 public void setAwards(List awards) {
959 this.awards = awards;
960 }
961
962 @Override
963 public List<IndirectCostRecoveryAccount> getIndirectCostRecoveryAccounts() {
964 return this.indirectCostRecoveryAccounts;
965 }
966
967 public List<IndirectCostRecoveryAccount> getActiveIndirectCostRecoveryAccounts() {
968 List<IndirectCostRecoveryAccount> activeList = new ArrayList<IndirectCostRecoveryAccount>();
969 for (IndirectCostRecoveryAccount icr : getIndirectCostRecoveryAccounts()){
970 if (icr.isActive()){
971 activeList.add(IndirectCostRecoveryAccount.copyICRAccount(icr));
972 }
973 }
974 return activeList;
975 }
976
977 @Override
978 public void setIndirectCostRecoveryAccounts(List<? extends IndirectCostRecoveryAccount> indirectCostRecoveryAccounts) {
979 List<IndirectCostRecoveryAccount> accountIcrList = new ArrayList<IndirectCostRecoveryAccount>();
980 for (IndirectCostRecoveryAccount icr : indirectCostRecoveryAccounts){
981 accountIcrList.add(icr);
982 }
983 this.indirectCostRecoveryAccounts = accountIcrList;
984 }
985
986
987
988
989
990
991 @Override
992 public boolean isAccountOffCampusIndicator() {
993 return accountOffCampusIndicator;
994 }
995
996
997
998
999
1000
1001 @Override
1002 public void setAccountOffCampusIndicator(boolean accountOffCampusIndicator) {
1003 this.accountOffCampusIndicator = accountOffCampusIndicator;
1004 }
1005
1006
1007
1008
1009
1010
1011 @Override
1012 public boolean isActive() {
1013 return active;
1014 }
1015
1016
1017
1018
1019
1020
1021 @Override
1022 public void setActive(boolean active) {
1023 this.active = active;
1024 }
1025
1026
1027
1028
1029
1030
1031 @Override
1032 public boolean isClosed() {
1033 return !active;
1034 }
1035
1036
1037
1038
1039
1040
1041 public void setClosed(boolean closed) {
1042 this.active = !closed;
1043 }
1044
1045
1046
1047
1048
1049
1050 @Override
1051 public Chart getChartOfAccounts() {
1052 return chartOfAccounts;
1053 }
1054
1055
1056
1057
1058
1059
1060
1061 @Deprecated
1062 @Override
1063 public void setChartOfAccounts(Chart chartOfAccounts) {
1064 this.chartOfAccounts = chartOfAccounts;
1065 }
1066
1067
1068
1069
1070
1071
1072 @Override
1073 public Organization getOrganization() {
1074 return organization;
1075 }
1076
1077
1078
1079
1080
1081
1082
1083 @Deprecated
1084 @Override
1085 public void setOrganization(Organization organization) {
1086 this.organization = organization;
1087 }
1088
1089
1090
1091
1092
1093
1094 @Override
1095 public AccountType getAccountType() {
1096 return accountType;
1097 }
1098
1099
1100
1101
1102
1103
1104
1105 @Deprecated
1106 @Override
1107 public void setAccountType(AccountType accountType) {
1108 this.accountType = accountType;
1109 }
1110
1111
1112
1113
1114
1115
1116 @Override
1117 public CampusEbo getAccountPhysicalCampus() {
1118 if ( StringUtils.isBlank(accountPhysicalCampusCode) ) {
1119 accountPhysicalCampus = null;
1120 } else {
1121 if ( accountPhysicalCampus == null || !StringUtils.equals( accountPhysicalCampus.getCode(),accountPhysicalCampusCode) ) {
1122 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CampusEbo.class);
1123 if ( moduleService != null ) {
1124 Map<String,Object> keys = new HashMap<String, Object>(1);
1125 keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountPhysicalCampusCode);
1126 accountPhysicalCampus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);
1127 } else {
1128 throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
1129 }
1130 }
1131 }
1132 return accountPhysicalCampus;
1133 }
1134
1135
1136
1137
1138
1139
1140
1141 @Deprecated
1142 @Override
1143 public void setAccountPhysicalCampus(CampusEbo accountPhysicalCampus) {
1144 this.accountPhysicalCampus = accountPhysicalCampus;
1145 }
1146
1147
1148
1149
1150
1151
1152 @Override
1153 public StateEbo getAccountState() {
1154 if ( StringUtils.isBlank(accountStateCode) || StringUtils.isBlank(accountCountryCode) ) {
1155 accountState = null;
1156 } else {
1157 if ( accountState == null || !StringUtils.equals( accountState.getCode(),accountStateCode) || !StringUtils.equals(accountState.getCountryCode(), accountCountryCode ) ) {
1158 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(StateEbo.class);
1159 if ( moduleService != null ) {
1160 Map<String,Object> keys = new HashMap<String, Object>(2);
1161 keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, accountCountryCode);
1162 keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountStateCode);
1163 accountState = moduleService.getExternalizableBusinessObject(StateEbo.class, keys);
1164 } else {
1165 throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
1166 }
1167 }
1168 }
1169 return accountState;
1170 }
1171
1172
1173
1174
1175
1176
1177
1178 @Deprecated
1179 @Override
1180 public void setAccountState(StateEbo state) {
1181 this.accountState = state;
1182 }
1183
1184
1185
1186
1187
1188
1189 @Override
1190 public SubFundGroup getSubFundGroup() {
1191 return subFundGroup;
1192 }
1193
1194
1195
1196
1197
1198
1199
1200 @Deprecated
1201 @Override
1202 public void setSubFundGroup(SubFundGroup subFundGroup) {
1203 this.subFundGroup = subFundGroup;
1204 }
1205
1206
1207
1208
1209
1210
1211 @Override
1212 public HigherEducationFunction getFinancialHigherEdFunction() {
1213 return financialHigherEdFunction;
1214 }
1215
1216
1217
1218
1219
1220
1221
1222 @Deprecated
1223 @Override
1224 public void setFinancialHigherEdFunction(HigherEducationFunction financialHigherEdFunction) {
1225 this.financialHigherEdFunction = financialHigherEdFunction;
1226 }
1227
1228
1229
1230
1231
1232
1233 @Override
1234 public RestrictedStatus getAccountRestrictedStatus() {
1235 return accountRestrictedStatus;
1236 }
1237
1238
1239
1240
1241
1242
1243
1244 @Deprecated
1245 @Override
1246 public void setAccountRestrictedStatus(RestrictedStatus accountRestrictedStatus) {
1247 this.accountRestrictedStatus = accountRestrictedStatus;
1248 }
1249
1250
1251
1252
1253
1254
1255 @Override
1256 public Account getReportsToAccount() {
1257 return reportsToAccount;
1258 }
1259
1260
1261
1262
1263
1264
1265
1266 @Deprecated
1267 @Override
1268 public void setReportsToAccount(Account reportsToAccount) {
1269 this.reportsToAccount = reportsToAccount;
1270 }
1271
1272
1273
1274
1275
1276
1277 @Override
1278 public Account getEndowmentIncomeAccount() {
1279 return endowmentIncomeAccount;
1280 }
1281
1282
1283
1284
1285
1286
1287
1288 @Deprecated
1289 @Override
1290 public void setEndowmentIncomeAccount(Account endowmentIncomeAccount) {
1291 this.endowmentIncomeAccount = endowmentIncomeAccount;
1292 }
1293
1294
1295
1296
1297
1298
1299 @Override
1300 public Account getContractControlAccount() {
1301 return contractControlAccount;
1302 }
1303
1304
1305
1306
1307
1308
1309
1310 @Deprecated
1311 @Override
1312 public void setContractControlAccount(Account contractControlAccount) {
1313 this.contractControlAccount = contractControlAccount;
1314 }
1315
1316
1317
1318
1319
1320
1321
1322 @Override
1323 public Account getIncomeStreamAccount() {
1324 return incomeStreamAccount;
1325 }
1326
1327
1328
1329
1330
1331
1332
1333 @Deprecated
1334 @Override
1335 public void setIncomeStreamAccount(Account incomeStreamAccount) {
1336 this.incomeStreamAccount = incomeStreamAccount;
1337 }
1338
1339 @Override
1340 public Person getAccountFiscalOfficerUser() {
1341 accountFiscalOfficerUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountFiscalOfficerSystemIdentifier, accountFiscalOfficerUser);
1342 return accountFiscalOfficerUser;
1343 }
1344
1345
1346
1347
1348
1349 @Override
1350 public void refreshReferenceObject(String referenceObjectName) {
1351 if (referenceObjectName.equals("accountFiscalOfficerUser") ||
1352 referenceObjectName.equals("accountSupervisoryUser") ||
1353 referenceObjectName.equals("accountManagerUser")) {
1354
1355 } else {
1356 super.refreshReferenceObject(referenceObjectName);
1357 }
1358 }
1359
1360
1361
1362
1363
1364 @Deprecated
1365 @Override
1366 public void setAccountFiscalOfficerUser(Person accountFiscalOfficerUser) {
1367 this.accountFiscalOfficerUser = accountFiscalOfficerUser;
1368 }
1369
1370 @Override
1371 public Person getAccountManagerUser() {
1372 accountManagerUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountManagerSystemIdentifier, accountManagerUser);
1373 return accountManagerUser;
1374 }
1375
1376
1377
1378
1379
1380 @Deprecated
1381 @Override
1382 public void setAccountManagerUser(Person accountManagerUser) {
1383 this.accountManagerUser = accountManagerUser;
1384 }
1385
1386
1387 @Override
1388 public Person getAccountSupervisoryUser() {
1389 accountSupervisoryUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountsSupervisorySystemsIdentifier, accountSupervisoryUser);
1390 return accountSupervisoryUser;
1391 }
1392
1393
1394
1395
1396
1397 @Deprecated
1398 @Override
1399 public void setAccountSupervisoryUser(Person accountSupervisoryUser) {
1400 this.accountSupervisoryUser = accountSupervisoryUser;
1401 }
1402
1403
1404
1405
1406
1407 @Override
1408 public Account getContinuationAccount() {
1409 return continuationAccount;
1410 }
1411
1412
1413
1414
1415
1416
1417 @Deprecated
1418 @Override
1419 public void setContinuationAccount(Account continuationAccount) {
1420 this.continuationAccount = continuationAccount;
1421 }
1422
1423
1424
1425
1426 @Override
1427 public AccountGuideline getAccountGuideline() {
1428 return accountGuideline;
1429 }
1430
1431
1432
1433
1434
1435 @Override
1436 public void setAccountGuideline(AccountGuideline accountGuideline) {
1437 this.accountGuideline = accountGuideline;
1438 }
1439
1440
1441
1442
1443
1444
1445
1446 @Override
1447 public AccountDescription getAccountDescription() {
1448 return accountDescription;
1449 }
1450
1451
1452
1453
1454
1455
1456 @Override
1457 public void setAccountDescription(AccountDescription accountDescription) {
1458 this.accountDescription = accountDescription;
1459 }
1460
1461
1462
1463
1464 @Override
1465 public List getSubAccounts() {
1466 return subAccounts;
1467 }
1468
1469
1470
1471
1472
1473 @Override
1474 public void setSubAccounts(List subAccounts) {
1475 this.subAccounts = subAccounts;
1476 }
1477
1478
1479
1480
1481
1482 @Override
1483 public String getChartOfAccountsCode() {
1484 return chartOfAccountsCode;
1485 }
1486
1487
1488
1489
1490
1491 @Override
1492 public void setChartOfAccountsCode(String chartOfAccountsCode) {
1493 this.chartOfAccountsCode = chartOfAccountsCode;
1494 }
1495
1496
1497
1498
1499
1500 @Override
1501 public String getAccountFiscalOfficerSystemIdentifier() {
1502 return accountFiscalOfficerSystemIdentifier;
1503 }
1504
1505
1506
1507
1508 public String getAccountFiscalOfficerSystemIdentifierForSearching() {
1509 return getAccountFiscalOfficerSystemIdentifier();
1510 }
1511
1512
1513
1514
1515
1516 @Override
1517 public void setAccountFiscalOfficerSystemIdentifier(String accountFiscalOfficerSystemIdentifier) {
1518 this.accountFiscalOfficerSystemIdentifier = accountFiscalOfficerSystemIdentifier;
1519 }
1520
1521
1522
1523
1524 @Override
1525 public String getAccountManagerSystemIdentifier() {
1526 return accountManagerSystemIdentifier;
1527 }
1528
1529
1530
1531
1532 public String getAccountManagerSystemIdentifierForSearching() {
1533 return getAccountManagerSystemIdentifier();
1534 }
1535
1536
1537
1538
1539 @Override
1540 public void setAccountManagerSystemIdentifier(String accountManagerSystemIdentifier) {
1541 this.accountManagerSystemIdentifier = accountManagerSystemIdentifier;
1542 }
1543
1544
1545
1546
1547 @Override
1548 public String getAccountPhysicalCampusCode() {
1549 return accountPhysicalCampusCode;
1550 }
1551
1552
1553
1554
1555 @Override
1556 public void setAccountPhysicalCampusCode(String accountPhysicalCampusCode) {
1557 this.accountPhysicalCampusCode = accountPhysicalCampusCode;
1558 }
1559
1560
1561
1562
1563 @Override
1564 public String getAccountRestrictedStatusCode() {
1565 return accountRestrictedStatusCode;
1566 }
1567
1568
1569
1570
1571 @Override
1572 public void setAccountRestrictedStatusCode(String accountRestrictedStatusCode) {
1573 this.accountRestrictedStatusCode = accountRestrictedStatusCode;
1574 }
1575
1576
1577
1578
1579 @Override
1580 public String getAccountsSupervisorySystemsIdentifier() {
1581 return accountsSupervisorySystemsIdentifier;
1582 }
1583
1584
1585
1586
1587 public String getAccountsSupervisorySystemsIdentifierForSearching() {
1588 return accountsSupervisorySystemsIdentifier;
1589 }
1590
1591
1592
1593
1594 @Override
1595 public void setAccountsSupervisorySystemsIdentifier(String accountsSupervisorySystemsIdentifier) {
1596 this.accountsSupervisorySystemsIdentifier = accountsSupervisorySystemsIdentifier;
1597 }
1598
1599
1600
1601
1602 @Override
1603 public String getAccountTypeCode() {
1604 return accountTypeCode;
1605 }
1606
1607
1608
1609
1610 @Override
1611 public void setAccountTypeCode(String accountTypeCode) {
1612 this.accountTypeCode = accountTypeCode;
1613 }
1614
1615
1616
1617
1618 @Override
1619 public String getContinuationAccountNumber() {
1620 return continuationAccountNumber;
1621 }
1622
1623
1624
1625
1626 @Override
1627 public void setContinuationAccountNumber(String continuationAccountNumber) {
1628 this.continuationAccountNumber = continuationAccountNumber;
1629 }
1630
1631
1632
1633
1634 @Override
1635 public String getContinuationFinChrtOfAcctCd() {
1636 return continuationFinChrtOfAcctCd;
1637 }
1638
1639
1640
1641
1642 @Override
1643 public void setContinuationFinChrtOfAcctCd(String continuationFinChrtOfAcctCd) {
1644 this.continuationFinChrtOfAcctCd = continuationFinChrtOfAcctCd;
1645 }
1646
1647
1648
1649
1650 @Override
1651 public String getContractControlAccountNumber() {
1652 return contractControlAccountNumber;
1653 }
1654
1655
1656
1657
1658 @Override
1659 public void setContractControlAccountNumber(String contractControlAccountNumber) {
1660 this.contractControlAccountNumber = contractControlAccountNumber;
1661 }
1662
1663
1664
1665
1666 @Override
1667 public String getContractControlFinCoaCode() {
1668 return contractControlFinCoaCode;
1669 }
1670
1671
1672
1673
1674 @Override
1675 public void setContractControlFinCoaCode(String contractControlFinCoaCode) {
1676 this.contractControlFinCoaCode = contractControlFinCoaCode;
1677 }
1678
1679
1680
1681
1682 @Override
1683 public String getEndowmentIncomeAccountNumber() {
1684 return endowmentIncomeAccountNumber;
1685 }
1686
1687
1688
1689
1690 @Override
1691 public void setEndowmentIncomeAccountNumber(String endowmentIncomeAccountNumber) {
1692 this.endowmentIncomeAccountNumber = endowmentIncomeAccountNumber;
1693 }
1694
1695
1696
1697
1698 @Override
1699 public String getEndowmentIncomeAcctFinCoaCd() {
1700 return endowmentIncomeAcctFinCoaCd;
1701 }
1702
1703
1704
1705
1706 @Override
1707 public void setEndowmentIncomeAcctFinCoaCd(String endowmentIncomeAcctFinCoaCd) {
1708 this.endowmentIncomeAcctFinCoaCd = endowmentIncomeAcctFinCoaCd;
1709 }
1710
1711
1712
1713
1714 @Override
1715 public String getFinancialHigherEdFunctionCd() {
1716 return financialHigherEdFunctionCd;
1717 }
1718
1719
1720
1721
1722 @Override
1723 public void setFinancialHigherEdFunctionCd(String financialHigherEdFunctionCd) {
1724 this.financialHigherEdFunctionCd = financialHigherEdFunctionCd;
1725 }
1726
1727
1728
1729
1730 @Override
1731 public String getIncomeStreamAccountNumber() {
1732 return incomeStreamAccountNumber;
1733 }
1734
1735
1736
1737
1738 @Override
1739 public void setIncomeStreamAccountNumber(String incomeStreamAccountNumber) {
1740 this.incomeStreamAccountNumber = incomeStreamAccountNumber;
1741 }
1742
1743
1744
1745
1746 @Override
1747 public String getIncomeStreamFinancialCoaCode() {
1748 return incomeStreamFinancialCoaCode;
1749 }
1750
1751
1752
1753
1754 @Override
1755 public void setIncomeStreamFinancialCoaCode(String incomeStreamFinancialCoaCode) {
1756 this.incomeStreamFinancialCoaCode = incomeStreamFinancialCoaCode;
1757 }
1758
1759
1760
1761
1762 @Override
1763 public String getOrganizationCode() {
1764 return organizationCode;
1765 }
1766
1767
1768
1769
1770 @Override
1771 public void setOrganizationCode(String organizationCode) {
1772 this.organizationCode = organizationCode;
1773 }
1774
1775
1776
1777
1778 @Override
1779 public String getReportsToAccountNumber() {
1780 return reportsToAccountNumber;
1781 }
1782
1783
1784
1785
1786 @Override
1787 public void setReportsToAccountNumber(String reportsToAccountNumber) {
1788 this.reportsToAccountNumber = reportsToAccountNumber;
1789 }
1790
1791
1792
1793
1794 @Override
1795 public String getReportsToChartOfAccountsCode() {
1796 return reportsToChartOfAccountsCode;
1797 }
1798
1799
1800
1801
1802 @Override
1803 public void setReportsToChartOfAccountsCode(String reportsToChartOfAccountsCode) {
1804 this.reportsToChartOfAccountsCode = reportsToChartOfAccountsCode;
1805 }
1806
1807
1808
1809
1810 @Override
1811 public String getSubFundGroupCode() {
1812 return subFundGroupCode;
1813 }
1814
1815
1816
1817
1818 @Override
1819 public void setSubFundGroupCode(String subFundGroupCode) {
1820 this.subFundGroupCode = subFundGroupCode;
1821 forContractsAndGrants = null;
1822 }
1823
1824
1825
1826
1827
1828
1829 @Override
1830 public PostalCodeEbo getPostalZipCode() {
1831 if ( StringUtils.isBlank(accountZipCode) || StringUtils.isBlank( accountCountryCode ) ) {
1832 postalZipCode = null;
1833 } else {
1834 if ( postalZipCode == null || !StringUtils.equals( postalZipCode.getCode(),accountZipCode)
1835 || !StringUtils.equals(postalZipCode.getCountryCode(), accountCountryCode ) ) {
1836 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(PostalCodeEbo.class);
1837 if ( moduleService != null ) {
1838 Map<String,Object> keys = new HashMap<String, Object>(2);
1839 keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, accountCountryCode);
1840 keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountZipCode);
1841 postalZipCode = moduleService.getExternalizableBusinessObject(PostalCodeEbo.class, keys);
1842 } else {
1843 throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
1844 }
1845 }
1846 }
1847 return postalZipCode;
1848 }
1849
1850
1851
1852
1853
1854
1855 @Override
1856 public void setPostalZipCode(PostalCodeEbo postalZipCode) {
1857 this.postalZipCode = postalZipCode;
1858 }
1859
1860
1861
1862
1863
1864
1865 @Override
1866 public BudgetRecordingLevel getBudgetRecordingLevel() {
1867 return budgetRecordingLevel;
1868 }
1869
1870
1871
1872
1873
1874
1875 @Override
1876 public void setBudgetRecordingLevel(BudgetRecordingLevel budgetRecordingLevel) {
1877 this.budgetRecordingLevel = budgetRecordingLevel;
1878 }
1879
1880
1881
1882
1883
1884
1885 @Override
1886 public SufficientFundsCode getSufficientFundsCode() {
1887 return sufficientFundsCode;
1888 }
1889
1890
1891
1892
1893
1894
1895 @Override
1896 public void setSufficientFundsCode(SufficientFundsCode sufficientFundsCode) {
1897 this.sufficientFundsCode = sufficientFundsCode;
1898 }
1899
1900
1901
1902
1903
1904
1905 public IndirectCostRecoveryType getAcctIndirectCostRcvyType() {
1906 return acctIndirectCostRcvyType;
1907 }
1908
1909
1910
1911
1912
1913
1914 public void setAcctIndirectCostRcvyType(IndirectCostRecoveryType acctIndirectCostRcvyType) {
1915 this.acctIndirectCostRcvyType = acctIndirectCostRcvyType;
1916 }
1917
1918
1919
1920
1921
1922
1923 @Override
1924 public boolean equals(Object obj) {
1925 boolean equal = false;
1926
1927 if (obj != null) {
1928 if (this.getClass().equals(obj.getClass())) {
1929 Account other = (Account) obj;
1930
1931 if (StringUtils.equals(this.getChartOfAccountsCode(), other.getChartOfAccountsCode())) {
1932 if (StringUtils.equals(this.getAccountNumber(), other.getAccountNumber())) {
1933 equal = true;
1934 }
1935 }
1936 }
1937 }
1938
1939 return equal;
1940 }
1941
1942
1943
1944
1945
1946
1947
1948
1949 @Override
1950 public int hashCode() {
1951 String hashString = getChartOfAccountsCode() + "|" + getAccountNumber();
1952
1953 return hashString.hashCode();
1954 }
1955
1956
1957
1958
1959
1960
1961
1962
1963 @Override
1964 public String getAccountKey() {
1965 String key = getChartOfAccountsCode() + ":" + getAccountNumber();
1966 return key;
1967 }
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980 @Override
1981 public String getAccountResponsibilitySection() {
1982 return accountResponsibilitySection;
1983 }
1984
1985
1986
1987
1988
1989
1990 @Override
1991 public void setAccountResponsibilitySection(String accountResponsibilitySection) {
1992 this.accountResponsibilitySection = accountResponsibilitySection;
1993 }
1994
1995
1996
1997
1998
1999
2000 @Override
2001 public String getContractsAndGrantsSection() {
2002 return contractsAndGrantsSection;
2003 }
2004
2005
2006
2007
2008
2009
2010 @Override
2011 public void setContractsAndGrantsSection(String contractsAndGrantsSection) {
2012 this.contractsAndGrantsSection = contractsAndGrantsSection;
2013 }
2014
2015
2016
2017
2018
2019
2020 @Override
2021 public String getAccountDescriptionSection() {
2022 return accountDescriptionSection;
2023 }
2024
2025
2026
2027
2028
2029
2030 @Override
2031 public void setAccountDescriptionSection(String accountDescriptionSection) {
2032 this.accountDescriptionSection = accountDescriptionSection;
2033 }
2034
2035
2036
2037
2038
2039
2040 @Override
2041 public String getGuidelinesAndPurposeSection() {
2042 return guidelinesAndPurposeSection;
2043 }
2044
2045
2046
2047
2048
2049
2050 @Override
2051 public void setGuidelinesAndPurposeSection(String guidelinesAndPurposeSection) {
2052 this.guidelinesAndPurposeSection = guidelinesAndPurposeSection;
2053 }
2054
2055
2056
2057
2058
2059
2060 @Override
2061 public String getAccountResponsibilitySectionBlank() {
2062 return accountResponsibilitySectionBlank;
2063 }
2064
2065
2066
2067
2068
2069
2070 @Override
2071 public String getContractsAndGrantsSectionBlank() {
2072 return contractsAndGrantsSectionBlank;
2073 }
2074
2075
2076
2077
2078
2079
2080 @Override
2081 public String getAccountDescriptionSectionBlank() {
2082 return accountDescriptionSectionBlank;
2083 }
2084
2085
2086
2087
2088
2089
2090 @Override
2091 public String getGuidelinesAndPurposeSectionBlank() {
2092 return guidelinesAndPurposeSectionBlank;
2093 }
2094
2095
2096
2097
2098
2099
2100 public Chart getEndowmentIncomeChartOfAccounts() {
2101 return endowmentIncomeChartOfAccounts;
2102 }
2103
2104
2105
2106
2107
2108
2109 public void setEndowmentIncomeChartOfAccounts(Chart endowmentIncomeChartOfAccounts) {
2110 this.endowmentIncomeChartOfAccounts = endowmentIncomeChartOfAccounts;
2111 }
2112
2113 @Override protected void preUpdate() {
2114 super.preUpdate();
2115 try {
2116
2117
2118 BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
2119 Account originalAcct = (Account) boService.retrieve(this);
2120
2121 if (originalAcct != null) {
2122 if (!originalAcct.getSufficientFundsCode().equals(getSufficientFundsCode()) || originalAcct.isExtrnlFinEncumSufficntFndIndicator() != isExtrnlFinEncumSufficntFndIndicator() || originalAcct.isIntrnlFinEncumSufficntFndIndicator() != isIntrnlFinEncumSufficntFndIndicator() || originalAcct.isPendingAcctSufficientFundsIndicator() != isPendingAcctSufficientFundsIndicator() || originalAcct.isFinPreencumSufficientFundIndicator() != isFinPreencumSufficientFundIndicator()) {
2123 SufficientFundRebuild sfr = new SufficientFundRebuild();
2124 sfr.setAccountFinancialObjectTypeCode(SufficientFundRebuild.REBUILD_ACCOUNT);
2125 sfr.setChartOfAccountsCode(getChartOfAccountsCode());
2126 sfr.setAccountNumberFinancialObjectCode(getAccountNumber());
2127 if (boService.retrieve(sfr) == null) {
2128 boService.save(sfr);
2129 }
2130 }
2131 }
2132 }
2133 catch (Exception ex) {
2134 LOG.error("Problem updating sufficient funds rebuild table: ", ex);
2135 }
2136 }
2137
2138
2139
2140
2141
2142
2143 @Override
2144 public boolean isForContractsAndGrants() {
2145 if ( forContractsAndGrants == null ) {
2146 forContractsAndGrants = SpringContext.getBean(SubFundGroupService.class).isForContractsAndGrants(getSubFundGroup());
2147 }
2148 return forContractsAndGrants;
2149 }
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159 public boolean isAwardedByFederalAgency(List<String> federalAgencyTypeCodes) {
2160 return SpringContext.getBean(ContractsAndGrantsModuleService.class).isAwardedByFederalAgency(getChartOfAccountsCode(), getAccountNumber(), federalAgencyTypeCodes);
2161 }
2162
2163
2164
2165
2166
2167
2168 public Integer getContractsAndGrantsAccountResponsibilityId() {
2169 return contractsAndGrantsAccountResponsibilityId;
2170 }
2171
2172
2173
2174
2175
2176
2177 public void setContractsAndGrantsAccountResponsibilityId(Integer contractsAndGrantsAccountResponsibilityId) {
2178 this.contractsAndGrantsAccountResponsibilityId = contractsAndGrantsAccountResponsibilityId;
2179 }
2180
2181
2182
2183
2184
2185 public String getLaborBenefitRateCategoryCode() {
2186
2187 if(laborBenefitRateCategoryCode != null) {
2188 return laborBenefitRateCategoryCode;
2189 }
2190 return OLEConstants.Account.LABOR_BENEFIT_RATE_CATEGORY_CODE;
2191 }
2192
2193
2194
2195
2196
2197 public void setLaborBenefitRateCategoryCode(String laborBenefitRateCategoryCode) {
2198 this.laborBenefitRateCategoryCode = laborBenefitRateCategoryCode;
2199 }
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224 public Chart getFringeBenefitsChartOfAccount() {
2225 return fringeBenefitsChartOfAccount;
2226 }
2227
2228
2229
2230
2231
2232
2233 public void setFringeBenefitsChartOfAccount(Chart fringeBenefitsChartOfAccount) {
2234 this.fringeBenefitsChartOfAccount = fringeBenefitsChartOfAccount;
2235 }
2236
2237
2238
2239
2240
2241
2242 public Chart getContinuationChartOfAccount() {
2243 return continuationChartOfAccount;
2244 }
2245
2246
2247
2248
2249
2250
2251 public void setContinuationChartOfAccount(Chart continuationChartOfAccount) {
2252 this.continuationChartOfAccount = continuationChartOfAccount;
2253 }
2254
2255
2256
2257
2258
2259
2260 public Chart getIncomeStreamChartOfAccounts() {
2261 return incomeStreamChartOfAccounts;
2262 }
2263
2264
2265
2266
2267
2268
2269 public void setIncomeStreamChartOfAccounts(Chart incomeStreamChartOfAccounts) {
2270 this.incomeStreamChartOfAccounts = incomeStreamChartOfAccounts;
2271 }
2272
2273
2274
2275
2276
2277
2278 public Chart getContractControlChartOfAccounts() {
2279 return contractControlChartOfAccounts;
2280 }
2281
2282
2283
2284
2285
2286
2287 public void setContractControlChartOfAccounts(Chart contractControlChartOfAccounts) {
2288 this.contractControlChartOfAccounts = contractControlChartOfAccounts;
2289 }
2290
2291 public KualiDecimal getThresholdPercentage() {
2292 return thresholdPercentage;
2293 }
2294
2295 public void setThresholdPercentage(KualiDecimal thresholdPercentage) {
2296 this.thresholdPercentage = thresholdPercentage;
2297 }
2298
2299 public KualiDecimal getThresholdAmount() {
2300 return thresholdAmount;
2301 }
2302
2303 public void setThresholdAmount(KualiDecimal thresholdAmount) {
2304 this.thresholdAmount = thresholdAmount;
2305 }
2306
2307
2308
2309
2310
2311
2312 @Override
2313 public List<Collection<PersistableBusinessObject>> buildListOfDeletionAwareLists() {
2314 List<Collection<PersistableBusinessObject>> managedLists = super.buildListOfDeletionAwareLists();
2315 managedLists.add( new ArrayList<PersistableBusinessObject>( getIndirectCostRecoveryAccounts() ));
2316 return managedLists;
2317 }
2318
2319 public String getAccountCountryCode() {
2320 return accountCountryCode;
2321 }
2322
2323 public void setAccountCountryCode(String accountCountryCode) {
2324 this.accountCountryCode = accountCountryCode;
2325 }
2326
2327
2328
2329
2330
2331
2332
2333 public String getLegacyFundCodeAsString() {
2334
2335
2336 StringBuilder sb = new StringBuilder();
2337
2338 boolean first = true;
2339 for (OleLegacyFundCode legacyFundCode : oleLegacyFundCodes) {
2340 if (!first) {
2341 sb.append(", ");
2342 }
2343 else {
2344 first = false;
2345 }
2346 sb.append(legacyFundCode.getLegacyFundCode().toString());
2347 }
2348
2349
2350 return sb.toString();
2351 }
2352
2353 }