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.gl.businessobject;
17  
18  import org.kuali.rice.core.api.util.type.KualiDecimal;
19  
20  /**
21   * This class represents a G/L Summary object which contains monthly amounts
22   */
23  public class GlSummary extends Balance{
24      
25      /**
26       * Constructs a GlSummary.java.
27       */
28      public GlSummary() {
29          super();
30      }
31  
32      /**
33       * Constructs a GlSummary.java.
34       * @param data
35       */
36      public GlSummary(Object[] data) {
37          this.setFundGroup((String) data[0]);
38  
39          this.setAccountLineAnnualBalanceAmount((KualiDecimal) data[1]);
40          this.setBeginningBalanceLineAmount((KualiDecimal) data[2]);
41          this.setContractsGrantsBeginningBalanceAmount((KualiDecimal) data[3]);
42          this.setMonth1Amount((KualiDecimal) data[4]);
43          this.setMonth2Amount((KualiDecimal) data[5]);
44          this.setMonth3Amount((KualiDecimal) data[6]);
45          this.setMonth4Amount((KualiDecimal) data[7]);
46          this.setMonth5Amount((KualiDecimal) data[8]);
47          this.setMonth6Amount((KualiDecimal) data[9]);
48          this.setMonth7Amount((KualiDecimal) data[10]);
49          this.setMonth8Amount((KualiDecimal) data[11]);
50          this.setMonth9Amount((KualiDecimal) data[12]);
51          this.setMonth10Amount((KualiDecimal) data[13]);
52          this.setMonth11Amount((KualiDecimal) data[14]);
53          this.setMonth12Amount((KualiDecimal) data[15]);
54          this.setMonth13Amount((KualiDecimal) data[16]);
55      }
56  
57      /**
58       * @param anotherSummary
59       */
60      public void add(GlSummary anotherSummary) {
61          setBeginningBalanceLineAmount(getBeginningBalanceLineAmount().add(anotherSummary.getBeginningBalanceLineAmount()));
62          setContractsGrantsBeginningBalanceAmount(getContractsGrantsBeginningBalanceAmount().add(anotherSummary.getContractsGrantsBeginningBalanceAmount()));
63          setAccountLineAnnualBalanceAmount(getAccountLineAnnualBalanceAmount().add(anotherSummary.getAccountLineAnnualBalanceAmount()));
64          setMonth1Amount(getMonth1Amount().add(anotherSummary.getMonth1Amount()));
65          setMonth2Amount(getMonth2Amount().add(anotherSummary.getMonth2Amount()));
66          setMonth3Amount(getMonth3Amount().add(anotherSummary.getMonth3Amount()));
67          setMonth4Amount(getMonth4Amount().add(anotherSummary.getMonth4Amount()));
68          setMonth5Amount(getMonth5Amount().add(anotherSummary.getMonth5Amount()));
69          setMonth6Amount(getMonth6Amount().add(anotherSummary.getMonth6Amount()));
70          setMonth7Amount(getMonth7Amount().add(anotherSummary.getMonth7Amount()));
71          setMonth8Amount(getMonth8Amount().add(anotherSummary.getMonth8Amount()));
72          setMonth9Amount(getMonth9Amount().add(anotherSummary.getMonth9Amount()));
73          setMonth10Amount(getMonth10Amount().add(anotherSummary.getMonth10Amount()));
74          setMonth11Amount(getMonth11Amount().add(anotherSummary.getMonth11Amount()));
75          setMonth12Amount(getMonth12Amount().add(anotherSummary.getMonth12Amount()));
76          setMonth13Amount(getMonth13Amount().add(anotherSummary.getMonth13Amount()));
77      }
78  
79      /**
80       * @see org.kuali.ole.gl.businessobject.Balance#getYearBalance()
81       */
82      @Override
83      public KualiDecimal getYearBalance() {
84          KualiDecimal yearbalance = KualiDecimal.ZERO;
85          
86          yearbalance = yearbalance.add(this.getMonth1Amount());
87          yearbalance = yearbalance.add(this.getMonth2Amount());
88          yearbalance = yearbalance.add(this.getMonth3Amount());
89          yearbalance = yearbalance.add(this.getMonth4Amount());
90          yearbalance = yearbalance.add(this.getMonth5Amount());
91          yearbalance = yearbalance.add(this.getMonth6Amount());
92          yearbalance = yearbalance.add(this.getMonth7Amount());
93          yearbalance = yearbalance.add(this.getMonth8Amount());
94          yearbalance = yearbalance.add(this.getMonth9Amount());
95          yearbalance = yearbalance.add(this.getMonth10Amount());
96          yearbalance = yearbalance.add(this.getMonth11Amount());
97          yearbalance = yearbalance.add(this.getMonth12Amount());
98          yearbalance = yearbalance.add(this.getMonth13Amount());
99          
100         return yearbalance;
101     }
102 
103     /**
104      * @see org.kuali.ole.gl.businessobject.Balance#getYearToDayBalance()
105      */
106     @Override
107     public KualiDecimal getYearToDayBalance() {
108         KualiDecimal yearToDayBalance = KualiDecimal.ZERO;
109         
110         yearToDayBalance = yearToDayBalance.add(this.getAccountLineAnnualBalanceAmount());
111         yearToDayBalance = yearToDayBalance.add(this.getBeginningBalanceLineAmount());
112         yearToDayBalance = yearToDayBalance.add(this.getContractsGrantsBeginningBalanceAmount());        
113         
114         return yearToDayBalance;
115     }
116     
117     
118 }