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.math.BigDecimal;
020    import java.util.ArrayList;
021    import java.util.LinkedHashMap;
022    import java.util.List;
023    
024    import org.apache.commons.lang.StringUtils;
025    import org.kuali.kfs.coa.businessobject.Account;
026    import org.kuali.kfs.coa.businessobject.Chart;
027    import org.kuali.kfs.coa.businessobject.ObjectCode;
028    import org.kuali.kfs.coa.businessobject.SubAccount;
029    import org.kuali.kfs.coa.businessobject.SubObjectCode;
030    import org.kuali.kfs.sys.businessobject.SystemOptions;
031    import org.kuali.kfs.sys.context.SpringContext;
032    import org.kuali.rice.kim.bo.Person;
033    import org.kuali.rice.kim.service.PersonService;
034    import org.kuali.rice.kns.bo.Inactivateable;
035    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
036    import org.kuali.rice.kns.util.KualiDecimal;
037    
038    /**
039     * 
040     */
041    public class CalculatedSalaryFoundationTrackerOverride extends PersistableBusinessObjectBase implements Inactivateable {
042    
043        private Integer universityFiscalYear;
044        private String chartOfAccountsCode;
045        private String accountNumber;
046        private String subAccountNumber;
047        private String financialObjectCode;
048        private String financialSubObjectCode;
049        private String positionNumber;
050        private String emplid;
051        private KualiDecimal csfAmount;
052        private BigDecimal csfFullTimeEmploymentQuantity;
053        private BigDecimal csfTimePercent;
054        private String csfFundingStatusCode;
055        private String csfDeleteCode;
056        private boolean active;
057    
058        private ObjectCode financialObject;
059        private Chart chartOfAccounts;
060        private Account account;
061        private SubAccount subAccount;
062        private SubObjectCode financialSubObject;
063        private SystemOptions universityFiscal;
064        private List calculatedSalaryFoundationTracker;
065    
066        private Person csfTrackerOverridePerson;
067    
068    
069        /**
070         * Default constructor.
071         */
072        public CalculatedSalaryFoundationTrackerOverride() {
073            calculatedSalaryFoundationTracker = new ArrayList();
074    
075        }
076    
077        /**
078         * Gets the universityFiscalYear attribute.
079         * 
080         * @return Returns the universityFiscalYear
081         */
082        public Integer getUniversityFiscalYear() {
083            return universityFiscalYear;
084        }
085    
086        /**
087         * Sets the universityFiscalYear attribute.
088         * 
089         * @param universityFiscalYear The universityFiscalYear to set.
090         */
091        public void setUniversityFiscalYear(Integer universityFiscalYear) {
092            this.universityFiscalYear = universityFiscalYear;
093        }
094    
095    
096        /**
097         * Gets the chartOfAccountsCode attribute.
098         * 
099         * @return Returns the chartOfAccountsCode
100         */
101        public String getChartOfAccountsCode() {
102            return chartOfAccountsCode;
103        }
104    
105        /**
106         * Sets the chartOfAccountsCode attribute.
107         * 
108         * @param chartOfAccountsCode The chartOfAccountsCode to set.
109         */
110        public void setChartOfAccountsCode(String chartOfAccountsCode) {
111            this.chartOfAccountsCode = chartOfAccountsCode;
112        }
113    
114    
115        /**
116         * Gets the accountNumber attribute.
117         * 
118         * @return Returns the accountNumber
119         */
120        public String getAccountNumber() {
121            return accountNumber;
122        }
123    
124        /**
125         * Sets the accountNumber attribute.
126         * 
127         * @param accountNumber The accountNumber to set.
128         */
129        public void setAccountNumber(String accountNumber) {
130            this.accountNumber = accountNumber;
131        }
132    
133    
134        /**
135         * Gets the subAccountNumber attribute.
136         * 
137         * @return Returns the subAccountNumber
138         */
139        public String getSubAccountNumber() {
140            return subAccountNumber;
141        }
142    
143        /**
144         * Sets the subAccountNumber attribute.
145         * 
146         * @param subAccountNumber The subAccountNumber to set.
147         */
148        public void setSubAccountNumber(String subAccountNumber) {
149            this.subAccountNumber = subAccountNumber;
150        }
151    
152    
153        /**
154         * Gets the financialObjectCode attribute.
155         * 
156         * @return Returns the financialObjectCode
157         */
158        public String getFinancialObjectCode() {
159            return financialObjectCode;
160        }
161    
162        /**
163         * Sets the financialObjectCode attribute.
164         * 
165         * @param financialObjectCode The financialObjectCode to set.
166         */
167        public void setFinancialObjectCode(String financialObjectCode) {
168            this.financialObjectCode = financialObjectCode;
169        }
170    
171    
172        /**
173         * Gets the financialSubObjectCode attribute.
174         * 
175         * @return Returns the financialSubObjectCode
176         */
177        public String getFinancialSubObjectCode() {
178            return financialSubObjectCode;
179        }
180    
181        /**
182         * Sets the financialSubObjectCode attribute.
183         * 
184         * @param financialSubObjectCode The financialSubObjectCode to set.
185         */
186        public void setFinancialSubObjectCode(String financialSubObjectCode) {
187            this.financialSubObjectCode = financialSubObjectCode;
188        }
189    
190    
191        /**
192         * Gets the positionNumber attribute.
193         * 
194         * @return Returns the positionNumber
195         */
196        public String getPositionNumber() {
197            return positionNumber;
198        }
199    
200        /**
201         * Sets the positionNumber attribute.
202         * 
203         * @param positionNumber The positionNumber to set.
204         */
205        public void setPositionNumber(String positionNumber) {
206            this.positionNumber = positionNumber;
207        }
208    
209    
210        /**
211         * Gets the emplid attribute.
212         * 
213         * @return Returns the emplid
214         */
215        public String getEmplid() {
216            return emplid;
217        }
218    
219        /**
220         * Sets the emplid attribute.
221         * 
222         * @param emplid The emplid to set.
223         */
224        public void setEmplid(String emplid) {
225            this.emplid = emplid;
226        }
227    
228    
229        /**
230         * Gets the csfAmount attribute.
231         * 
232         * @return Returns the csfAmount
233         */
234        public KualiDecimal getCsfAmount() {
235            return csfAmount;
236        }
237    
238        /**
239         * Sets the csfAmount attribute.
240         * 
241         * @param csfAmount The csfAmount to set.
242         */
243        public void setCsfAmount(KualiDecimal csfAmount) {
244            this.csfAmount = csfAmount;
245        }
246    
247    
248        /**
249         * Gets the csfFullTimeEmploymentQuantity attribute.
250         * 
251         * @return Returns the csfFullTimeEmploymentQuantity
252         */
253        public BigDecimal getCsfFullTimeEmploymentQuantity() {
254            return csfFullTimeEmploymentQuantity;
255        }
256    
257        /**
258         * Sets the csfFullTimeEmploymentQuantity attribute.
259         * 
260         * @param csfFullTimeEmploymentQuantity The csfFullTimeEmploymentQuantity to set.
261         */
262        public void setCsfFullTimeEmploymentQuantity(BigDecimal csfFullTimeEmploymentQuantity) {
263            this.csfFullTimeEmploymentQuantity = csfFullTimeEmploymentQuantity;
264        }
265    
266    
267        /**
268         * Gets the csfTimePercent attribute.
269         * 
270         * @return Returns the csfTimePercent
271         */
272        public BigDecimal getCsfTimePercent() {
273            return csfTimePercent;
274        }
275    
276        /**
277         * Sets the csfTimePercent attribute.
278         * 
279         * @param csfTimePercent The csfTimePercent to set.
280         */
281        public void setCsfTimePercent(BigDecimal csfTimePercent) {
282            this.csfTimePercent = csfTimePercent;
283        }
284    
285    
286        /**
287         * Gets the csfFundingStatusCode attribute.
288         * 
289         * @return Returns the csfFundingStatusCode
290         */
291        public String getCsfFundingStatusCode() {
292            return csfFundingStatusCode;
293        }
294    
295        /**
296         * Sets the csfFundingStatusCode attribute.
297         * 
298         * @param csfFundingStatusCode The csfFundingStatusCode to set.
299         */
300        public void setCsfFundingStatusCode(String csfFundingStatusCode) {
301            this.csfFundingStatusCode = csfFundingStatusCode;
302        }
303    
304    
305        /**
306         * Gets the csfDeleteCode attribute.
307         * 
308         * @return Returns the csfDeleteCode
309         */
310        public String getCsfDeleteCode() {
311            return csfDeleteCode;
312        }
313    
314        /**
315         * Sets the csfDeleteCode attribute.
316         * 
317         * @param csfDeleteCode The csfDeleteCode to set.
318         */
319        public void setCsfDeleteCode(String csfDeleteCode) {
320            this.csfDeleteCode = csfDeleteCode;
321        }
322    
323    
324        /**
325         * Gets the financialObject attribute.
326         * 
327         * @return Returns the financialObject
328         */
329        public ObjectCode getFinancialObject() {
330            return financialObject;
331        }
332    
333        /**
334         * Sets the financialObject attribute.
335         * 
336         * @param financialObject The financialObject to set.
337         * @deprecated
338         */
339        public void setFinancialObject(ObjectCode financialObject) {
340            this.financialObject = financialObject;
341        }
342    
343        /**
344         * Gets the chartOfAccounts attribute.
345         * 
346         * @return Returns the chartOfAccounts
347         */
348        public Chart getChartOfAccounts() {
349            return chartOfAccounts;
350        }
351    
352        /**
353         * Sets the chartOfAccounts attribute.
354         * 
355         * @param chartOfAccounts The chartOfAccounts to set.
356         * @deprecated
357         */
358        public void setChartOfAccounts(Chart chartOfAccounts) {
359            this.chartOfAccounts = chartOfAccounts;
360        }
361    
362        /**
363         * Gets the account attribute.
364         * 
365         * @return Returns the account
366         */
367        public Account getAccount() {
368            return account;
369        }
370    
371        /**
372         * Sets the account attribute.
373         * 
374         * @param account The account to set.
375         * @deprecated
376         */
377        public void setAccount(Account account) {
378            this.account = account;
379        }
380    
381        /**
382         * Gets the financialSubObject attribute.
383         * 
384         * @return Returns the financialSubObject.
385         */
386        public SubObjectCode getFinancialSubObject() {
387            return financialSubObject;
388        }
389    
390        /**
391         * Sets the financialSubObject attribute value.
392         * 
393         * @param financialSubObject The financialSubObject to set.
394         * @deprecated
395         */
396        public void setFinancialSubObject(SubObjectCode financialSubObject) {
397            this.financialSubObject = financialSubObject;
398        }
399    
400        /**
401         * Gets the subAccount attribute.
402         * 
403         * @return Returns the subAccount.
404         */
405        public SubAccount getSubAccount() {
406            return subAccount;
407        }
408    
409        /**
410         * Sets the subAccount attribute value.
411         * 
412         * @param subAccount The subAccount to set.
413         * @deprecated
414         */
415        public void setSubAccount(SubAccount subAccount) {
416            this.subAccount = subAccount;
417        }
418    
419        /**
420         * Gets the calculatedSalaryFoundationTracker attribute.
421         * 
422         * @return Returns the calculatedSalaryFoundationTracker.
423         */
424        public List getCalculatedSalaryFoundationTracker() {
425            return calculatedSalaryFoundationTracker;
426        }
427    
428        /**
429         * Sets the calculatedSalaryFoundationTracker attribute value.
430         * 
431         * @param calculatedSalaryFoundationTracker The calculatedSalaryFoundationTracker to set.
432         */
433        public void setCalculatedSalaryFoundationTracker(List calculatedSalaryFoundationTracker) {
434            this.calculatedSalaryFoundationTracker = calculatedSalaryFoundationTracker;
435        }
436    
437        /**
438         * Gets the universityFiscal attribute.
439         * 
440         * @return Returns the universityFiscal.
441         */
442        public SystemOptions getUniversityFiscal() {
443            return universityFiscal;
444        }
445    
446        /**
447         * Sets the universityFiscal attribute value.
448         * 
449         * @param universityFiscal The universityFiscal to set.
450         */
451        public void setUniversityFiscal(SystemOptions universityFiscal) {
452            this.universityFiscal = universityFiscal;
453        }
454    
455        /**
456         * Gets the csfTrackerOverridePerson attribute. 
457         * @return Returns the csfTrackerOverridePerson.
458         */
459        public Person getCsfTrackerOverridePerson() {
460            if(csfTrackerOverridePerson == null || !StringUtils.equals(csfTrackerOverridePerson.getEmployeeId(), emplid)) {
461                csfTrackerOverridePerson = SpringContext.getBean(PersonService.class).getPersonByEmployeeId(emplid);
462            }
463            
464            return csfTrackerOverridePerson;
465        }
466    
467        /**
468         * Sets the csfTrackerOverridePerson attribute value.
469         * @param csfTrackerOverridePerson The csfTrackerOverridePerson to set.
470         */
471        public void setCsfTrackerOverridePerson(Person csfTrackerOverridePerson) {
472            this.csfTrackerOverridePerson = csfTrackerOverridePerson;
473        }
474    
475        /**
476         * Gets the active attribute.
477         * 
478         * @return Returns the active.
479         */
480        public boolean isActive() {
481            return active;
482        }
483    
484        /**
485         * Sets the active attribute value.
486         * 
487         * @param active The active to set.
488         */
489        public void setActive(boolean active) {
490            this.active = active;
491        }
492    
493        /**
494         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
495         */
496        protected LinkedHashMap toStringMapper() {
497            LinkedHashMap m = new LinkedHashMap();
498            if (this.universityFiscalYear != null) {
499                m.put("universityFiscalYear", this.universityFiscalYear.toString());
500            }
501            m.put("chartOfAccountsCode", this.chartOfAccountsCode);
502            m.put("accountNumber", this.accountNumber);
503            m.put("subAccountNumber", this.subAccountNumber);
504            m.put("financialObjectCode", this.financialObjectCode);
505            m.put("financialSubObjectCode", this.financialSubObjectCode);
506            m.put("positionNumber", this.positionNumber);
507            m.put("emplid", this.emplid);
508            return m;
509        }
510    
511    
512    }