001: /*
002: * Copyright 2005-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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: package org.kuali.module.financial.bo;
017:
018: import java.sql.Timestamp;
019: import java.util.LinkedHashMap;
020:
021: import org.kuali.core.bo.PersistableBusinessObjectBase;
022: import org.kuali.core.util.KualiDecimal;
023:
024: /**
025: * This class represents an Internal Billing Item business object.
026: */
027: public class InternalBillingItem extends PersistableBusinessObjectBase {
028:
029: private static final long serialVersionUID = -2830091652446423539L;
030: private String documentNumber;
031: private Integer itemSequenceId;
032: private String itemStockNumber;
033: private String itemStockDescription;
034: private Timestamp itemServiceDate;
035: private Integer itemQuantity;
036: private KualiDecimal itemUnitAmount;
037: private String unitOfMeasureCode;
038:
039: /**
040: * Constructs a InternalBillingItem.
041: */
042: public InternalBillingItem() {
043: setItemUnitAmount(new KualiDecimal(0));
044: }
045:
046: /**
047: * Gets the documentNumber attribute.
048: *
049: * @return Returns the documentNumber.
050: */
051: public String getDocumentNumber() {
052: return documentNumber;
053: }
054:
055: /**
056: * Sets the documentNumber attribute value.
057: *
058: * @param documentNumber The documentNumber to set.
059: */
060: public void setDocumentNumber(String documentNumber) {
061: this .documentNumber = documentNumber;
062: }
063:
064: /**
065: * Gets the itemQuantity attribute.
066: *
067: * @return Returns the itemQuantity.
068: */
069: public Integer getItemQuantity() {
070: return itemQuantity;
071: }
072:
073: /**
074: * Sets the itemQuantity attribute value.
075: *
076: * @param itemQuantity The itemQuantity to set.
077: */
078: public void setItemQuantity(Integer itemQuantity) {
079: this .itemQuantity = itemQuantity;
080: }
081:
082: /**
083: * Gets the itemSequenceId attribute.
084: *
085: * @return Returns the itemSequenceId.
086: */
087: public Integer getItemSequenceId() {
088: return itemSequenceId;
089: }
090:
091: /**
092: * Sets the itemSequenceId attribute value.
093: *
094: * @param itemSequenceId The itemSequenceId to set.
095: */
096: public void setItemSequenceId(Integer itemSequenceId) {
097: this .itemSequenceId = itemSequenceId;
098: }
099:
100: /**
101: * Gets the itemServiceDate attribute.
102: *
103: * @return Returns the itemServiceDate.
104: */
105: public Timestamp getItemServiceDate() {
106: return itemServiceDate;
107: }
108:
109: /**
110: * Sets the itemServiceDate attribute value.
111: *
112: * @param itemServiceDate The itemServiceDate to set.
113: */
114: public void setItemServiceDate(Timestamp itemServiceDate) {
115: this .itemServiceDate = itemServiceDate;
116: }
117:
118: /**
119: * Gets the itemStockDescription attribute.
120: *
121: * @return Returns the itemStockDescription.
122: */
123: public String getItemStockDescription() {
124: return itemStockDescription;
125: }
126:
127: /**
128: * Sets the itemStockDescription attribute value.
129: *
130: * @param itemStockDescription The itemStockDescription to set.
131: */
132: public void setItemStockDescription(String itemStockDescription) {
133: this .itemStockDescription = itemStockDescription;
134: }
135:
136: /**
137: * Gets the itemStockNumber attribute.
138: *
139: * @return Returns the itemStockNumber.
140: */
141: public String getItemStockNumber() {
142: return itemStockNumber;
143: }
144:
145: /**
146: * Sets the itemStockNumber attribute value.
147: *
148: * @param itemStockNumber The itemStockNumber to set.
149: */
150: public void setItemStockNumber(String itemStockNumber) {
151: this .itemStockNumber = itemStockNumber;
152: }
153:
154: /**
155: * Gets the itemUnitAmount attribute.
156: *
157: * @return Returns the itemUnitAmount.
158: */
159: public KualiDecimal getItemUnitAmount() {
160: return itemUnitAmount;
161: }
162:
163: /**
164: * Sets the itemUnitAmount attribute value.
165: *
166: * @param itemUnitAmount The itemUnitAmount to set.
167: */
168: public void setItemUnitAmount(KualiDecimal itemUnitAmount) {
169: this .itemUnitAmount = itemUnitAmount;
170: }
171:
172: /**
173: * Gets the unitOfMeasureCode attribute.
174: *
175: * @return Returns the unitOfMeasureCode.
176: */
177: public String getUnitOfMeasureCode() {
178: return unitOfMeasureCode;
179: }
180:
181: /**
182: * Sets the unitOfMeasureCode attribute value.
183: *
184: * @param unitOfMeasureCode The unitOfMeasureCode to set.
185: */
186: public void setUnitOfMeasureCode(String unitOfMeasureCode) {
187: this .unitOfMeasureCode = unitOfMeasureCode;
188: }
189:
190: /**
191: * @return the total amount for this item
192: */
193: public KualiDecimal getTotal() {
194: KualiDecimal total = new KualiDecimal(itemQuantity.toString());
195: return total.multiply(itemUnitAmount);
196: }
197:
198: /**
199: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
200: */
201: protected LinkedHashMap toStringMapper() {
202: LinkedHashMap m = new LinkedHashMap();
203:
204: m.put("docHeaderId", getDocumentNumber());
205: m.put("itemSequenceId", getItemSequenceId());
206:
207: return m;
208: }
209: }
|