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.ld.businessobject;
018
019 import java.util.LinkedHashMap;
020
021 import org.kuali.kfs.coa.businessobject.Chart;
022 import org.kuali.kfs.coa.businessobject.ObjectCode;
023 import org.kuali.kfs.integration.ld.LaborLedgerBenefitsCalculation;
024 import org.kuali.kfs.integration.ld.LaborLedgerBenefitsType;
025 import org.kuali.kfs.sys.businessobject.SystemOptions;
026 import org.kuali.rice.kns.bo.Inactivateable;
027 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
028 import org.kuali.rice.kns.util.KualiPercent;
029
030 /**
031 * Labor business object for Benefits Calculation.
032 */
033 public class BenefitsCalculation extends PersistableBusinessObjectBase implements LaborLedgerBenefitsCalculation, Inactivateable {
034
035 private Integer universityFiscalYear;
036 private String chartOfAccountsCode;
037 private String positionBenefitTypeCode;
038 private KualiPercent positionFringeBenefitPercent;
039 private String positionFringeBenefitObjectCode;
040 private ObjectCode positionFringeBenefitObject;
041 private Chart chartOfAccounts;
042 private BenefitsType positionBenefitType;
043 private transient SystemOptions universityFiscal;
044 private boolean active;
045 private LaborObject laborObject;
046
047 /**
048 * Default constructor.
049 */
050 public BenefitsCalculation() {
051
052 }
053
054 /**
055 * Gets the universityFiscalYear attribute.
056 *
057 * @return Returns the universityFiscalYear
058 */
059 public Integer getUniversityFiscalYear() {
060 return universityFiscalYear;
061 }
062
063 /**
064 * Sets the universityFiscalYear attribute.
065 *
066 * @param universityFiscalYear The universityFiscalYear to set.
067 */
068 public void setUniversityFiscalYear(Integer universityFiscalYear) {
069 this.universityFiscalYear = universityFiscalYear;
070 }
071
072 /**
073 * Gets the chartOfAccountsCode attribute.
074 *
075 * @return Returns the chartOfAccountsCode
076 */
077 public String getChartOfAccountsCode() {
078 return chartOfAccountsCode;
079 }
080
081 /**
082 * Sets the chartOfAccountsCode attribute.
083 *
084 * @param chartOfAccountsCode The chartOfAccountsCode to set.
085 */
086 public void setChartOfAccountsCode(String chartOfAccountsCode) {
087 this.chartOfAccountsCode = chartOfAccountsCode;
088 }
089
090 /**
091 * Gets the positionBenefitTypeCode attribute.
092 *
093 * @return Returns the positionBenefitTypeCode
094 */
095 public String getPositionBenefitTypeCode() {
096 return positionBenefitTypeCode;
097 }
098
099 /**
100 * Sets the positionBenefitTypeCode attribute.
101 *
102 * @param positionBenefitTypeCode The positionBenefitTypeCode to set.
103 */
104 public void setPositionBenefitTypeCode(String positionBenefitTypeCode) {
105 this.positionBenefitTypeCode = positionBenefitTypeCode;
106 }
107
108 /**
109 * Gets the positionFringeBenefitPercent attribute.
110 *
111 * @return Returns the positionFringeBenefitPercent
112 */
113 public KualiPercent getPositionFringeBenefitPercent() {
114 return positionFringeBenefitPercent;
115 }
116
117 /**
118 * Sets the positionFringeBenefitPercent attribute.
119 *
120 * @param positionFringeBenefitPercent The positionFringeBenefitPercent to set.
121 */
122 public void setPositionFringeBenefitPercent(KualiPercent positionFringeBenefitPercent) {
123 this.positionFringeBenefitPercent = positionFringeBenefitPercent;
124 }
125
126 /**
127 * Gets the positionFringeBenefitObjectCode attribute.
128 *
129 * @return Returns the positionFringeBenefitObjectCode
130 */
131 public String getPositionFringeBenefitObjectCode() {
132 return positionFringeBenefitObjectCode;
133 }
134
135 /**
136 * Sets the positionFringeBenefitObjectCode attribute.
137 *
138 * @param positionFringeBenefitObjectCode The positionFringeBenefitObjectCode to set.
139 */
140 public void setPositionFringeBenefitObjectCode(String positionFringeBenefitObjectCode) {
141 this.positionFringeBenefitObjectCode = positionFringeBenefitObjectCode;
142 }
143
144 /**
145 * Gets the positionFringeBenefitObject attribute.
146 *
147 * @return Returns the positionFringeBenefitObject
148 */
149 public ObjectCode getPositionFringeBenefitObject() {
150 return positionFringeBenefitObject;
151 }
152
153 /**
154 * Sets the positionFringeBenefitObject attribute.
155 *
156 * @param positionFringeBenefitObject The positionFringeBenefitObject to set.
157 */
158 @Deprecated
159 public void setPositionFringeBenefitObject(ObjectCode positionFringeBenefitObject) {
160 this.positionFringeBenefitObject = positionFringeBenefitObject;
161 }
162
163 /**
164 * Gets the chartOfAccounts attribute.
165 *
166 * @return Returns the chartOfAccounts
167 */
168 public Chart getChartOfAccounts() {
169 return chartOfAccounts;
170 }
171
172 /**
173 * Sets the chartOfAccounts attribute.
174 *
175 * @param chartOfAccounts The chartOfAccounts to set.
176 */
177 @Deprecated
178 public void setChartOfAccounts(Chart chartOfAccounts) {
179 this.chartOfAccounts = chartOfAccounts;
180 }
181
182 /**
183 * Gets the positionBenefitType attribute.
184 *
185 * @return Returns the positionBenefitType.
186 */
187 public BenefitsType getPositionBenefitType() {
188 return positionBenefitType;
189 }
190
191 /**
192 * Sets the positionBenefitType attribute value.
193 *
194 * @param positionBenefitType The positionBenefitType to set.
195 */
196 @Deprecated
197 public void setPositionBenefitType(BenefitsType positionBenefitType) {
198 this.positionBenefitType = positionBenefitType;
199 }
200
201 /**
202 * Gets the laborObject
203 *
204 * @return Returns the laborObject.
205 */
206 public LaborObject getLaborObject() {
207 return laborObject;
208 }
209
210 /**
211 * Sets the laborObject
212 *
213 * @param laborObject The laborObject to set.
214 */
215 @Deprecated
216 public void setLaborObject(LaborObject laborObject) {
217 this.laborObject = laborObject;
218 }
219
220 /**
221 * Gets the universityFiscal attribute.
222 *
223 * @return Returns the universityFiscal.
224 */
225 public SystemOptions getUniversityFiscal() {
226 return universityFiscal;
227 }
228
229 /**
230 * Sets the universityFiscal attribute value.
231 *
232 * @param universityFiscal The universityFiscal to set.
233 */
234 public void setUniversityFiscal(SystemOptions universityFiscal) {
235 this.universityFiscal = universityFiscal;
236 }
237
238 /**
239 * This method (a hack by any other name...) returns a string so that an Labor Benefits Calculation can have a link to view its own
240 * inquiry page after a look up
241 *
242 * @return the String "View Labor Benefits Calculation"
243 */
244 public String getLaborBenefitsCalculationViewer() {
245 return "View Labor Benefits Calculation";
246 }
247
248 /**
249 * Gets the active attribute.
250 *
251 * @return Returns the active.
252 */
253 public boolean isActive() {
254 return active;
255 }
256
257 /**
258 * Sets the active attribute value.
259 *
260 * @param active The active to set.
261 */
262 public void setActive(boolean active) {
263 this.active = active;
264 }
265
266 /**
267 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
268 */
269 protected LinkedHashMap toStringMapper() {
270 LinkedHashMap m = new LinkedHashMap();
271 if (this.universityFiscalYear != null) {
272 m.put("universityFiscalYear", this.universityFiscalYear.toString());
273 }
274 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
275 m.put("positionBenefitTypeCode", this.positionBenefitTypeCode);
276
277 return m;
278 }
279
280 /**
281 * @see org.kuali.kfs.integration.businessobject.LaborLedgerBenefitsCalculation#getLaborLedgerBenefitsType()
282 */
283 public LaborLedgerBenefitsType getLaborLedgerBenefitsType() {
284 return this.getPositionBenefitType();
285 }
286
287 /**
288 * @see org.kuali.kfs.integration.businessobject.LaborLedgerBenefitsCalculation#setLaborLedgerBenefitsType(org.kuali.module.labor.bo.LaborLedgerBenefitsType)
289 */
290 public void setLaborLedgerBenefitsType(LaborLedgerBenefitsType laborLedgerBenefitsType) {
291 this.setPositionBenefitType((BenefitsType)laborLedgerBenefitsType);
292 }
293 }