1 /*
2 * The Kuali Financial System, a comprehensive financial management system for higher education.
3 *
4 * Copyright 2005-2014 The Kuali Foundation
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 package org.kuali.kfs.module.bc.businessobject;
21
22 import java.util.LinkedHashMap;
23
24 import org.kuali.kfs.coa.businessobject.Chart;
25 import org.kuali.kfs.coa.businessobject.Organization;
26 import org.kuali.kfs.module.bc.document.service.BudgetConstructionOrganizationReportsService;
27 import org.kuali.kfs.sys.context.SpringContext;
28 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
29
30 /**
31 *
32 */
33 public class BudgetConstructionPullup extends PersistableBusinessObjectBase {
34
35 private String chartOfAccountsCode;
36 private String organizationCode;
37 private String reportsToChartOfAccountsCode;
38 private String reportsToOrganizationCode;
39 private Integer pullFlag;
40 private String principalId;
41
42 public boolean isLeaf;
43
44 private Chart chartOfAccounts;
45 private Organization organization;
46 private Organization reportsToOrganization;
47 private Chart reportsToChartOfAccounts;
48
49 /**
50 * Default constructor.
51 */
52 public BudgetConstructionPullup() {
53 pullFlag = new Integer(0);
54 }
55
56 /**
57 * Gets the chartOfAccountsCode attribute.
58 *
59 * @return Returns the chartOfAccountsCode
60 */
61 public String getChartOfAccountsCode() {
62 return chartOfAccountsCode;
63 }
64
65 /**
66 * Sets the chartOfAccountsCode attribute.
67 *
68 * @param chartOfAccountsCode The chartOfAccountsCode to set.
69 */
70 public void setChartOfAccountsCode(String chartOfAccountsCode) {
71 this.chartOfAccountsCode = chartOfAccountsCode;
72 }
73
74
75 /**
76 * Gets the organizationCode attribute.
77 *
78 * @return Returns the organizationCode
79 */
80 public String getOrganizationCode() {
81 return organizationCode;
82 }
83
84 /**
85 * Sets the organizationCode attribute.
86 *
87 * @param organizationCode The organizationCode to set.
88 */
89 public void setOrganizationCode(String organizationCode) {
90 this.organizationCode = organizationCode;
91 }
92
93
94 /**
95 * Gets the reportsToChartOfAccountsCode attribute.
96 *
97 * @return Returns the reportsToChartOfAccountsCode
98 */
99 public String getReportsToChartOfAccountsCode() {
100 return reportsToChartOfAccountsCode;
101 }
102
103 /**
104 * Sets the reportsToChartOfAccountsCode attribute.
105 *
106 * @param reportsToChartOfAccountsCode The reportsToChartOfAccountsCode to set.
107 */
108 public void setReportsToChartOfAccountsCode(String reportsToChartOfAccountsCode) {
109 this.reportsToChartOfAccountsCode = reportsToChartOfAccountsCode;
110 }
111
112
113 /**
114 * Gets the reportsToOrganizationCode attribute.
115 *
116 * @return Returns the reportsToOrganizationCode
117 */
118 public String getReportsToOrganizationCode() {
119 return reportsToOrganizationCode;
120 }
121
122 /**
123 * Sets the reportsToOrganizationCode attribute.
124 *
125 * @param reportsToOrganizationCode The reportsToOrganizationCode to set.
126 */
127 public void setReportsToOrganizationCode(String reportsToOrganizationCode) {
128 this.reportsToOrganizationCode = reportsToOrganizationCode;
129 }
130
131
132 /**
133 * Gets the pullFlag attribute.
134 *
135 * @return Returns the pullFlag
136 */
137 public Integer getPullFlag() {
138 return pullFlag;
139 }
140
141 /**
142 * Sets the pullFlag attribute.
143 *
144 * @param pullFlag The pullFlag to set.
145 */
146 public void setPullFlag(Integer pullFlag) {
147 this.pullFlag = pullFlag;
148 }
149
150
151 /**
152 * Gets the principalId attribute.
153 *
154 * @return Returns the principalId.
155 */
156 public String getPrincipalId() {
157 return principalId;
158 }
159
160 /**
161 * Sets the principalId attribute value.
162 *
163 * @param principalId The principalId to set.
164 */
165 public void setPrincipalId(String principalId) {
166 this.principalId = principalId;
167 }
168
169 /**
170 * Gets the isLeaf attribute.
171 *
172 * @return Returns the isLeaf.
173 */
174 public boolean isLeaf() {
175 return SpringContext.getBean(BudgetConstructionOrganizationReportsService.class).isLeafOrg(this.chartOfAccountsCode, this.organizationCode);
176 }
177
178 /**
179 * Gets the chartOfAccounts attribute.
180 *
181 * @return Returns the chartOfAccounts
182 */
183 public Chart getChartOfAccounts() {
184 return chartOfAccounts;
185 }
186
187 /**
188 * Sets the chartOfAccounts attribute.
189 *
190 * @param chartOfAccounts The chartOfAccounts to set.
191 * @deprecated
192 */
193 public void setChartOfAccounts(Chart chartOfAccounts) {
194 this.chartOfAccounts = chartOfAccounts;
195 }
196
197 /**
198 * Gets the organization attribute.
199 *
200 * @return Returns the organization
201 */
202 public Organization getOrganization() {
203 return organization;
204 }
205
206 /**
207 * Sets the organization attribute.
208 *
209 * @param organization The organization to set.
210 * @deprecated
211 */
212 public void setOrganization(Organization organization) {
213 this.organization = organization;
214 }
215
216 /**
217 * Gets the reportsToOrganization attribute.
218 *
219 * @return Returns the reportsToOrganization
220 */
221 public Organization getReportsToOrganization() {
222 return reportsToOrganization;
223 }
224
225 /**
226 * Sets the reportsToOrganization attribute.
227 *
228 * @param reportsToOrganization The reportsToOrganization to set.
229 * @deprecated
230 */
231 public void setReportsToOrganization(Organization reportsToOrganization) {
232 this.reportsToOrganization = reportsToOrganization;
233 }
234
235 /**
236 * Gets the reportsToChartOfAccounts attribute.
237 *
238 * @return Returns the reportsToChartOfAccounts
239 */
240 public Chart getReportsToChartOfAccounts() {
241 return reportsToChartOfAccounts;
242 }
243
244 /**
245 * Sets the reportsToChartOfAccounts attribute.
246 *
247 * @param reportsToChartOfAccounts The reportsToChartOfAccounts to set.
248 * @deprecated
249 */
250 public void setReportsToChartOfAccounts(Chart reportsToChartOfAccounts) {
251 this.reportsToChartOfAccounts = reportsToChartOfAccounts;
252 }
253
254 /**
255 * @see java.lang.Object#equals(java.lang.Object)
256 */
257
258 public boolean equals(Object obj) {
259 boolean isEqual = true;
260 if (obj == null || !(obj instanceof BudgetConstructionPullup)) {
261 isEqual = false;
262 }
263 else {
264 if (!this.toString().equals(obj.toString())) {
265 isEqual = false;
266 }
267 }
268
269 return isEqual;
270 }
271
272 /**
273 * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
274 */
275 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
276 LinkedHashMap m = new LinkedHashMap();
277 m.put("principalId", this.principalId);
278 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
279 m.put("organizationCode", this.organizationCode);
280 return m;
281 }
282 }
283