View Javadoc
1   /*
2    * Copyright 2006 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.fp.businessobject;
17  
18  import java.util.Map;
19  
20  import org.kuali.ole.sys.businessobject.AccountingLine;
21  import org.kuali.ole.sys.businessobject.SourceAccountingLine;
22  import org.kuali.rice.core.api.util.type.KualiDecimal;
23  import org.kuali.rice.core.api.util.type.KualiInteger;
24  
25  
26  /**
27   * Special case <code>{@link SourceAccountingLine}</code> type for
28   * <code>{@link org.kuali.ole.fp.document.BudgetAdjustmentDocument}</code>
29   */
30  public class BudgetAdjustmentSourceAccountingLine extends SourceAccountingLine implements BudgetAdjustmentAccountingLine {
31  
32      private String budgetAdjustmentPeriodCode;
33      private KualiDecimal currentBudgetAdjustmentAmount;
34      private KualiDecimal baseBudgetAdjustmentAmount;
35      private KualiDecimal financialDocumentMonth1LineAmount;
36      private KualiDecimal financialDocumentMonth2LineAmount;
37      private KualiDecimal financialDocumentMonth3LineAmount;
38      private KualiDecimal financialDocumentMonth4LineAmount;
39      private KualiDecimal financialDocumentMonth5LineAmount;
40      private KualiDecimal financialDocumentMonth6LineAmount;
41      private KualiDecimal financialDocumentMonth7LineAmount;
42      private KualiDecimal financialDocumentMonth8LineAmount;
43      private KualiDecimal financialDocumentMonth9LineAmount;
44      private KualiDecimal financialDocumentMonth10LineAmount;
45      private KualiDecimal financialDocumentMonth11LineAmount;
46      private KualiDecimal financialDocumentMonth12LineAmount;
47      private boolean fringeBenefitIndicator;
48  
49      public BudgetAdjustmentSourceAccountingLine() {
50          super();
51          BudgetAdjustmentAccountingLineUtil.init(this);
52      }
53  
54      /**
55       * @see org.kuali.rice.krad.bo.AccountingLineBase#getValuesMap()
56       */
57      @Override
58      public Map getValuesMap() {
59          Map simpleValues = super.getValuesMap();
60          simpleValues.remove("amount"); // remove the amount key; we'll use base and current instead
61          BudgetAdjustmentAccountingLineUtil.appendToValuesMap(simpleValues, this);
62          return simpleValues;
63      }
64  
65      /**
66       * @see org.kuali.rice.krad.bo.AccountingLineBase#copyFrom(org.kuali.rice.krad.bo.AccountingLine)
67       */
68      @Override
69      public void copyFrom(AccountingLine other) {
70          super.copyFrom(other);
71          BudgetAdjustmentAccountingLineUtil.copyFrom(this, other);
72      }
73  
74      /**
75       * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getMonthlyLinesTotal()
76       */
77      public KualiDecimal getMonthlyLinesTotal() {
78          return BudgetAdjustmentAccountingLineUtil.getMonthlyLinesTotal(this);
79      }
80  
81      /**
82       * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getBaseBudgetAdjustmentAmount()
83       */
84      public KualiDecimal getBaseBudgetAdjustmentAmount() {
85          return baseBudgetAdjustmentAmount;
86      }
87  
88      /**
89       * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setBaseBudgetAdjustmentAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
90       */
91      public void setBaseBudgetAdjustmentAmount(KualiInteger baseBudgetAdjustmentAmount) {
92          if (baseBudgetAdjustmentAmount != null) {
93              this.baseBudgetAdjustmentAmount = new KualiDecimal(baseBudgetAdjustmentAmount.bigDecimalValue());
94  
95          }
96      }
97  
98      public void setBaseBudgetAdjustmentAmount(KualiDecimal baseBudgetAdjustmentAmount) {
99          if (baseBudgetAdjustmentAmount != null) {
100             this.baseBudgetAdjustmentAmount = baseBudgetAdjustmentAmount;
101             //this.baseBudgetAdjustmentAmount = new KualiInteger(baseBudgetAdjustmentAmount.bigDecimalValue());
102         }
103     }
104 
105     /**
106      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getBudgetAdjustmentPeriodCode()
107      */
108     public String getBudgetAdjustmentPeriodCode() {
109         return budgetAdjustmentPeriodCode;
110     }
111 
112     /**
113      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setBudgetAdjustmentPeriodCode(java.lang.String)
114      */
115     public void setBudgetAdjustmentPeriodCode(String budgetAdjustmentPeriodCode) {
116         this.budgetAdjustmentPeriodCode = budgetAdjustmentPeriodCode;
117     }
118 
119     /**
120      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getCurrentBudgetAdjustmentAmount()
121      */
122     public KualiDecimal getCurrentBudgetAdjustmentAmount() {
123         return currentBudgetAdjustmentAmount;
124     }
125 
126     /**
127      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setCurrentBudgetAdjustmentAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
128      */
129     public void setCurrentBudgetAdjustmentAmount(KualiDecimal currentBudgetAdjustmentAmount) {
130         if (currentBudgetAdjustmentAmount != null) {
131             this.currentBudgetAdjustmentAmount = currentBudgetAdjustmentAmount;
132         }
133     }
134 
135     /**
136      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth1LineAmount()
137      */
138     public KualiDecimal getFinancialDocumentMonth1LineAmount() {
139         return financialDocumentMonth1LineAmount;
140     }
141 
142     /**
143      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth1LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
144      */
145     public void setFinancialDocumentMonth1LineAmount(KualiDecimal financialDocumentMonth1LineAmount) {
146         if (financialDocumentMonth1LineAmount != null) {
147             this.financialDocumentMonth1LineAmount = financialDocumentMonth1LineAmount;
148         }
149     }
150 
151 
152     /**
153      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth2LineAmount()
154      */
155     public KualiDecimal getFinancialDocumentMonth2LineAmount() {
156         return financialDocumentMonth2LineAmount;
157     }
158 
159     /**
160      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth2LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
161      */
162     public void setFinancialDocumentMonth2LineAmount(KualiDecimal financialDocumentMonth2LineAmount) {
163         if (financialDocumentMonth2LineAmount != null) {
164             this.financialDocumentMonth2LineAmount = financialDocumentMonth2LineAmount;
165         }
166     }
167 
168 
169     /**
170      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth3LineAmount()
171      */
172     public KualiDecimal getFinancialDocumentMonth3LineAmount() {
173         return financialDocumentMonth3LineAmount;
174     }
175 
176     /**
177      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth3LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
178      */
179     public void setFinancialDocumentMonth3LineAmount(KualiDecimal financialDocumentMonth3LineAmount) {
180         if (financialDocumentMonth3LineAmount != null) {
181             this.financialDocumentMonth3LineAmount = financialDocumentMonth3LineAmount;
182         }
183     }
184 
185 
186     /**
187      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth4LineAmount()
188      */
189     public KualiDecimal getFinancialDocumentMonth4LineAmount() {
190         return financialDocumentMonth4LineAmount;
191     }
192 
193     /**
194      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth4LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
195      */
196     public void setFinancialDocumentMonth4LineAmount(KualiDecimal financialDocumentMonth4LineAmount) {
197         if (financialDocumentMonth4LineAmount != null) {
198             this.financialDocumentMonth4LineAmount = financialDocumentMonth4LineAmount;
199         }
200     }
201 
202 
203     /**
204      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth5LineAmount()
205      */
206     public KualiDecimal getFinancialDocumentMonth5LineAmount() {
207         return financialDocumentMonth5LineAmount;
208     }
209 
210     /**
211      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth5LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
212      */
213     public void setFinancialDocumentMonth5LineAmount(KualiDecimal financialDocumentMonth5LineAmount) {
214         if (financialDocumentMonth5LineAmount != null) {
215             this.financialDocumentMonth5LineAmount = financialDocumentMonth5LineAmount;
216         }
217     }
218 
219     /**
220      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth6LineAmount()
221      */
222     public KualiDecimal getFinancialDocumentMonth6LineAmount() {
223         return financialDocumentMonth6LineAmount;
224     }
225 
226     /**
227      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth6LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
228      */
229     public void setFinancialDocumentMonth6LineAmount(KualiDecimal financialDocumentMonth6LineAmount) {
230         if (financialDocumentMonth6LineAmount != null) {
231             this.financialDocumentMonth6LineAmount = financialDocumentMonth6LineAmount;
232         }
233     }
234 
235     /**
236      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth7LineAmount()
237      */
238     public KualiDecimal getFinancialDocumentMonth7LineAmount() {
239         return financialDocumentMonth7LineAmount;
240     }
241 
242     /**
243      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth7LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
244      */
245     public void setFinancialDocumentMonth7LineAmount(KualiDecimal financialDocumentMonth7LineAmount) {
246         if (financialDocumentMonth7LineAmount != null) {
247             this.financialDocumentMonth7LineAmount = financialDocumentMonth7LineAmount;
248         }
249     }
250 
251     /**
252      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth8LineAmount()
253      */
254     public KualiDecimal getFinancialDocumentMonth8LineAmount() {
255         return financialDocumentMonth8LineAmount;
256     }
257 
258     /**
259      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth8LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
260      */
261     public void setFinancialDocumentMonth8LineAmount(KualiDecimal financialDocumentMonth8LineAmount) {
262         if (financialDocumentMonth8LineAmount != null) {
263             this.financialDocumentMonth8LineAmount = financialDocumentMonth8LineAmount;
264         }
265     }
266 
267     /**
268      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth9LineAmount()
269      */
270     public KualiDecimal getFinancialDocumentMonth9LineAmount() {
271         return financialDocumentMonth9LineAmount;
272     }
273 
274     /**
275      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth9LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
276      */
277     public void setFinancialDocumentMonth9LineAmount(KualiDecimal financialDocumentMonth9LineAmount) {
278         if (financialDocumentMonth9LineAmount != null) {
279             this.financialDocumentMonth9LineAmount = financialDocumentMonth9LineAmount;
280         }
281     }
282 
283     /**
284      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth10LineAmount()
285      */
286     public KualiDecimal getFinancialDocumentMonth10LineAmount() {
287         return financialDocumentMonth10LineAmount;
288     }
289 
290     /**
291      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth10LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
292      */
293     public void setFinancialDocumentMonth10LineAmount(KualiDecimal financialDocumentMonth10LineAmount) {
294         if (financialDocumentMonth10LineAmount != null) {
295             this.financialDocumentMonth10LineAmount = financialDocumentMonth10LineAmount;
296         }
297     }
298 
299     /**
300      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth11LineAmount()
301      */
302     public KualiDecimal getFinancialDocumentMonth11LineAmount() {
303         return financialDocumentMonth11LineAmount;
304     }
305 
306     /**
307      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth11LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
308      */
309     public void setFinancialDocumentMonth11LineAmount(KualiDecimal financialDocumentMonth11LineAmount) {
310         if (financialDocumentMonth11LineAmount != null) {
311             this.financialDocumentMonth11LineAmount = financialDocumentMonth11LineAmount;
312         }
313     }
314 
315 
316     /**
317      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#getFinancialDocumentMonth12LineAmount()
318      */
319     public KualiDecimal getFinancialDocumentMonth12LineAmount() {
320         return financialDocumentMonth12LineAmount;
321     }
322 
323     /**
324      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#setFinancialDocumentMonth12LineAmount(org.kuali.rice.core.api.util.type.KualiDecimal)
325      */
326     public void setFinancialDocumentMonth12LineAmount(KualiDecimal financialDocumentMonth12LineAmount) {
327         if (financialDocumentMonth12LineAmount != null) {
328             this.financialDocumentMonth12LineAmount = financialDocumentMonth12LineAmount;
329         }
330     }
331 
332     /**
333      * Gets the fringeBenefitIndicator attribute.
334      * 
335      * @return Returns the fringeBenefitIndicator.
336      */
337     public boolean isFringeBenefitIndicator() {
338         return fringeBenefitIndicator;
339     }
340 
341     /**
342      * Sets the fringeBenefitIndicator attribute value.
343      * 
344      * @param fringeBenefitIndicator The fringeBenefitIndicator to set.
345      */
346     public void setFringeBenefitIndicator(boolean fringeBenefitIndicator) {
347         this.fringeBenefitIndicator = fringeBenefitIndicator;
348     }
349 
350     /**
351      * @see org.kuali.ole.fp.businessobject.BudgetAdjustmentAccountingLine#clearFinancialDocumentMonthLineAmounts()
352      */
353     public void clearFinancialDocumentMonthLineAmounts() {
354         financialDocumentMonth1LineAmount = KualiDecimal.ZERO;
355         financialDocumentMonth2LineAmount = KualiDecimal.ZERO;
356         financialDocumentMonth3LineAmount = KualiDecimal.ZERO;
357         financialDocumentMonth4LineAmount = KualiDecimal.ZERO;
358         financialDocumentMonth5LineAmount = KualiDecimal.ZERO;
359         financialDocumentMonth6LineAmount = KualiDecimal.ZERO;
360         financialDocumentMonth7LineAmount = KualiDecimal.ZERO;
361         financialDocumentMonth8LineAmount = KualiDecimal.ZERO;
362         financialDocumentMonth9LineAmount = KualiDecimal.ZERO;
363         financialDocumentMonth10LineAmount = KualiDecimal.ZERO;
364         financialDocumentMonth11LineAmount = KualiDecimal.ZERO;
365         financialDocumentMonth12LineAmount = KualiDecimal.ZERO;
366     }
367 
368     /**
369      * @see org.kuali.ole.sys.businessobject.AccountingLineBase#isSourceAccountingLine()
370      */
371     @Override
372     public boolean isSourceAccountingLine() {
373         return true;
374     }
375 
376     /**
377      * @see org.kuali.ole.sys.businessobject.AccountingLineBase#isTargetAccountingLine()
378      */
379     @Override
380     public boolean isTargetAccountingLine() {
381         return false;
382     }
383     
384     
385 }