View Javadoc
1   /*
2    * Copyright 2005-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.sql.Timestamp;
19  import java.util.LinkedHashMap;
20  
21  import org.kuali.rice.core.api.util.type.KualiDecimal;
22  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
23  
24  /**
25   * This class represents an Internal Billing Item business object.
26   */
27  public class InternalBillingItem extends PersistableBusinessObjectBase {
28  
29      private static final long serialVersionUID = -2830091652446423539L;
30      private String documentNumber;
31      private Integer itemSequenceId;
32      private String itemStockNumber;
33      private String itemStockDescription;
34      private Timestamp itemServiceDate;
35      private Integer itemQuantity;
36      private KualiDecimal itemUnitAmount;
37      private String unitOfMeasureCode;
38  
39      /**
40       * Constructs a InternalBillingItem.
41       */
42      public InternalBillingItem() {
43          setItemUnitAmount(KualiDecimal.ZERO);
44      }
45  
46  
47      /**
48       * Gets the documentNumber attribute.
49       * 
50       * @return Returns the documentNumber.
51       */
52      public String getDocumentNumber() {
53          return documentNumber;
54      }
55  
56  
57      /**
58       * Sets the documentNumber attribute value.
59       * 
60       * @param documentNumber The documentNumber to set.
61       */
62      public void setDocumentNumber(String documentNumber) {
63          this.documentNumber = documentNumber;
64      }
65  
66  
67      /**
68       * Gets the itemQuantity attribute.
69       * 
70       * @return Returns the itemQuantity.
71       */
72      public Integer getItemQuantity() {
73          return itemQuantity;
74      }
75  
76  
77      /**
78       * Sets the itemQuantity attribute value.
79       * 
80       * @param itemQuantity The itemQuantity to set.
81       */
82      public void setItemQuantity(Integer itemQuantity) {
83          this.itemQuantity = itemQuantity;
84      }
85  
86  
87      /**
88       * Gets the itemSequenceId attribute.
89       * 
90       * @return Returns the itemSequenceId.
91       */
92      public Integer getItemSequenceId() {
93          return itemSequenceId;
94      }
95  
96  
97      /**
98       * Sets the itemSequenceId attribute value.
99       * 
100      * @param itemSequenceId The itemSequenceId to set.
101      */
102     public void setItemSequenceId(Integer itemSequenceId) {
103         this.itemSequenceId = itemSequenceId;
104     }
105 
106 
107     /**
108      * Gets the itemServiceDate attribute.
109      * 
110      * @return Returns the itemServiceDate.
111      */
112     public Timestamp getItemServiceDate() {
113         return itemServiceDate;
114     }
115 
116 
117     /**
118      * Sets the itemServiceDate attribute value.
119      * 
120      * @param itemServiceDate The itemServiceDate to set.
121      */
122     public void setItemServiceDate(Timestamp itemServiceDate) {
123         this.itemServiceDate = itemServiceDate;
124     }
125 
126 
127     /**
128      * Gets the itemStockDescription attribute.
129      * 
130      * @return Returns the itemStockDescription.
131      */
132     public String getItemStockDescription() {
133         return itemStockDescription;
134     }
135 
136 
137     /**
138      * Sets the itemStockDescription attribute value.
139      * 
140      * @param itemStockDescription The itemStockDescription to set.
141      */
142     public void setItemStockDescription(String itemStockDescription) {
143         this.itemStockDescription = itemStockDescription;
144     }
145 
146 
147     /**
148      * Gets the itemStockNumber attribute.
149      * 
150      * @return Returns the itemStockNumber.
151      */
152     public String getItemStockNumber() {
153         return itemStockNumber;
154     }
155 
156 
157     /**
158      * Sets the itemStockNumber attribute value.
159      * 
160      * @param itemStockNumber The itemStockNumber to set.
161      */
162     public void setItemStockNumber(String itemStockNumber) {
163         this.itemStockNumber = itemStockNumber;
164     }
165 
166 
167     /**
168      * Gets the itemUnitAmount attribute.
169      * 
170      * @return Returns the itemUnitAmount.
171      */
172     public KualiDecimal getItemUnitAmount() {
173         return itemUnitAmount;
174     }
175 
176 
177     /**
178      * Sets the itemUnitAmount attribute value.
179      * 
180      * @param itemUnitAmount The itemUnitAmount to set.
181      */
182     public void setItemUnitAmount(KualiDecimal itemUnitAmount) {
183         this.itemUnitAmount = itemUnitAmount;
184     }
185 
186 
187     /**
188      * Gets the unitOfMeasureCode attribute.
189      * 
190      * @return Returns the unitOfMeasureCode.
191      */
192     public String getUnitOfMeasureCode() {
193         return unitOfMeasureCode;
194     }
195 
196 
197     /**
198      * Sets the unitOfMeasureCode attribute value.
199      * 
200      * @param unitOfMeasureCode The unitOfMeasureCode to set.
201      */
202     public void setUnitOfMeasureCode(String unitOfMeasureCode) {
203         this.unitOfMeasureCode = unitOfMeasureCode;
204     }
205 
206 
207     /**
208      * @return the total amount for this item
209      */
210     public KualiDecimal getTotal() {
211         KualiDecimal total = new KualiDecimal(itemQuantity.toString());
212         return total.multiply(itemUnitAmount);
213     }
214 
215 
216     /**
217      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
218      */
219     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
220         LinkedHashMap m = new LinkedHashMap();
221 
222         m.put("docHeaderId", getDocumentNumber());
223         m.put("itemSequenceId", getItemSequenceId());
224 
225         return m;
226     }
227 }