View Javadoc
1   /*
2    * Copyright 2007 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.kuali.ole.coa.businessobject;
18  
19  import java.sql.Date;
20  import java.util.ArrayList;
21  import java.util.Collection;
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.kuali.ole.sys.OLEConstants;
28  import org.kuali.ole.sys.context.SpringContext;
29  import org.kuali.rice.kim.api.identity.Person;
30  import org.kuali.rice.krad.bo.DocumentHeader;
31  import org.kuali.rice.krad.bo.GlobalBusinessObject;
32  import org.kuali.rice.krad.bo.GlobalBusinessObjectDetail;
33  import org.kuali.rice.krad.bo.PersistableBusinessObject;
34  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
35  import org.kuali.rice.krad.service.BusinessObjectService;
36  import org.kuali.rice.krad.service.KualiModuleService;
37  import org.kuali.rice.krad.service.ModuleService;
38  import org.kuali.rice.krad.service.PersistenceStructureService;
39  import org.kuali.rice.location.api.LocationConstants;
40  import org.kuali.rice.location.framework.postalcode.PostalCodeEbo;
41  import org.kuali.rice.location.framework.state.StateEbo;
42  
43  /**
44   *
45   */
46  public class AccountGlobal extends PersistableBusinessObjectBase implements GlobalBusinessObject {
47  
48      protected String documentNumber;
49      protected String accountFiscalOfficerSystemIdentifier;
50      protected String accountsSupervisorySystemsIdentifier;
51      protected String accountManagerSystemIdentifier;
52      protected String chartOfAccountsCode;
53      protected String organizationCode;
54      protected String subFundGroupCode;
55      protected String accountCityName;
56      protected String accountStateCode;
57      protected String accountStreetAddress;
58      protected String accountZipCode;
59      protected Date accountExpirationDate;
60      protected String continuationFinChrtOfAcctCd;
61      protected String continuationAccountNumber;
62      protected String incomeStreamFinancialCoaCode;
63      protected String incomeStreamAccountNumber;
64      protected String accountCfdaNumber;
65      protected String financialHigherEdFunctionCd;
66      protected String accountSufficientFundsCode;
67      protected Boolean pendingAcctSufficientFundsIndicator;
68      protected String accountSearchCriteriaTxt;
69      protected List<AccountGlobalDetail> accountGlobalDetails;
70  
71      protected DocumentHeader financialDocument;
72      protected Person accountFiscalOfficerUser;
73      protected Person accountSupervisoryUser;
74      protected Person accountManagerUser;
75      protected Chart continuationFinChrtOfAcct;
76      protected Account continuationAccount;
77      protected Account incomeStreamAccount;
78      protected Chart incomeStreamFinancialCoa;
79      protected Chart chartOfAccounts;
80      protected Organization organization;
81      protected SubFundGroup subFundGroup;
82      protected StateEbo accountState;
83      protected HigherEducationFunction financialHigherEdFunction;
84      protected PostalCodeEbo postalZipCode;
85      protected SufficientFundsCode sufficientFundsCode;
86      //MSU Contribution OLEMI-8505 DTT-601 OLECNTRB-939
87      protected CFDA cfda;
88  
89      public CFDA getCfda() {
90          return cfda;
91      }
92  
93      public void setCfda(CFDA cfda) {
94          this.cfda = cfda;
95      }
96  
97      // added for the employee labor benefit calculation
98      private String laborBenefitRateCategoryCode;
99  //    private LaborBenefitRateCategory laborBenefitRateCategory;
100 
101     /**
102      * Default constructor.
103      */
104     public AccountGlobal() {
105         accountGlobalDetails = new ArrayList<AccountGlobalDetail>();
106     }
107 
108     /**
109      * @see org.kuali.rice.krad.document.GlobalBusinessObject#getGlobalChangesToDelete()
110      */
111     @Override
112     public List<PersistableBusinessObject> generateDeactivationsToPersist() {
113         return null;
114     }
115 
116     /**
117      * @see org.kuali.rice.krad.document.GlobalBusinessObject#applyGlobalChanges(org.kuali.rice.krad.bo.BusinessObject)
118      */
119     @Override
120     public List<PersistableBusinessObject> generateGlobalChangesToPersist() {
121 
122 
123         // the list of persist-ready BOs
124         List<PersistableBusinessObject> persistables = new ArrayList<PersistableBusinessObject>();
125 
126         // walk over each change detail record
127         for (AccountGlobalDetail detail : accountGlobalDetails) {
128 
129             // load the object by keys
130             Account account = SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(Account.class, detail.getPrimaryKeys());
131 
132             // if we got a valid account, do the processing
133             if (account != null) {
134 
135                 // NOTE that the list of fields that are updated may be a subset of the total
136                 // number of fields in this class. This is because the class may contain a superset
137                 // of the fields actually used in the Global Maintenance Document.
138 
139                 // FISCAL OFFICER
140                 if (StringUtils.isNotBlank(accountFiscalOfficerSystemIdentifier)) {
141                     account.setAccountFiscalOfficerSystemIdentifier(accountFiscalOfficerSystemIdentifier);
142                 }
143 
144                 // ACCOUNT SUPERVISOR
145                 if (StringUtils.isNotBlank(accountsSupervisorySystemsIdentifier)) {
146                     account.setAccountsSupervisorySystemsIdentifier(accountsSupervisorySystemsIdentifier);
147                 }
148 
149                 // ACCOUNT MANAGER
150                 if (StringUtils.isNotBlank(accountManagerSystemIdentifier)) {
151                     account.setAccountManagerSystemIdentifier(accountManagerSystemIdentifier);
152                 }
153 
154                 // ORGANIZATION CODE
155                 if (StringUtils.isNotBlank(organizationCode)) {
156                     account.setOrganizationCode(organizationCode);
157                 }
158 
159                 // SUB FUND GROUP CODE
160                 if (StringUtils.isNotBlank(subFundGroupCode)) {
161                     account.setSubFundGroupCode(subFundGroupCode);
162                 }
163 
164                 // CITY NAME
165                 if (StringUtils.isNotBlank(accountCityName)) {
166                     account.setAccountCityName(accountCityName);
167                 }
168 
169                 // STATE CODE
170                 if (StringUtils.isNotBlank(accountStateCode)) {
171                     account.setAccountStateCode(accountStateCode);
172                 }
173 
174                 // STREET ADDRESS
175                 if (StringUtils.isNotBlank(accountStreetAddress)) {
176                     account.setAccountStreetAddress(accountStreetAddress);
177                 }
178 
179                 // ZIP CODE
180                 if (StringUtils.isNotBlank(accountZipCode)) {
181                     account.setAccountZipCode(accountZipCode);
182                 }
183 
184                 // EXPIRATION DATE
185                 if (accountExpirationDate != null) {
186                     account.setAccountExpirationDate(new Date(accountExpirationDate.getTime()));
187                 }
188 
189                 // CONTINUATION CHART OF ACCOUNTS CODE
190                 if (StringUtils.isNotBlank(continuationFinChrtOfAcctCd)) {
191                     account.setContinuationFinChrtOfAcctCd(continuationFinChrtOfAcctCd);
192                 }
193 
194                 // CONTINUATION ACCOUNT NUMBER
195                 if (StringUtils.isNotBlank(continuationAccountNumber)) {
196                     account.setContinuationAccountNumber(continuationAccountNumber);
197                 }
198 
199                 // INCOME STREAM CHART OF ACCOUNTS CODE
200                 if (StringUtils.isNotBlank(incomeStreamFinancialCoaCode)) {
201                     account.setIncomeStreamFinancialCoaCode(incomeStreamFinancialCoaCode);
202                 }
203 
204                 // INCOME STREAM ACCOUNT NUMBER
205                 if (StringUtils.isNotBlank(incomeStreamAccountNumber)) {
206                     account.setIncomeStreamAccountNumber(incomeStreamAccountNumber);
207                 }
208 
209                 // CG CATL FED DOMESTIC ASSIST NBR
210                 if (StringUtils.isNotBlank(accountCfdaNumber)) {
211                     account.setAccountCfdaNumber(accountCfdaNumber);
212                 }
213 
214                 // FINANCIAL HIGHER ED FUNCTION CODE
215                 if (StringUtils.isNotBlank(financialHigherEdFunctionCd)) {
216                     account.setFinancialHigherEdFunctionCd(financialHigherEdFunctionCd);
217                 }
218 
219                 // SUFFICIENT FUNDS CODE
220                 if (StringUtils.isNotBlank(accountSufficientFundsCode)) {
221                     account.setAccountSufficientFundsCode(accountSufficientFundsCode);
222                 }
223 
224                 // LABOR BENEFIT RATE CATEGORY CODE
225                 if (StringUtils.isNotBlank(laborBenefitRateCategoryCode)) {
226                     account.setLaborBenefitRateCategoryCode(laborBenefitRateCategoryCode);
227                 }
228 
229                 // PENDING ACCOUNT SUFFICIENT FUNDS CODE INDICATOR
230                 if (pendingAcctSufficientFundsIndicator != null) {
231                     account.setPendingAcctSufficientFundsIndicator(pendingAcctSufficientFundsIndicator);
232                 }
233 
234                 // LABOR BENEFIT RATE CATEGORY CODE
235                 if (StringUtils.isNotBlank(laborBenefitRateCategoryCode)) {
236                     account.setLaborBenefitRateCategoryCode(laborBenefitRateCategoryCode);
237                 }
238 
239                 persistables.add(account);
240 
241             }
242         }
243 
244         return persistables;
245     }
246 
247     /**
248      * Gets the documentNumber attribute.
249      *
250      * @return Returns the documentNumber
251      */
252     @Override
253     public String getDocumentNumber() {
254         return documentNumber;
255     }
256 
257     /**
258      * Sets the documentNumber attribute.
259      *
260      * @param documentNumber The documentNumber to set.
261      */
262     @Override
263     public void setDocumentNumber(String documentNumber) {
264         this.documentNumber = documentNumber;
265     }
266 
267     /**
268      * Gets the chartOfAccountsCode attribute.
269      *
270      * @return Returns the chartOfAccountsCode.
271      */
272     public String getChartOfAccountsCode() {
273         return chartOfAccountsCode;
274     }
275 
276     /**
277      * Sets the chartOfAccountsCode attribute value.
278      *
279      * @param chartOfAccountsCode The chartOfAccountsCode to set.
280      */
281     public void setChartOfAccountsCode(String chartOfAccountsCode) {
282         this.chartOfAccountsCode = chartOfAccountsCode;
283     }
284 
285     /**
286      * Gets the organizationCode attribute.
287      *
288      * @return Returns the organizationCode
289      */
290     public String getOrganizationCode() {
291         return organizationCode;
292     }
293 
294     /**
295      * Sets the organizationCode attribute.
296      *
297      * @param organizationCode The organizationCode to set.
298      */
299     public void setOrganizationCode(String organizationCode) {
300         this.organizationCode = organizationCode;
301     }
302 
303     /**
304      * Gets the subFundGroupCode attribute.
305      *
306      * @return Returns the subFundGroupCode
307      */
308     public String getSubFundGroupCode() {
309         return subFundGroupCode;
310     }
311 
312     /**
313      * Sets the subFundGroupCode attribute.
314      *
315      * @param subFundGroupCode The subFundGroupCode to set.
316      */
317     public void setSubFundGroupCode(String subFundGroupCode) {
318         this.subFundGroupCode = subFundGroupCode;
319     }
320 
321     /**
322      * Gets the accountCityName attribute.
323      *
324      * @return Returns the accountCityName
325      */
326     public String getAccountCityName() {
327         return accountCityName;
328     }
329 
330     /**
331      * Sets the accountCityName attribute.
332      *
333      * @param accountCityName The accountCityName to set.
334      */
335     public void setAccountCityName(String accountCityName) {
336         this.accountCityName = accountCityName;
337     }
338 
339 
340     /**
341      * Gets the accountStateCode attribute.
342      *
343      * @return Returns the accountStateCode
344      */
345     public String getAccountStateCode() {
346         return accountStateCode;
347     }
348 
349     /**
350      * Sets the accountStateCode attribute.
351      *
352      * @param accountStateCode The accountStateCode to set.
353      */
354     public void setAccountStateCode(String accountStateCode) {
355         this.accountStateCode = accountStateCode;
356     }
357 
358 
359     /**
360      * Gets the accountStreetAddress attribute.
361      *
362      * @return Returns the accountStreetAddress
363      */
364     public String getAccountStreetAddress() {
365         return accountStreetAddress;
366     }
367 
368     /**
369      * Sets the accountStreetAddress attribute.
370      *
371      * @param accountStreetAddress The accountStreetAddress to set.
372      */
373     public void setAccountStreetAddress(String accountStreetAddress) {
374         this.accountStreetAddress = accountStreetAddress;
375     }
376 
377 
378     /**
379      * Gets the accountZipCode attribute.
380      *
381      * @return Returns the accountZipCode
382      */
383     public String getAccountZipCode() {
384         return accountZipCode;
385     }
386 
387     /**
388      * Sets the accountZipCode attribute.
389      *
390      * @param accountZipCode The accountZipCode to set.
391      */
392     public void setAccountZipCode(String accountZipCode) {
393         this.accountZipCode = accountZipCode;
394     }
395 
396     /**
397      * Gets the accountExpirationDate attribute.
398      *
399      * @return Returns the accountExpirationDate
400      */
401     public Date getAccountExpirationDate() {
402         return accountExpirationDate;
403     }
404 
405     /**
406      * Sets the accountExpirationDate attribute.
407      *
408      * @param accountExpirationDate The accountExpirationDate to set.
409      */
410     public void setAccountExpirationDate(Date accountExpirationDate) {
411         this.accountExpirationDate = accountExpirationDate;
412     }
413 
414 
415     /**
416      * Gets the continuationFinChrtOfAcctCd attribute.
417      *
418      * @return Returns the continuationFinChrtOfAcctCd
419      */
420     public String getContinuationFinChrtOfAcctCd() {
421         return continuationFinChrtOfAcctCd;
422     }
423 
424     /**
425      * Sets the continuationFinChrtOfAcctCd attribute.
426      *
427      * @param continuationFinChrtOfAcctCd The continuationFinChrtOfAcctCd to set.
428      */
429     public void setContinuationFinChrtOfAcctCd(String continuationFinChrtOfAcctCd) {
430         this.continuationFinChrtOfAcctCd = continuationFinChrtOfAcctCd;
431     }
432 
433 
434     /**
435      * Gets the continuationAccountNumber attribute.
436      *
437      * @return Returns the continuationAccountNumber
438      */
439     public String getContinuationAccountNumber() {
440         return continuationAccountNumber;
441     }
442 
443     /**
444      * Sets the continuationAccountNumber attribute.
445      *
446      * @param continuationAccountNumber The continuationAccountNumber to set.
447      */
448     public void setContinuationAccountNumber(String continuationAccountNumber) {
449         this.continuationAccountNumber = continuationAccountNumber;
450     }
451 
452     /**
453      * Gets the incomeStreamFinancialCoaCode attribute.
454      *
455      * @return Returns the incomeStreamFinancialCoaCode
456      */
457     public String getIncomeStreamFinancialCoaCode() {
458         return incomeStreamFinancialCoaCode;
459     }
460 
461     /**
462      * Sets the incomeStreamFinancialCoaCode attribute.
463      *
464      * @param incomeStreamFinancialCoaCode The incomeStreamFinancialCoaCode to set.
465      */
466     public void setIncomeStreamFinancialCoaCode(String incomeStreamFinancialCoaCode) {
467         this.incomeStreamFinancialCoaCode = incomeStreamFinancialCoaCode;
468     }
469 
470 
471     /**
472      * Gets the incomeStreamAccountNumber attribute.
473      *
474      * @return Returns the incomeStreamAccountNumber
475      */
476     public String getIncomeStreamAccountNumber() {
477         return incomeStreamAccountNumber;
478     }
479 
480     /**
481      * Sets the incomeStreamAccountNumber attribute.
482      *
483      * @param incomeStreamAccountNumber The incomeStreamAccountNumber to set.
484      */
485     public void setIncomeStreamAccountNumber(String incomeStreamAccountNumber) {
486         this.incomeStreamAccountNumber = incomeStreamAccountNumber;
487     }
488 
489     /**
490      * Gets the accountSufficientFundsCode attribute.
491      *
492      * @return Returns the accountSufficientFundsCode
493      */
494     public String getAccountSufficientFundsCode() {
495         return accountSufficientFundsCode;
496     }
497 
498     /**
499      * Sets the accountSufficientFundsCode attribute.
500      *
501      * @param accountSufficientFundsCode The accountSufficientFundsCode to set.
502      */
503     public void setAccountSufficientFundsCode(String accountSufficientFundsCode) {
504         this.accountSufficientFundsCode = accountSufficientFundsCode;
505     }
506 
507 
508     /**
509      * Gets the pendingAcctSufficientFundsIndicator attribute.
510      *
511      * @return Returns the pendingAcctSufficientFundsIndicator
512      */
513     public Boolean getPendingAcctSufficientFundsIndicator() {
514         return pendingAcctSufficientFundsIndicator;
515     }
516 
517 
518     /**
519      * Sets the pendingAcctSufficientFundsIndicator attribute.
520      *
521      * @param pendingAcctSufficientFundsIndicator The pendingAcctSufficientFundsIndicator to set.
522      */
523     public void setPendingAcctSufficientFundsIndicator(Boolean pendingAcctSufficientFundsIndicator) {
524         this.pendingAcctSufficientFundsIndicator = pendingAcctSufficientFundsIndicator;
525     }
526 
527     /**
528      * Gets the accountCfdaNumber attribute.
529      *
530      * @return Returns the accountCfdaNumber
531      */
532     public String getAccountCfdaNumber() {
533         return accountCfdaNumber;
534     }
535 
536     /**
537      * Sets the accountCfdaNumber attribute.
538      *
539      * @param accountCfdaNumber The accountCfdaNumber to set.
540      */
541     public void setAccountCfdaNumber(String accountCfdaNumber) {
542         this.accountCfdaNumber = accountCfdaNumber;
543     }
544 
545     /**
546      * Gets the accountSearchCriteriaTxt attribute.
547      *
548      * @return Returns the accountSearchCriteriaTxt
549      */
550     public String getAccountSearchCriteriaTxt() {
551         return accountSearchCriteriaTxt;
552     }
553 
554     /**
555      * Sets the accountSearchCriteriaTxt attribute.
556      *
557      * @param accountSearchCriteriaTxt The accountSearchCriteriaTxt to set.
558      */
559     public void setAccountSearchCriteriaTxt(String accountSearchCriteriaTxt) {
560         this.accountSearchCriteriaTxt = accountSearchCriteriaTxt;
561     }
562 
563 
564     /**
565      * Gets the financialDocument attribute.
566      *
567      * @return Returns the financialDocument
568      */
569     public DocumentHeader getFinancialDocument() {
570         return financialDocument;
571     }
572 
573     /**
574      * Sets the financialDocument attribute.
575      *
576      * @param financialDocument The financialDocument to set.
577      * @deprecated
578      */
579     @Deprecated
580     public void setFinancialDocument(DocumentHeader financialDocument) {
581         this.financialDocument = financialDocument;
582     }
583 
584     public Person getAccountFiscalOfficerUser() {
585         accountFiscalOfficerUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountFiscalOfficerSystemIdentifier, accountFiscalOfficerUser);
586         return accountFiscalOfficerUser;
587     }
588 
589 
590     /**
591      * @param accountFiscalOfficerUser The accountFiscalOfficerUser to set.
592      * @deprecated
593      */
594     @Deprecated
595     public void setAccountFiscalOfficerUser(Person accountFiscalOfficerUser) {
596         this.accountFiscalOfficerUser = accountFiscalOfficerUser;
597     }
598 
599     public Person getAccountManagerUser() {
600         accountManagerUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountManagerSystemIdentifier, accountManagerUser);
601         return accountManagerUser;
602     }
603 
604     /**
605      * @param accountManagerUser The accountManagerUser to set.
606      * @deprecated
607      */
608     @Deprecated
609     public void setAccountManagerUser(Person accountManagerUser) {
610         this.accountManagerUser = accountManagerUser;
611     }
612 
613 
614     public Person getAccountSupervisoryUser() {
615         accountSupervisoryUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountsSupervisorySystemsIdentifier, accountSupervisoryUser);
616         return accountSupervisoryUser;
617     }
618 
619 
620     /**
621      * @param accountSupervisoryUser The accountSupervisoryUser to set.
622      * @deprecated
623      */
624     @Deprecated
625     public void setAccountSupervisoryUser(Person accountSupervisoryUser) {
626         this.accountSupervisoryUser = accountSupervisoryUser;
627     }
628 
629     /**
630      * Gets the continuationFinChrtOfAcct attribute.
631      *
632      * @return Returns the continuationFinChrtOfAcct
633      */
634     public Chart getContinuationFinChrtOfAcct() {
635         return continuationFinChrtOfAcct;
636     }
637 
638     /**
639      * Sets the continuationFinChrtOfAcct attribute.
640      *
641      * @param continuationFinChrtOfAcct The continuationFinChrtOfAcct to set.
642      * @deprecated
643      */
644     @Deprecated
645     public void setContinuationFinChrtOfAcct(Chart continuationFinChrtOfAcct) {
646         this.continuationFinChrtOfAcct = continuationFinChrtOfAcct;
647     }
648 
649     /**
650      * Gets the continuationAccount attribute.
651      *
652      * @return Returns the continuationAccount
653      */
654     public Account getContinuationAccount() {
655         return continuationAccount;
656     }
657 
658     /**
659      * Sets the continuationAccount attribute.
660      *
661      * @param continuationAccount The continuationAccount to set.
662      * @deprecated
663      */
664     @Deprecated
665     public void setContinuationAccount(Account continuationAccount) {
666         this.continuationAccount = continuationAccount;
667     }
668 
669     /**
670      * Gets the incomeStreamAccount attribute.
671      *
672      * @return Returns the incomeStreamAccount
673      */
674     public Account getIncomeStreamAccount() {
675         return incomeStreamAccount;
676     }
677 
678     /**
679      * Sets the incomeStreamAccount attribute.
680      *
681      * @param incomeStreamAccount The incomeStreamAccount to set.
682      * @deprecated
683      */
684     @Deprecated
685     public void setIncomeStreamAccount(Account incomeStreamAccount) {
686         this.incomeStreamAccount = incomeStreamAccount;
687     }
688 
689     /**
690      * Gets the incomeStreamFinancialCoa attribute.
691      *
692      * @return Returns the incomeStreamFinancialCoa
693      */
694     public Chart getIncomeStreamFinancialCoa() {
695         return incomeStreamFinancialCoa;
696     }
697 
698     /**
699      * Sets the incomeStreamFinancialCoa attribute.
700      *
701      * @param incomeStreamFinancialCoa The incomeStreamFinancialCoa to set.
702      * @deprecated
703      */
704     @Deprecated
705     public void setIncomeStreamFinancialCoa(Chart incomeStreamFinancialCoa) {
706         this.incomeStreamFinancialCoa = incomeStreamFinancialCoa;
707     }
708 
709     /**
710      * @return Returns the accountGlobalDetail.
711      */
712     public List<AccountGlobalDetail> getAccountGlobalDetails() {
713         return accountGlobalDetails;
714     }
715 
716     /**
717      * @param accountGlobalDetail The accountGlobalDetail to set.
718      */
719     public void setAccountGlobalDetails(List<AccountGlobalDetail> accountGlobalDetails) {
720         this.accountGlobalDetails = accountGlobalDetails;
721     }
722 
723     /**
724      * Gets the financialHigherEdFunctionCd attribute.
725      *
726      * @return Returns the financialHigherEdFunctionCd.
727      */
728     public String getFinancialHigherEdFunctionCd() {
729         return financialHigherEdFunctionCd;
730     }
731 
732     /**
733      * Sets the financialHigherEdFunctionCd attribute value.
734      *
735      * @param financialHigherEdFunctionCd The financialHigherEdFunctionCd to set.
736      */
737     public void setFinancialHigherEdFunctionCd(String financialHigherEdFunctionCd) {
738         this.financialHigherEdFunctionCd = financialHigherEdFunctionCd;
739     }
740 
741     /**
742      * Gets the accountFiscalOfficerSystemIdentifier attribute.
743      *
744      * @return Returns the accountFiscalOfficerSystemIdentifier.
745      */
746     public String getAccountFiscalOfficerSystemIdentifier() {
747         return accountFiscalOfficerSystemIdentifier;
748     }
749 
750     /**
751      * Sets the accountFiscalOfficerSystemIdentifier attribute value.
752      *
753      * @param accountFiscalOfficerSystemIdentifier The accountFiscalOfficerSystemIdentifier to set.
754      */
755     public void setAccountFiscalOfficerSystemIdentifier(String accountFiscalOfficerSystemIdentifier) {
756         this.accountFiscalOfficerSystemIdentifier = accountFiscalOfficerSystemIdentifier;
757     }
758 
759     /**
760      * Gets the accountManagerSystemIdentifier attribute.
761      *
762      * @return Returns the accountManagerSystemIdentifier.
763      */
764     public String getAccountManagerSystemIdentifier() {
765         return accountManagerSystemIdentifier;
766     }
767 
768     /**
769      * Sets the accountManagerSystemIdentifier attribute value.
770      *
771      * @param accountManagerSystemIdentifier The accountManagerSystemIdentifier to set.
772      */
773     public void setAccountManagerSystemIdentifier(String accountManagerSystemIdentifier) {
774         this.accountManagerSystemIdentifier = accountManagerSystemIdentifier;
775     }
776 
777     /**
778      * Gets the accountsSupervisorySystemsIdentifier attribute.
779      *
780      * @return Returns the accountsSupervisorySystemsIdentifier.
781      */
782     public String getAccountsSupervisorySystemsIdentifier() {
783         return accountsSupervisorySystemsIdentifier;
784     }
785 
786     /**
787      * Sets the accountsSupervisorySystemsIdentifier attribute value.
788      *
789      * @param accountsSupervisorySystemsIdentifier The accountsSupervisorySystemsIdentifier to set.
790      */
791     public void setAccountsSupervisorySystemsIdentifier(String accountsSupervisorySystemsIdentifier) {
792         this.accountsSupervisorySystemsIdentifier = accountsSupervisorySystemsIdentifier;
793     }
794 
795     /**
796      * Gets the chartOfAccounts attribute.
797      *
798      * @return Returns the chartOfAccounts.
799      */
800     public Chart getChartOfAccounts() {
801         return chartOfAccounts;
802     }
803 
804     /**
805      * Sets the chartOfAccounts attribute value.
806      *
807      * @param chartOfAccounts The chartOfAccounts to set.
808      * @deprecated
809      */
810     @Deprecated
811     public void setChartOfAccounts(Chart chartOfAccounts) {
812         this.chartOfAccounts = chartOfAccounts;
813     }
814 
815     /**
816      * Gets the accountState attribute.
817      *
818      * @return Returns the accountState.
819      */
820     public StateEbo getAccountState() {
821         if ( StringUtils.isBlank(accountStateCode) || StringUtils.isBlank(OLEConstants.COUNTRY_CODE_UNITED_STATES ) ) {
822             accountState = null;
823         } else {
824             if ( accountState == null || !StringUtils.equals( accountState.getCode(),accountStateCode) || !StringUtils.equals(accountState.getCountryCode(), OLEConstants.COUNTRY_CODE_UNITED_STATES ) ) {
825                 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(StateEbo.class);
826                 if ( moduleService != null ) {
827                     Map<String,Object> keys = new HashMap<String, Object>(2);
828                     keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, OLEConstants.COUNTRY_CODE_UNITED_STATES);/*RICE20_REFACTORME*/
829                     keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountStateCode);
830                     accountState = moduleService.getExternalizableBusinessObject(StateEbo.class, keys);
831                 } else {
832                     throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed." );
833                 }
834             }
835         }
836         return accountState;
837     }
838 
839     /**
840      * Sets the accountState attribute value.
841      *
842      * @param accountState The accountState to set.
843      */
844     public void setAccountState(StateEbo accountState) {
845         this.accountState = accountState;
846     }
847 
848     /**
849      * Gets the financialHigherEdFunction attribute.
850      *
851      * @return Returns the financialHigherEdFunction.
852      */
853     public HigherEducationFunction getFinancialHigherEdFunction() {
854         return financialHigherEdFunction;
855     }
856 
857     /**
858      * Sets the financialHigherEdFunction attribute value.
859      *
860      * @param financialHigherEdFunction The financialHigherEdFunction to set.
861      */
862     public void setFinancialHigherEdFunction(HigherEducationFunction financialHigherEdFunction) {
863         this.financialHigherEdFunction = financialHigherEdFunction;
864     }
865 
866     /**
867      * Gets the organization attribute.
868      *
869      * @return Returns the organization.
870      */
871     public Organization getOrganization() {
872         return organization;
873     }
874 
875     /**
876      * Sets the organization attribute value.
877      *
878      * @param organization The organization to set.
879      */
880     public void setOrganization(Organization organization) {
881         this.organization = organization;
882     }
883 
884     /**
885      * Gets the postalZipCode attribute.
886      *
887      * @return Returns the postalZipCode.
888      */
889     public PostalCodeEbo getPostalZipCode() {
890         if ( StringUtils.isBlank(accountZipCode) || StringUtils.isBlank(OLEConstants.COUNTRY_CODE_UNITED_STATES ) ) {
891             postalZipCode = null;
892         } else {
893             if ( postalZipCode == null || !StringUtils.equals( postalZipCode.getCode(),accountZipCode) || !StringUtils.equals(postalZipCode.getCountryCode(), OLEConstants.COUNTRY_CODE_UNITED_STATES ) ) {
894                 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(PostalCodeEbo.class);
895                 if ( moduleService != null ) {
896                     Map<String,Object> keys = new HashMap<String, Object>(2);
897                     keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, OLEConstants.COUNTRY_CODE_UNITED_STATES);/*RICE20_REFACTORME*/
898                     keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountZipCode);
899                     postalZipCode = moduleService.getExternalizableBusinessObject(PostalCodeEbo.class, keys);
900                 } else {
901                     throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed." );
902                 }
903             }
904         }
905         return postalZipCode;
906     }
907 
908     /**
909      * Sets the postalZipCode attribute value.
910      *
911      * @param postalZipCode The postalZipCode to set.
912      */
913     public void setPostalZipCode(PostalCodeEbo postalZipCode) {
914         this.postalZipCode = postalZipCode;
915     }
916 
917     /**
918      * Gets the subFundGroup attribute.
919      *
920      * @return Returns the subFundGroup.
921      */
922     public SubFundGroup getSubFundGroup() {
923         return subFundGroup;
924     }
925 
926     /**
927      * Sets the subFundGroup attribute value.
928      *
929      * @param subFundGroup The subFundGroup to set.
930      */
931     public void setSubFundGroup(SubFundGroup subFundGroup) {
932         this.subFundGroup = subFundGroup;
933     }
934 
935     /**
936      * Gets the sufficientFundsCode attribute.
937      *
938      * @return Returns the sufficientFundsCode.
939      */
940     public final SufficientFundsCode getSufficientFundsCode() {
941         return sufficientFundsCode;
942     }
943 
944     /**
945      * Sets the sufficientFundsCode attribute value.
946      *
947      * @param sufficientFundsCode The sufficientFundsCode to set.
948      */
949     public final void setSufficientFundsCode(SufficientFundsCode sufficientFundsCode) {
950         this.sufficientFundsCode = sufficientFundsCode;
951     }
952 
953     /**
954      * @see org.kuali.rice.krad.document.GlobalBusinessObject#isPersistable()
955      */
956     @Override
957     public boolean isPersistable() {
958         PersistenceStructureService persistenceStructureService = SpringContext.getBean(PersistenceStructureService.class);
959 
960         // fail if the PK for this object is emtpy
961         if (StringUtils.isBlank(documentNumber)) {
962             return false;
963         }
964 
965         // fail if the PKs for any of the contained objects are empty
966         for (AccountGlobalDetail account : getAccountGlobalDetails()) {
967             if (!persistenceStructureService.hasPrimaryKeyFieldValues(account)) {
968                 return false;
969             }
970         }
971 
972         // otherwise, its all good
973         return true;
974     }
975 
976     @Override
977     public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects() {
978         return accountGlobalDetails;
979     }
980 
981     /**
982      * @see org.kuali.rice.krad.bo.PersistableBusinessObjectBase#buildListOfDeletionAwareLists()
983      */
984     @Override
985     public List<Collection<PersistableBusinessObject>> buildListOfDeletionAwareLists() {
986         List<Collection<PersistableBusinessObject>> managedLists = super.buildListOfDeletionAwareLists();
987 
988         managedLists.add( new ArrayList<PersistableBusinessObject>( getAccountGlobalDetails() ) );
989 
990         return managedLists;
991     }
992 
993     /**
994      * Gets the laborBenefitRateCategoryCode attribute.
995      *
996      * @return Returns the laborBenefitRateCategoryCode.
997      */
998     public String getLaborBenefitRateCategoryCode() {
999         return laborBenefitRateCategoryCode;
1000     }
1001 
1002     /**
1003      * Sets the laborBenefitRateCategoryCode attribute value.
1004      *
1005      * @param laborBenefitRateCategoryCode The laborBenefitRateCategoryCode to set.
1006      */
1007     public void setLaborBenefitRateCategoryCode(String laborBenefitRateCategoryCode) {
1008         this.laborBenefitRateCategoryCode = laborBenefitRateCategoryCode;
1009     }
1010 
1011 
1012 //    /**
1013 //     * Sets the laborBenefitRateCategory attribute value.
1014 //     *
1015 //     * @param laborBenefitRateCategory The laborBenefitRateCategory to set.
1016 //     */
1017 //    public void setLaborBenefitRateCategory(LaborBenefitRateCategory laborBenefitRateCategory) {
1018 //        this.laborBenefitRateCategory = laborBenefitRateCategory;
1019 //    }
1020 //
1021 //    /**
1022 //     * Gets the laborBenefitRateCategory attribute.
1023 //     *
1024 //     * @return Returns the laborBenefitRateCategory.
1025 //     */
1026 //    public LaborBenefitRateCategory getLaborBenefitRateCategory() {
1027 //         laborBenefitRateCategory = (LaborBenefitRateCategory) SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(LaborBenefitRateCategory.class).retrieveExternalizableBusinessObjectsList(this, "LaborBenefitRateCategory", LaborBenefitRateCategory.class);
1028 //         return laborBenefitRateCategory;
1029 //    }
1030 }