001: /*
002: * Copyright 2006-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:
017: package org.kuali.module.kra.routingform.bo;
018:
019: import java.sql.Date;
020: import java.util.LinkedHashMap;
021:
022: import org.kuali.core.bo.PersistableBusinessObjectBase;
023: import org.kuali.core.util.KualiInteger;
024: import org.kuali.kfs.KFSPropertyConstants;
025:
026: /**
027: *
028: */
029: public class RoutingFormBudget extends PersistableBusinessObjectBase {
030:
031: private String documentNumber;
032: private Integer routingFormBudgetMaximumPeriodNumber;
033: private Integer routingFormBudgetMinimumPeriodNumber;
034: private String routingFormBudgetIndirectCostDescription;
035:
036: private KualiInteger routingFormBudgetDirectAmount;
037: private KualiInteger routingFormBudgetTotalDirectAmount;
038: private KualiInteger routingFormBudgetIndirectCostAmount;
039: private KualiInteger routingFormBudgetTotalIndirectCostAmount;
040:
041: private Date routingFormBudgetEndDate;
042: private Date routingFormBudgetStartDate;
043: private Date routingFormBudgetTotalEndDate;
044: private Date routingFormBudgetTotalStartDate;
045:
046: /**
047: * Default constructor.
048: */
049: public RoutingFormBudget() {
050:
051: }
052:
053: /**
054: * Gets the documentNumber attribute.
055: *
056: * @return Returns the documentNumber
057: */
058: public String getDocumentNumber() {
059: return documentNumber;
060: }
061:
062: /**
063: * Sets the documentNumber attribute.
064: *
065: * @param documentNumber The documentNumber to set.
066: */
067: public void setDocumentNumber(String documentNumber) {
068: this .documentNumber = documentNumber;
069: }
070:
071: /**
072: * Gets the routingFormBudgetMaximumPeriodNumber attribute.
073: *
074: * @return Returns the routingFormBudgetMaximumPeriodNumber
075: */
076: public Integer getRoutingFormBudgetMaximumPeriodNumber() {
077: return routingFormBudgetMaximumPeriodNumber;
078: }
079:
080: /**
081: * Sets the routingFormBudgetMaximumPeriodNumber attribute.
082: *
083: * @param routingFormBudgetMaximumPeriodNumber The routingFormBudgetMaximumPeriodNumber to set.
084: */
085: public void setRoutingFormBudgetMaximumPeriodNumber(
086: Integer routingFormBudgetMaximumPeriodNumber) {
087: this .routingFormBudgetMaximumPeriodNumber = routingFormBudgetMaximumPeriodNumber;
088: }
089:
090: /**
091: * Gets the routingFormBudgetMinimumPeriodNumber attribute.
092: *
093: * @return Returns the routingFormBudgetMinimumPeriodNumber
094: */
095: public Integer getRoutingFormBudgetMinimumPeriodNumber() {
096: return routingFormBudgetMinimumPeriodNumber;
097: }
098:
099: /**
100: * Sets the routingFormBudgetMinimumPeriodNumber attribute.
101: *
102: * @param routingFormBudgetMinimumPeriodNumber The routingFormBudgetMinimumPeriodNumber to set.
103: */
104: public void setRoutingFormBudgetMinimumPeriodNumber(
105: Integer routingFormBudgetMinimumPeriodNumber) {
106: this .routingFormBudgetMinimumPeriodNumber = routingFormBudgetMinimumPeriodNumber;
107: }
108:
109: /**
110: * Gets the routingFormBudgetDirectAmount attribute.
111: *
112: * @return Returns the routingFormBudgetDirectAmount
113: */
114: public KualiInteger getRoutingFormBudgetDirectAmount() {
115: return routingFormBudgetDirectAmount;
116: }
117:
118: /**
119: * Sets the routingFormBudgetDirectAmount attribute.
120: *
121: * @param routingFormBudgetDirectAmount The routingFormBudgetDirectAmount to set.
122: */
123: public void setRoutingFormBudgetDirectAmount(
124: KualiInteger routingFormBudgetDirectAmount) {
125: this .routingFormBudgetDirectAmount = routingFormBudgetDirectAmount;
126: }
127:
128: /**
129: * Gets the routingFormBudgetEndDate attribute.
130: *
131: * @return Returns the routingFormBudgetEndDate
132: */
133: public Date getRoutingFormBudgetEndDate() {
134: return routingFormBudgetEndDate;
135: }
136:
137: /**
138: * Sets the routingFormBudgetEndDate attribute.
139: *
140: * @param routingFormBudgetEndDate The routingFormBudgetEndDate to set.
141: */
142: public void setRoutingFormBudgetEndDate(
143: Date routingFormBudgetEndDate) {
144: this .routingFormBudgetEndDate = routingFormBudgetEndDate;
145: }
146:
147: /**
148: * Gets the routingFormBudgetIndirectCostAmount attribute.
149: *
150: * @return Returns the routingFormBudgetIndirectCostAmount
151: */
152: public KualiInteger getRoutingFormBudgetIndirectCostAmount() {
153: return routingFormBudgetIndirectCostAmount;
154: }
155:
156: /**
157: * Sets the routingFormBudgetIndirectCostAmount attribute.
158: *
159: * @param routingFormBudgetIndirectCostAmount The routingFormBudgetIndirectCostAmount to set.
160: */
161: public void setRoutingFormBudgetIndirectCostAmount(
162: KualiInteger routingFormBudgetIndirectCostAmount) {
163: this .routingFormBudgetIndirectCostAmount = routingFormBudgetIndirectCostAmount;
164: }
165:
166: /**
167: * Gets the routingFormBudgetIndirectCostDescription attribute.
168: *
169: * @return Returns the routingFormBudgetIndirectCostDescription
170: */
171: public String getRoutingFormBudgetIndirectCostDescription() {
172: return routingFormBudgetIndirectCostDescription;
173: }
174:
175: /**
176: * Sets the routingFormBudgetIndirectCostDescription attribute.
177: *
178: * @param routingFormBudgetIndirectCostDescription The routingFormBudgetIndirectCostDescription to set.
179: */
180: public void setRoutingFormBudgetIndirectCostDescription(
181: String routingFormBudgetIndirectCostDescription) {
182: this .routingFormBudgetIndirectCostDescription = routingFormBudgetIndirectCostDescription;
183: }
184:
185: /**
186: * Gets the routingFormBudgetStartDate attribute.
187: *
188: * @return Returns the routingFormBudgetStartDate
189: */
190: public Date getRoutingFormBudgetStartDate() {
191: return routingFormBudgetStartDate;
192: }
193:
194: /**
195: * Sets the routingFormBudgetStartDate attribute.
196: *
197: * @param routingFormBudgetStartDate The routingFormBudgetStartDate to set.
198: */
199: public void setRoutingFormBudgetStartDate(
200: Date routingFormBudgetStartDate) {
201: this .routingFormBudgetStartDate = routingFormBudgetStartDate;
202: }
203:
204: /**
205: * Gets the routingFormBudgetTotalDirectAmount attribute.
206: *
207: * @return Returns the routingFormBudgetTotalDirectAmount.
208: */
209: public KualiInteger getRoutingFormBudgetTotalDirectAmount() {
210: return routingFormBudgetTotalDirectAmount;
211: }
212:
213: /**
214: * Sets the routingFormBudgetTotalDirectAmount attribute value.
215: *
216: * @param routingFormBudgetTotalDirectAmount The routingFormBudgetTotalDirectAmount to set.
217: */
218: public void setRoutingFormBudgetTotalDirectAmount(
219: KualiInteger routingFormBudgetTotalDirectAmount) {
220: this .routingFormBudgetTotalDirectAmount = routingFormBudgetTotalDirectAmount;
221: }
222:
223: /**
224: * Gets the routingFormBudgetTotalEndDate attribute.
225: *
226: * @return Returns the routingFormBudgetTotalEndDate.
227: */
228: public Date getRoutingFormBudgetTotalEndDate() {
229: return routingFormBudgetTotalEndDate;
230: }
231:
232: /**
233: * Sets the routingFormBudgetTotalEndDate attribute value.
234: *
235: * @param routingFormBudgetTotalEndDate The routingFormBudgetTotalEndDate to set.
236: */
237: public void setRoutingFormBudgetTotalEndDate(
238: Date routingFormBudgetTotalEndDate) {
239: this .routingFormBudgetTotalEndDate = routingFormBudgetTotalEndDate;
240: }
241:
242: /**
243: * Gets the routingFormBudgetTotalIndirectCostAmount attribute.
244: *
245: * @return Returns the routingFormBudgetTotalIndirectCostAmount.
246: */
247: public KualiInteger getRoutingFormBudgetTotalIndirectCostAmount() {
248: return routingFormBudgetTotalIndirectCostAmount;
249: }
250:
251: /**
252: * Sets the routingFormBudgetTotalIndirectCostAmount attribute value.
253: *
254: * @param routingFormBudgetTotalIndirectCostAmount The routingFormBudgetTotalIndirectCostAmount to set.
255: */
256: public void setRoutingFormBudgetTotalIndirectCostAmount(
257: KualiInteger routingFormBudgetTotalIndirectCostAmount) {
258: this .routingFormBudgetTotalIndirectCostAmount = routingFormBudgetTotalIndirectCostAmount;
259: }
260:
261: /**
262: * Gets the routingFormBudgetTotalStartDate attribute.
263: *
264: * @return Returns the routingFormBudgetTotalStartDate.
265: */
266: public Date getRoutingFormBudgetTotalStartDate() {
267: return routingFormBudgetTotalStartDate;
268: }
269:
270: /**
271: * Sets the routingFormBudgetTotalStartDate attribute value.
272: *
273: * @param routingFormBudgetTotalStartDate The routingFormBudgetTotalStartDate to set.
274: */
275: public void setRoutingFormBudgetTotalStartDate(
276: Date routingFormBudgetTotalStartDate) {
277: this .routingFormBudgetTotalStartDate = routingFormBudgetTotalStartDate;
278: }
279:
280: /**
281: * Returns the sum of routingFormBudgetDirectAmount and routingFormBudgetIndirectCostAmount.
282: *
283: * @return
284: */
285: public KualiInteger getTotalCostsCurrentPeriod() {
286: KualiInteger totalCosts = new KualiInteger(0);
287: if (this .getRoutingFormBudgetDirectAmount() != null)
288: totalCosts = totalCosts.add(this
289: .getRoutingFormBudgetDirectAmount());
290: if (this .getRoutingFormBudgetIndirectCostAmount() != null)
291: totalCosts = totalCosts.add(this
292: .getRoutingFormBudgetIndirectCostAmount());
293:
294: return totalCosts;
295: }
296:
297: /**
298: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
299: */
300: protected LinkedHashMap toStringMapper() {
301: LinkedHashMap m = new LinkedHashMap();
302: m
303: .put(KFSPropertyConstants.DOCUMENT_NUMBER,
304: this .documentNumber);
305: return m;
306: }
307:
308: public void resetRoutingFormBudgetData() {
309: this.setRoutingFormBudgetDirectAmount(KualiInteger.ZERO);
310: this.setRoutingFormBudgetIndirectCostAmount(KualiInteger.ZERO);
311: this.setRoutingFormBudgetTotalDirectAmount(KualiInteger.ZERO);
312: this
313: .setRoutingFormBudgetTotalIndirectCostAmount(KualiInteger.ZERO);
314: this.setRoutingFormBudgetStartDate(null);
315: this.setRoutingFormBudgetEndDate(null);
316: this.setRoutingFormBudgetTotalStartDate(null);
317: this.setRoutingFormBudgetTotalEndDate(null);
318:
319: }
320:
321: }
|