001 /*
002 * Copyright 2011 The Kuali Foundation.
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.kfs.coa.businessobject;
017
018 import java.util.LinkedHashMap;
019
020 import org.kuali.kfs.sys.context.SpringContext;
021 import org.kuali.rice.kns.bo.Inactivateable;
022 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
023 import org.kuali.rice.kim.bo.Person;
024 import org.kuali.rice.kim.service.PersonService;
025
026 /**
027 * Reporting Codes Business Object
028 */
029 public class ReportingCode extends PersistableBusinessObjectBase implements Inactivateable {
030
031 private static final long serialVersionUID = -1585612121519839488L;
032 private String chartOfAccountsCode;
033 private String organizationCode;
034 private String financialReportingCode;
035 private String financialReportingCodeDescription;
036 private String financialReportingCodeMgrId;
037 private String financialReportsToReportingCode;
038 private boolean active;
039
040 private Chart chart;
041 private Organization org;
042 private Person person;
043 private ReportingCode reportingCodes;
044
045 /**
046 * @return Returns the chartOfAccountsCode.
047 */
048 public String getChartOfAccountsCode() {
049 return chartOfAccountsCode;
050 }
051
052 /**
053 * @param chartOfAccountsCode The chartOfAccountsCode to set.
054 */
055 public void setChartOfAccountsCode(String chartOfAccountsCode) {
056 this.chartOfAccountsCode = chartOfAccountsCode;
057 }
058
059 /**
060 * @return Returns the financialReportingCode.
061 */
062 public String getFinancialReportingCode() {
063 return financialReportingCode;
064 }
065
066 /**
067 * @param financialReportingCode The financialReportingCode to set.
068 */
069 public void setFinancialReportingCode(String financialReportingCode) {
070 this.financialReportingCode = financialReportingCode;
071 }
072
073 /**
074 * @return Returns the financialReportingCodeDescription.
075 */
076 public String getFinancialReportingCodeDescription() {
077 return financialReportingCodeDescription;
078 }
079
080 /**
081 * @param financialReportingCodeDescription The financialReportingCodeDescription to set.
082 */
083 public void setFinancialReportingCodeDescription(String financialReportingCodeDescription) {
084 this.financialReportingCodeDescription = financialReportingCodeDescription;
085 }
086
087 /**
088 * @return Returns the financialReportingCodeMgrId.
089 */
090 public String getFinancialReportingCodeMgrId() {
091 return financialReportingCodeMgrId;
092 }
093
094 /**
095 * @param financialReportingCodeMgrId The financialReportingCodeMgrId to set.
096 */
097 public void setFinancialReportingCodeMgrId(String financialReportingCodeMgrId) {
098 this.financialReportingCodeMgrId = financialReportingCodeMgrId;
099 }
100
101 /**
102 * @return Returns the organizationCode.
103 */
104 public String getOrganizationCode() {
105 return organizationCode;
106 }
107
108 /**
109 * @param organizationCode The organizationCode to set.
110 */
111 public void setOrganizationCode(String organizationCode) {
112 this.organizationCode = organizationCode;
113 }
114
115 /**
116 * @return Returns the financialReportsToReportingCode.
117 */
118 public String getFinancialReportsToReportingCode() {
119 return financialReportsToReportingCode;
120 }
121
122 /**
123 * @param financialReportsToReportingCode The financialReportsToReportingCode to set.
124 */
125 public void setFinancialReportsToReportingCode(String financialReportsToReportingCode) {
126 this.financialReportsToReportingCode = financialReportsToReportingCode;
127 }
128
129 /**
130 * @return Returns the chart.
131 */
132 public Chart getChart() {
133 return chart;
134 }
135
136 /**
137 * @param chart The chart to set.
138 * @deprecated
139 */
140 public void setChart(Chart chart) {
141 this.chart = chart;
142 }
143
144 /**
145 * @return Returns the org.
146 */
147 public Organization getOrg() {
148 return org;
149 }
150
151 /**
152 * @param org The org to set.
153 * @deprecated
154 */
155 public void setOrg(Organization org) {
156 this.org = org;
157 }
158
159 public Person getPerson() {
160 person = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(financialReportingCodeMgrId, person);
161 return person;
162 }
163
164 /**
165 * @param person The person to set.
166 * @deprecated
167 */
168 public void setPerson(Person person) {
169 this.person = person;
170 }
171
172 /**
173 * @return Returns the reportingCodes.
174 */
175 public ReportingCode getReportingCodes() {
176 return reportingCodes;
177 }
178
179 /**
180 * @param reportingCodes The reportingCodes to set.
181 * @deprecated
182 */
183 public void setReportingCodes(ReportingCode reportingCodes) {
184 this.reportingCodes = reportingCodes;
185 }
186
187 /**
188 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
189 */
190 protected LinkedHashMap toStringMapper() {
191 LinkedHashMap m = new LinkedHashMap();
192 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
193 m.put("organizationCode", this.organizationCode);
194 m.put("financialReportingCode", this.financialReportingCode);
195 m.put("financialReportingCodeDescription", this.financialReportingCodeDescription);
196 m.put("financialReportingCodeMgrId", this.financialReportingCodeMgrId);
197 m.put("financialReportsToReportingCode", this.financialReportsToReportingCode);
198 return m;
199 }
200
201 /**
202 * Gets the active attribute.
203 * @return Returns the active.
204 */
205 public boolean isActive() {
206 return active;
207 }
208
209 /**
210 * Sets the active attribute value.
211 * @param active The active to set.
212 */
213 public void setActive(boolean active) {
214 this.active = active;
215 }
216
217 }
218