View Javadoc
1   /*
2    * Copyright 2006 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.HashMap;
21  import java.util.Map;
22  
23  import org.apache.commons.lang.StringUtils;
24  import org.kuali.ole.sys.context.SpringContext;
25  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
26  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
27  import org.kuali.rice.krad.service.KualiModuleService;
28  import org.kuali.rice.krad.service.ModuleService;
29  import org.kuali.rice.location.api.LocationConstants;
30  import org.kuali.rice.location.framework.campus.CampusEbo;
31  import org.kuali.rice.location.framework.country.CountryEbo;
32  
33  /**
34   * 
35   */
36  public class PriorYearOrganization extends PersistableBusinessObjectBase implements MutableInactivatable {
37  
38      protected String chartOfAccountsCode;
39      protected String organizationCode;
40      protected String organizationManagerUniversalId;
41      protected String organizationName;
42      protected String responsibilityCenterCode;
43      protected String organizationPhysicalCampusCode;
44      protected String organizationTypeCode;
45      protected String organizationDefaultAccountNumber;
46      protected String organizationCityName;
47      protected String organizationStateCode;
48      protected String organizationZipCode;
49      protected Date organizationBeginDate;
50      protected Date organizationEndDate;
51      protected String reportsToChartOfAccountsCode;
52      protected String reportsToOrganizationCode;
53      protected boolean active;
54      protected boolean organizationInFinancialProcessingIndicator;
55      protected String organizationPlantAccountNumber;
56      protected String campusPlantAccountNumber;
57      protected String organizationPlantChartCode;
58      protected String campusPlantChartCode;
59      protected String organizationCountryCode;
60      protected String organizationLine1Address;
61      protected String organizationLine2Address;
62  
63      protected Chart chartOfAccounts;
64      protected Account organizationDefaultAccount;
65      protected Organization organization;
66      protected CampusEbo organizationPhysicalCampus;
67      protected Organization reportsToOrganization;
68      protected Chart reportsToChartOfAccounts;
69      protected Account organizationPlantAccount;
70      protected Account campusPlantAccount;
71      protected Chart organizationPlantChart;
72      protected Chart campusPlantChart;
73      protected CountryEbo organizationCountry;
74  
75      /**
76       * Default constructor.
77       */
78      public PriorYearOrganization() {
79  
80      }
81  
82      /**
83       * Gets the chartOfAccountsCode attribute.
84       * 
85       * @return Returns the chartOfAccountsCode
86       */
87      public String getChartOfAccountsCode() {
88          return chartOfAccountsCode;
89      }
90  
91      /**
92       * Sets the chartOfAccountsCode attribute.
93       * 
94       * @param chartOfAccountsCode The chartOfAccountsCode to set.
95       */
96      public void setChartOfAccountsCode(String chartOfAccountsCode) {
97          this.chartOfAccountsCode = chartOfAccountsCode;
98      }
99  
100 
101     /**
102      * Gets the organizationCode attribute.
103      * 
104      * @return Returns the organizationCode
105      */
106     public String getOrganizationCode() {
107         return organizationCode;
108     }
109 
110     /**
111      * Sets the organizationCode attribute.
112      * 
113      * @param organizationCode The organizationCode to set.
114      */
115     public void setOrganizationCode(String organizationCode) {
116         this.organizationCode = organizationCode;
117     }
118 
119 
120     /**
121      * Gets the organizationManagerUniversalId attribute.
122      * 
123      * @return Returns the organizationManagerUniversalId
124      */
125     public String getOrganizationManagerUniversalId() {
126         return organizationManagerUniversalId;
127     }
128 
129     /**
130      * Sets the organizationManagerUniversalId attribute.
131      * 
132      * @param organizationManagerUniversalId The organizationManagerUniversalId to set.
133      */
134     public void setOrganizationManagerUniversalId(String organizationManagerUniversalId) {
135         this.organizationManagerUniversalId = organizationManagerUniversalId;
136     }
137 
138 
139     /**
140      * Gets the organizationName attribute.
141      * 
142      * @return Returns the organizationName
143      */
144     public String getOrganizationName() {
145         return organizationName;
146     }
147 
148     /**
149      * Sets the organizationName attribute.
150      * 
151      * @param organizationName The organizationName to set.
152      */
153     public void setOrganizationName(String organizationName) {
154         this.organizationName = organizationName;
155     }
156 
157 
158     /**
159      * Gets the responsibilityCenterCode attribute.
160      * 
161      * @return Returns the responsibilityCenterCode
162      */
163     public String getResponsibilityCenterCode() {
164         return responsibilityCenterCode;
165     }
166 
167     /**
168      * Sets the responsibilityCenterCode attribute.
169      * 
170      * @param responsibilityCenterCode The responsibilityCenterCode to set.
171      */
172     public void setResponsibilityCenterCode(String responsibilityCenterCode) {
173         this.responsibilityCenterCode = responsibilityCenterCode;
174     }
175 
176 
177     /**
178      * Gets the organizationPhysicalCampusCode attribute.
179      * 
180      * @return Returns the organizationPhysicalCampusCode
181      */
182     public String getOrganizationPhysicalCampusCode() {
183         return organizationPhysicalCampusCode;
184     }
185 
186     /**
187      * Sets the organizationPhysicalCampusCode attribute.
188      * 
189      * @param organizationPhysicalCampusCode The organizationPhysicalCampusCode to set.
190      */
191     public void setOrganizationPhysicalCampusCode(String organizationPhysicalCampusCode) {
192         this.organizationPhysicalCampusCode = organizationPhysicalCampusCode;
193     }
194 
195 
196     /**
197      * Gets the organizationTypeCode attribute.
198      * 
199      * @return Returns the organizationTypeCode
200      */
201     public String getOrganizationTypeCode() {
202         return organizationTypeCode;
203     }
204 
205     /**
206      * Sets the organizationTypeCode attribute.
207      * 
208      * @param organizationTypeCode The organizationTypeCode to set.
209      */
210     public void setOrganizationTypeCode(String organizationTypeCode) {
211         this.organizationTypeCode = organizationTypeCode;
212     }
213 
214 
215     /**
216      * Gets the organizationDefaultAccountNumber attribute.
217      * 
218      * @return Returns the organizationDefaultAccountNumber
219      */
220     public String getOrganizationDefaultAccountNumber() {
221         return organizationDefaultAccountNumber;
222     }
223 
224     /**
225      * Sets the organizationDefaultAccountNumber attribute.
226      * 
227      * @param organizationDefaultAccountNumber The organizationDefaultAccountNumber to set.
228      */
229     public void setOrganizationDefaultAccountNumber(String organizationDefaultAccountNumber) {
230         this.organizationDefaultAccountNumber = organizationDefaultAccountNumber;
231     }
232 
233     /**
234      * Gets the organizationCityName attribute.
235      * 
236      * @return Returns the organizationCityName
237      */
238     public String getOrganizationCityName() {
239         return organizationCityName;
240     }
241 
242     /**
243      * Sets the organizationCityName attribute.
244      * 
245      * @param organizationCityName The organizationCityName to set.
246      */
247     public void setOrganizationCityName(String organizationCityName) {
248         this.organizationCityName = organizationCityName;
249     }
250 
251 
252     /**
253      * Gets the organizationStateCode attribute.
254      * 
255      * @return Returns the organizationStateCode
256      */
257     public String getOrganizationStateCode() {
258         return organizationStateCode;
259     }
260 
261     /**
262      * Sets the organizationStateCode attribute.
263      * 
264      * @param organizationStateCode The organizationStateCode to set.
265      */
266     public void setOrganizationStateCode(String organizationStateCode) {
267         this.organizationStateCode = organizationStateCode;
268     }
269 
270 
271     /**
272      * Gets the organizationZipCode attribute.
273      * 
274      * @return Returns the organizationZipCode
275      */
276     public String getOrganizationZipCode() {
277         return organizationZipCode;
278     }
279 
280     /**
281      * Sets the organizationZipCode attribute.
282      * 
283      * @param organizationZipCode The organizationZipCode to set.
284      */
285     public void setOrganizationZipCode(String organizationZipCode) {
286         this.organizationZipCode = organizationZipCode;
287     }
288 
289 
290     /**
291      * Gets the organizationBeginDate attribute.
292      * 
293      * @return Returns the organizationBeginDate
294      */
295     public Date getOrganizationBeginDate() {
296         return organizationBeginDate;
297     }
298 
299     /**
300      * Sets the organizationBeginDate attribute.
301      * 
302      * @param organizationBeginDate The organizationBeginDate to set.
303      */
304     public void setOrganizationBeginDate(Date organizationBeginDate) {
305         this.organizationBeginDate = organizationBeginDate;
306     }
307 
308 
309     /**
310      * Gets the organizationEndDate attribute.
311      * 
312      * @return Returns the organizationEndDate
313      */
314     public Date getOrganizationEndDate() {
315         return organizationEndDate;
316     }
317 
318     /**
319      * Sets the organizationEndDate attribute.
320      * 
321      * @param organizationEndDate The organizationEndDate to set.
322      */
323     public void setOrganizationEndDate(Date organizationEndDate) {
324         this.organizationEndDate = organizationEndDate;
325     }
326 
327 
328     /**
329      * Gets the reportsToChartOfAccountsCode attribute.
330      * 
331      * @return Returns the reportsToChartOfAccountsCode
332      */
333     public String getReportsToChartOfAccountsCode() {
334         return reportsToChartOfAccountsCode;
335     }
336 
337     /**
338      * Sets the reportsToChartOfAccountsCode attribute.
339      * 
340      * @param reportsToChartOfAccountsCode The reportsToChartOfAccountsCode to set.
341      */
342     public void setReportsToChartOfAccountsCode(String reportsToChartOfAccountsCode) {
343         this.reportsToChartOfAccountsCode = reportsToChartOfAccountsCode;
344     }
345 
346 
347     /**
348      * Gets the reportsToOrganizationCode attribute.
349      * 
350      * @return Returns the reportsToOrganizationCode
351      */
352     public String getReportsToOrganizationCode() {
353         return reportsToOrganizationCode;
354     }
355 
356     /**
357      * Sets the reportsToOrganizationCode attribute.
358      * 
359      * @param reportsToOrganizationCode The reportsToOrganizationCode to set.
360      */
361     public void setReportsToOrganizationCode(String reportsToOrganizationCode) {
362         this.reportsToOrganizationCode = reportsToOrganizationCode;
363     }
364 
365 
366     /**
367      * Gets the active attribute.
368      * 
369      * @return Returns the active
370      */
371     @Override
372     public boolean isActive() {
373         return active;
374     }
375 
376 
377     /**
378      * Sets the active attribute.
379      * 
380      * @param active The active to set.
381      */
382     @Override
383     public void setActive(boolean active) {
384         this.active = active;
385     }
386 
387 
388     /**
389      * Gets the organizationInFinancialProcessingIndicator attribute.
390      * 
391      * @return Returns the organizationInFinancialProcessingIndicator
392      */
393     public boolean isOrganizationInFinancialProcessingIndicator() {
394         return organizationInFinancialProcessingIndicator;
395     }
396 
397 
398     /**
399      * Sets the organizationInFinancialProcessingIndicator attribute.
400      * 
401      * @param organizationInFinancialProcessingIndicator The organizationInFinancialProcessingIndicator to set.
402      */
403     public void setOrganizationInFinancialProcessingIndicator(boolean organizationInFinancialProcessingIndicator) {
404         this.organizationInFinancialProcessingIndicator = organizationInFinancialProcessingIndicator;
405     }
406 
407 
408     /**
409      * Gets the organizationPlantAccountNumber attribute.
410      * 
411      * @return Returns the organizationPlantAccountNumber
412      */
413     public String getOrganizationPlantAccountNumber() {
414         return organizationPlantAccountNumber;
415     }
416 
417     /**
418      * Sets the organizationPlantAccountNumber attribute.
419      * 
420      * @param organizationPlantAccountNumber The organizationPlantAccountNumber to set.
421      */
422     public void setOrganizationPlantAccountNumber(String organizationPlantAccountNumber) {
423         this.organizationPlantAccountNumber = organizationPlantAccountNumber;
424     }
425 
426 
427     /**
428      * Gets the campusPlantAccountNumber attribute.
429      * 
430      * @return Returns the campusPlantAccountNumber
431      */
432     public String getCampusPlantAccountNumber() {
433         return campusPlantAccountNumber;
434     }
435 
436     /**
437      * Sets the campusPlantAccountNumber attribute.
438      * 
439      * @param campusPlantAccountNumber The campusPlantAccountNumber to set.
440      */
441     public void setCampusPlantAccountNumber(String campusPlantAccountNumber) {
442         this.campusPlantAccountNumber = campusPlantAccountNumber;
443     }
444 
445 
446     /**
447      * Gets the organizationPlantChartCode attribute.
448      * 
449      * @return Returns the organizationPlantChartCode
450      */
451     public String getOrganizationPlantChartCode() {
452         return organizationPlantChartCode;
453     }
454 
455     /**
456      * Sets the organizationPlantChartCode attribute.
457      * 
458      * @param organizationPlantChartCode The organizationPlantChartCode to set.
459      */
460     public void setOrganizationPlantChartCode(String organizationPlantChartCode) {
461         this.organizationPlantChartCode = organizationPlantChartCode;
462     }
463 
464 
465     /**
466      * Gets the campusPlantChartCode attribute.
467      * 
468      * @return Returns the campusPlantChartCode
469      */
470     public String getCampusPlantChartCode() {
471         return campusPlantChartCode;
472     }
473 
474     /**
475      * Sets the campusPlantChartCode attribute.
476      * 
477      * @param campusPlantChartCode The campusPlantChartCode to set.
478      */
479     public void setCampusPlantChartCode(String campusPlantChartCode) {
480         this.campusPlantChartCode = campusPlantChartCode;
481     }
482 
483     /**
484      * Gets the organizationCountryCode attribute.
485      * 
486      * @return Returns the organizationCountryCode.
487      */
488     public String getOrganizationCountryCode() {
489         return organizationCountryCode;
490     }
491 
492     /**
493      * Sets the organizationCountryCode attribute value.
494      * 
495      * @param organizationCountryCode The organizationCountryCode to set.
496      */
497     public void setOrganizationCountryCode(String organizationCountryCode) {
498         this.organizationCountryCode = organizationCountryCode;
499     }
500 
501     /**
502      * Gets the organizationLine1Address attribute.
503      * 
504      * @return Returns the organizationLine1Address.
505      */
506     public String getOrganizationLine1Address() {
507         return organizationLine1Address;
508     }
509 
510     /**
511      * Sets the organizationLine1Address attribute value.
512      * 
513      * @param organizationLine1Address The organizationLine1Address to set.
514      */
515     public void setOrganizationLine1Address(String organizationLine1Address) {
516         this.organizationLine1Address = organizationLine1Address;
517     }
518 
519     /**
520      * Gets the organizationLine2Address attribute.
521      * 
522      * @return Returns the organizationLine2Address.
523      */
524     public String getOrganizationLine2Address() {
525         return organizationLine2Address;
526     }
527 
528     /**
529      * Sets the organizationLine2Address attribute value.
530      * 
531      * @param organizationLine2Address The organizationLine2Address to set.
532      */
533     public void setOrganizationLine2Address(String organizationLine2Address) {
534         this.organizationLine2Address = organizationLine2Address;
535     }
536 
537     /**
538      * Gets the chartOfAccounts attribute.
539      * 
540      * @return Returns the chartOfAccounts
541      */
542     public Chart getChartOfAccounts() {
543         return chartOfAccounts;
544     }
545 
546     /**
547      * Sets the chartOfAccounts attribute.
548      * 
549      * @param chartOfAccounts The chartOfAccounts to set.
550      * @deprecated
551      */
552     public void setChartOfAccounts(Chart chartOfAccounts) {
553         this.chartOfAccounts = chartOfAccounts;
554     }
555 
556     /**
557      * Gets the organizationDefaultAccount attribute.
558      * 
559      * @return Returns the organizationDefaultAccount
560      */
561     public Account getOrganizationDefaultAccount() {
562         return organizationDefaultAccount;
563     }
564 
565     /**
566      * Sets the organizationDefaultAccount attribute.
567      * 
568      * @param organizationDefaultAccount The organizationDefaultAccount to set.
569      * @deprecated
570      */
571     public void setOrganizationDefaultAccount(Account organizationDefaultAccount) {
572         this.organizationDefaultAccount = organizationDefaultAccount;
573     }
574 
575     /**
576      * Gets the organization attribute.
577      * 
578      * @return Returns the organization
579      */
580     public Organization getOrganization() {
581         return organization;
582     }
583 
584     /**
585      * Sets the organization attribute.
586      * 
587      * @param organization The organization to set.
588      * @deprecated
589      */
590     public void setOrganization(Organization organization) {
591         this.organization = organization;
592     }
593 
594     /**
595      * Gets the organizationPhysicalCampus attribute.
596      * 
597      * @return Returns the organizationPhysicalCampus
598      */
599     public CampusEbo getOrganizationPhysicalCampus() {
600         if ( StringUtils.isBlank(organizationPhysicalCampusCode) ) {
601             organizationPhysicalCampus = null;
602         } else {
603             if ( organizationPhysicalCampus == null || !StringUtils.equals( organizationPhysicalCampus.getCode(),organizationPhysicalCampusCode) ) {
604                 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CampusEbo.class);
605                 if ( moduleService != null ) {
606                     Map<String,Object> keys = new HashMap<String, Object>(1);
607                     keys.put(LocationConstants.PrimaryKeyConstants.CODE, organizationPhysicalCampusCode);
608                     organizationPhysicalCampus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);
609                 } else {
610                     throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed." );
611                 }
612             }
613         }
614         return organizationPhysicalCampus;
615     }
616 
617     /**
618      * Sets the organizationPhysicalCampus attribute.
619      * 
620      * @param organizationPhysicalCampus The organizationPhysicalCampus to set.
621      * @deprecated
622      */
623     public void setOrganizationPhysicalCampus(CampusEbo organizationPhysicalCampus) {
624         this.organizationPhysicalCampus = organizationPhysicalCampus;
625     }
626 
627     /**
628      * Gets the reportsToOrganization attribute.
629      * 
630      * @return Returns the reportsToOrganization
631      */
632     public Organization getReportsToOrganization() {
633         return reportsToOrganization;
634     }
635 
636     /**
637      * Sets the reportsToOrganization attribute.
638      * 
639      * @param reportsToOrganization The reportsToOrganization to set.
640      * @deprecated
641      */
642     public void setReportsToOrganization(Organization reportsToOrganization) {
643         this.reportsToOrganization = reportsToOrganization;
644     }
645 
646     /**
647      * Gets the reportsToChartOfAccounts attribute.
648      * 
649      * @return Returns the reportsToChartOfAccounts
650      */
651     public Chart getReportsToChartOfAccounts() {
652         return reportsToChartOfAccounts;
653     }
654 
655     /**
656      * Sets the reportsToChartOfAccounts attribute.
657      * 
658      * @param reportsToChartOfAccounts The reportsToChartOfAccounts to set.
659      * @deprecated
660      */
661     public void setReportsToChartOfAccounts(Chart reportsToChartOfAccounts) {
662         this.reportsToChartOfAccounts = reportsToChartOfAccounts;
663     }
664 
665     /**
666      * Gets the organizationPlantAccount attribute.
667      * 
668      * @return Returns the organizationPlantAccount
669      */
670     public Account getOrganizationPlantAccount() {
671         return organizationPlantAccount;
672     }
673 
674     /**
675      * Sets the organizationPlantAccount attribute.
676      * 
677      * @param organizationPlantAccount The organizationPlantAccount to set.
678      * @deprecated
679      */
680     public void setOrganizationPlantAccount(Account organizationPlantAccount) {
681         this.organizationPlantAccount = organizationPlantAccount;
682     }
683 
684     /**
685      * Gets the campusPlantAccount attribute.
686      * 
687      * @return Returns the campusPlantAccount
688      */
689     public Account getCampusPlantAccount() {
690         return campusPlantAccount;
691     }
692 
693     /**
694      * Sets the campusPlantAccount attribute.
695      * 
696      * @param campusPlantAccount The campusPlantAccount to set.
697      * @deprecated
698      */
699     public void setCampusPlantAccount(Account campusPlantAccount) {
700         this.campusPlantAccount = campusPlantAccount;
701     }
702 
703     /**
704      * Gets the organizationPlantChart attribute.
705      * 
706      * @return Returns the organizationPlantChart
707      */
708     public Chart getOrganizationPlantChart() {
709         return organizationPlantChart;
710     }
711 
712     /**
713      * Sets the organizationPlantChart attribute.
714      * 
715      * @param organizationPlantChart The organizationPlantChart to set.
716      * @deprecated
717      */
718     public void setOrganizationPlantChart(Chart organizationPlantChart) {
719         this.organizationPlantChart = organizationPlantChart;
720     }
721 
722     /**
723      * Gets the campusPlantChart attribute.
724      * 
725      * @return Returns the campusPlantChart
726      */
727     public Chart getCampusPlantChart() {
728         return campusPlantChart;
729     }
730 
731     /**
732      * Sets the campusPlantChart attribute.
733      * 
734      * @param campusPlantChart The campusPlantChart to set.
735      * @deprecated
736      */
737     public void setCampusPlantChart(Chart campusPlantChart) {
738         this.campusPlantChart = campusPlantChart;
739     }
740 
741     /**
742      * Gets the organizationCountry attribute.
743      * 
744      * @return Returns the organizationCountry.
745      */
746     public CountryEbo getOrganizationCountry() {
747         if ( StringUtils.isBlank(organizationCountryCode) ) {
748             organizationCountry = null;
749         } else {
750             if ( organizationCountry == null || !StringUtils.equals( organizationCountry.getCode(),organizationCountryCode) ) {
751                 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CountryEbo.class);
752                 if ( moduleService != null ) {
753                     Map<String,Object> keys = new HashMap<String, Object>(1);
754                     keys.put(LocationConstants.PrimaryKeyConstants.CODE, organizationCountryCode);
755                     organizationCountry = moduleService.getExternalizableBusinessObject(CountryEbo.class, keys);
756                 } else {
757                     throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed." );
758                 }
759             }
760         }
761         return organizationCountry;
762     }
763 
764     /**
765      * Sets the organizationCountry attribute value.
766      * 
767      * @param organizationCountry The organizationCountry to set.
768      * @deprecated
769      */
770     public void setOrganizationCountry(CountryEbo organizationCountry) {
771         this.organizationCountry = organizationCountry;
772     }
773 
774 }