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
017 package org.kuali.kfs.module.bc.businessobject;
018
019 import java.util.ArrayList;
020 import java.util.HashMap;
021 import java.util.LinkedHashMap;
022 import java.util.List;
023 import java.util.Map;
024
025 import org.kuali.kfs.coa.businessobject.Account;
026 import org.kuali.kfs.coa.businessobject.Chart;
027 import org.kuali.kfs.coa.businessobject.Organization;
028 import org.kuali.kfs.coa.businessobject.SubAccount;
029 import org.kuali.kfs.sys.KFSPropertyConstants;
030 import org.kuali.kfs.sys.context.SpringContext;
031 import org.kuali.rice.kns.bo.DocumentHeader;
032 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
033 import org.kuali.rice.kim.bo.Person;
034 import org.kuali.rice.kim.service.PersonService;
035
036 /**
037 *
038 */
039 public class BudgetConstructionHeader extends PersistableBusinessObjectBase {
040
041 private String documentNumber;
042 private Integer universityFiscalYear;
043 private String chartOfAccountsCode;
044 private String accountNumber;
045 private String subAccountNumber;
046 private Integer organizationLevelCode;
047 private String organizationLevelChartOfAccountsCode;
048 private String organizationLevelOrganizationCode;
049 private String budgetLockUserIdentifier;
050 private String budgetTransactionLockUserIdentifier;
051
052 private Chart chartOfAccounts;
053 private Account account;
054 private SubAccount subAccount;
055 private Person budgetLockUser;
056 private Person budgetTransactionLockUser;
057 private Organization organizationLevelOrganization;
058 private DocumentHeader financialDocument;
059 private BudgetConstructionAccountReports budgetConstructionAccountReports;
060
061 private List budgetConstructionAccountSelect;
062
063 /**
064 * Default constructor.
065 */
066 public BudgetConstructionHeader() {
067 budgetConstructionAccountSelect = new ArrayList();
068
069 }
070
071 /**
072 * Gets the documentNumber attribute.
073 *
074 * @return Returns the documentNumber
075 */
076 public String getDocumentNumber() {
077 return documentNumber;
078 }
079
080 /**
081 * Sets the documentNumber attribute.
082 *
083 * @param documentNumber The documentNumber to set.
084 */
085 public void setDocumentNumber(String documentNumber) {
086 this.documentNumber = documentNumber;
087 }
088
089
090 /**
091 * Gets the universityFiscalYear attribute.
092 *
093 * @return Returns the universityFiscalYear
094 */
095 public Integer getUniversityFiscalYear() {
096 return universityFiscalYear;
097 }
098
099 /**
100 * Sets the universityFiscalYear attribute.
101 *
102 * @param universityFiscalYear The universityFiscalYear to set.
103 */
104 public void setUniversityFiscalYear(Integer universityFiscalYear) {
105 this.universityFiscalYear = universityFiscalYear;
106 }
107
108
109 /**
110 * Gets the chartOfAccountsCode attribute.
111 *
112 * @return Returns the chartOfAccountsCode
113 */
114 public String getChartOfAccountsCode() {
115 return chartOfAccountsCode;
116 }
117
118 /**
119 * Sets the chartOfAccountsCode attribute.
120 *
121 * @param chartOfAccountsCode The chartOfAccountsCode to set.
122 */
123 public void setChartOfAccountsCode(String chartOfAccountsCode) {
124 this.chartOfAccountsCode = chartOfAccountsCode;
125 }
126
127
128 /**
129 * Gets the accountNumber attribute.
130 *
131 * @return Returns the accountNumber
132 */
133 public String getAccountNumber() {
134 return accountNumber;
135 }
136
137 /**
138 * Sets the accountNumber attribute.
139 *
140 * @param accountNumber The accountNumber to set.
141 */
142 public void setAccountNumber(String accountNumber) {
143 this.accountNumber = accountNumber;
144 }
145
146
147 /**
148 * Gets the subAccountNumber attribute.
149 *
150 * @return Returns the subAccountNumber
151 */
152 public String getSubAccountNumber() {
153 return subAccountNumber;
154 }
155
156 /**
157 * Sets the subAccountNumber attribute.
158 *
159 * @param subAccountNumber The subAccountNumber to set.
160 */
161 public void setSubAccountNumber(String subAccountNumber) {
162 this.subAccountNumber = subAccountNumber;
163 }
164
165
166 /**
167 * Gets the organizationLevelCode attribute.
168 *
169 * @return Returns the organizationLevelCode
170 */
171 public Integer getOrganizationLevelCode() {
172 return organizationLevelCode;
173 }
174
175 /**
176 * Sets the organizationLevelCode attribute.
177 *
178 * @param organizationLevelCode The organizationLevelCode to set.
179 */
180 public void setOrganizationLevelCode(Integer organizationLevelCode) {
181 this.organizationLevelCode = organizationLevelCode;
182 }
183
184
185 /**
186 * Gets the organizationLevelChartOfAccountsCode attribute.
187 *
188 * @return Returns the organizationLevelChartOfAccountsCode
189 */
190 public String getOrganizationLevelChartOfAccountsCode() {
191 return organizationLevelChartOfAccountsCode;
192 }
193
194 /**
195 * Sets the organizationLevelChartOfAccountsCode attribute.
196 *
197 * @param organizationLevelChartOfAccountsCode The organizationLevelChartOfAccountsCode to set.
198 */
199 public void setOrganizationLevelChartOfAccountsCode(String organizationLevelChartOfAccountsCode) {
200 this.organizationLevelChartOfAccountsCode = organizationLevelChartOfAccountsCode;
201 }
202
203
204 /**
205 * Gets the organizationLevelOrganizationCode attribute.
206 *
207 * @return Returns the organizationLevelOrganizationCode
208 */
209 public String getOrganizationLevelOrganizationCode() {
210 return organizationLevelOrganizationCode;
211 }
212
213 /**
214 * Sets the organizationLevelOrganizationCode attribute.
215 *
216 * @param organizationLevelOrganizationCode The organizationLevelOrganizationCode to set.
217 */
218 public void setOrganizationLevelOrganizationCode(String organizationLevelOrganizationCode) {
219 this.organizationLevelOrganizationCode = organizationLevelOrganizationCode;
220 }
221
222
223 /**
224 * Gets the budgetLockUserIdentifier attribute.
225 *
226 * @return Returns the budgetLockUserIdentifier
227 */
228 public String getBudgetLockUserIdentifier() {
229 return budgetLockUserIdentifier;
230 }
231
232 /**
233 * Sets the budgetLockUserIdentifier attribute.
234 *
235 * @param budgetLockUserIdentifier The budgetLockUserIdentifier to set.
236 */
237 public void setBudgetLockUserIdentifier(String budgetLockUserIdentifier) {
238 this.budgetLockUserIdentifier = budgetLockUserIdentifier;
239 }
240
241
242 /**
243 * Gets the budgetTransactionLockUserIdentifier attribute.
244 *
245 * @return Returns the budgetTransactionLockUserIdentifier
246 */
247 public String getBudgetTransactionLockUserIdentifier() {
248 return budgetTransactionLockUserIdentifier;
249 }
250
251 /**
252 * Sets the budgetTransactionLockUserIdentifier attribute.
253 *
254 * @param budgetTransactionLockUserIdentifier The budgetTransactionLockUserIdentifier to set.
255 */
256 public void setBudgetTransactionLockUserIdentifier(String budgetTransactionLockUserIdentifier) {
257 this.budgetTransactionLockUserIdentifier = budgetTransactionLockUserIdentifier;
258 }
259
260
261 /**
262 * Gets the chartOfAccounts attribute.
263 *
264 * @return Returns the chartOfAccounts
265 */
266 public Chart getChartOfAccounts() {
267 return chartOfAccounts;
268 }
269
270 /**
271 * Sets the chartOfAccounts attribute.
272 *
273 * @param chartOfAccounts The chartOfAccounts to set.
274 * @deprecated
275 */
276 public void setChartOfAccounts(Chart chartOfAccounts) {
277 this.chartOfAccounts = chartOfAccounts;
278 }
279
280 /**
281 * Gets the account attribute.
282 *
283 * @return Returns the account
284 */
285 public Account getAccount() {
286 return account;
287 }
288
289 /**
290 * Sets the account attribute.
291 *
292 * @param account The account to set.
293 * @deprecated
294 */
295 public void setAccount(Account account) {
296 this.account = account;
297 }
298
299 public Person getBudgetLockUser() {
300 if (budgetLockUserIdentifier != null){
301 budgetLockUser = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(budgetLockUserIdentifier, budgetLockUser);
302 }
303 return budgetLockUser;
304 }
305
306 /**
307 * Sets the budgetLockUser attribute.
308 *
309 * @param budgetLockUser The budgetLockUser to set.
310 * @deprecated
311 */
312 public void setBudgetLockUser(Person budgetLockUser) {
313 this.budgetLockUser = budgetLockUser;
314 }
315
316 /**
317 * Gets the budgetConstructionAccountSelect list.
318 *
319 * @return Returns the budgetConstructionAccountSelect list
320 */
321 public List getBudgetConstructionAccountSelect() {
322 return budgetConstructionAccountSelect;
323 }
324
325 /**
326 * Sets the budgetConstructionAccountSelect list.
327 *
328 * @param budgetConstructionAccountSelect The budgetConstructionAccountSelect list to set.
329 */
330 public void setBudgetConstructionAccountSelect(List budgetConstructionAccountSelect) {
331 this.budgetConstructionAccountSelect = budgetConstructionAccountSelect;
332 }
333
334 public Person getBudgetTransactionLockUser() {
335 if (budgetTransactionLockUserIdentifier != null){
336 budgetTransactionLockUser = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(budgetTransactionLockUserIdentifier, budgetTransactionLockUser);
337 }
338 return budgetTransactionLockUser;
339 }
340
341 /**
342 * Sets the budgetTransactionLockUser attribute value.
343 *
344 * @param budgetTransactionLockUser The budgetTransactionLockUser to set.
345 * @deprecated
346 */
347 public void setBudgetTransactionLockUser(Person budgetTransactionLockUser) {
348 this.budgetTransactionLockUser = budgetTransactionLockUser;
349 }
350
351 /**
352 * Gets the organizationLevelOrganization attribute.
353 *
354 * @return Returns the organizationLevelOrganization.
355 */
356 public Organization getOrganizationLevelOrganization() {
357 return organizationLevelOrganization;
358 }
359
360 /**
361 * Sets the organizationLevelOrganization attribute value.
362 *
363 * @param organizationLevelOrganization The organizationLevelOrganization to set.
364 * @deprecated
365 */
366 public void setOrganizationLevelOrganization(Organization organizationLevelOrganization) {
367 this.organizationLevelOrganization = organizationLevelOrganization;
368 }
369
370 /**
371 * Gets the subAccount attribute.
372 *
373 * @return Returns the subAccount.
374 */
375 public SubAccount getSubAccount() {
376 return subAccount;
377 }
378
379 /**
380 * Sets the subAccount attribute value.
381 *
382 * @param subAccount The subAccount to set.
383 */
384 public void setSubAccount(SubAccount subAccount) {
385 this.subAccount = subAccount;
386 }
387
388 /**
389 * Gets the financialDocument attribute.
390 *
391 * @return Returns the financialDocument.
392 */
393 public DocumentHeader getFinancialDocument() {
394 return financialDocument;
395 }
396
397 /**
398 * Sets the financialDocument attribute value.
399 *
400 * @param financialDocument The financialDocument to set.
401 * @deprecated
402 */
403 public void setFinancialDocument(DocumentHeader financialDocument) {
404 this.financialDocument = financialDocument;
405 }
406
407 /**
408 * Gets the budgetConstructionAccountReports attribute.
409 *
410 * @return Returns the budgetConstructionAccountReports.
411 */
412 public BudgetConstructionAccountReports getBudgetConstructionAccountReports() {
413 return budgetConstructionAccountReports;
414 }
415
416 /**
417 * Sets the budgetConstructionAccountReports attribute value.
418 *
419 * @param budgetConstructionAccountReports The budgetConstructionAccountReports to set.
420 */
421 public void setBudgetConstructionAccountReports(BudgetConstructionAccountReports budgetConstructionAccountReports) {
422 this.budgetConstructionAccountReports = budgetConstructionAccountReports;
423 }
424
425 /**
426 * Returns a map with the primitive field names as the key and the primitive values as the map value.
427 *
428 * @return Map
429 */
430 public Map getValuesMap() {
431 Map simpleValues = new HashMap();
432
433 simpleValues.put("documentNumber", getDocumentNumber());
434 simpleValues.put("universityFiscalYear", getUniversityFiscalYear());
435 simpleValues.put("chartOfAccountsCode", getChartOfAccountsCode());
436 simpleValues.put("accountNumber", getAccountNumber());
437 simpleValues.put("subAccountNumber", getSubAccountNumber());
438
439 return simpleValues;
440 }
441
442 /**
443 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
444 */
445 protected LinkedHashMap toStringMapper() {
446 LinkedHashMap m = new LinkedHashMap();
447 m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
448 if (this.universityFiscalYear != null) {
449 m.put("universityFiscalYear", this.universityFiscalYear.toString());
450 }
451 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
452 m.put("accountNumber", this.accountNumber);
453 m.put("subAccountNumber", this.subAccountNumber);
454 return m;
455 }
456
457 }
458