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  
17  package org.kuali.ole.fp.businessobject;
18  
19  import java.math.BigDecimal;
20  import java.sql.Date;
21  import java.util.ArrayList;
22  import java.util.Iterator;
23  import java.util.LinkedHashMap;
24  import java.util.List;
25  
26  import org.kuali.ole.sys.OLEPropertyConstants;
27  import org.kuali.ole.sys.businessobject.AccountingLineBase;
28  import org.kuali.rice.core.api.util.type.KualiDecimal;
29  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
30  
31  /**
32   * This class is used to represent a procurement card transaction detail business object.
33   */
34  public class ProcurementCardTransactionDetail extends PersistableBusinessObjectBase {
35  
36      private String documentNumber;
37      private Integer financialDocumentTransactionLineNumber;
38      private Date transactionDate;
39      private String transactionReferenceNumber;
40      private Date transactionPostingDate;
41      private String transactionOriginalCurrencyCode;
42      private String transactionBillingCurrencyCode;
43      private KualiDecimal transactionOriginalCurrencyAmount;
44      private BigDecimal transactionCurrencyExchangeRate;
45      private KualiDecimal transactionSettlementAmount;
46      private KualiDecimal transactionSalesTaxAmount;
47      private boolean transactionTaxExemptIndicator;
48      private boolean transactionPurchaseIdentifierIndicator;
49      private String transactionPurchaseIdentifierDescription;
50      private String transactionUnitContactName;
51      private String transactionTravelAuthorizationCode;
52      private String transactionPointOfSaleCode;
53      private Date transactionCycleStartDate;
54      private Date transactionCycleEndDate;
55      private KualiDecimal transactionTotalAmount;
56  
57      private ProcurementCardVendor procurementCardVendor;
58  
59      private List sourceAccountingLines;
60      private List targetAccountingLines;
61  
62      /**
63       * Default constructor.
64       */
65      public ProcurementCardTransactionDetail() {
66          sourceAccountingLines = new ArrayList<ProcurementCardSourceAccountingLine>();
67          targetAccountingLines = new ArrayList<ProcurementCardTargetAccountingLine>();
68      }
69  
70      /**
71       * @see org.kuali.rice.krad.document.TransactionalDocument#getTargetTotal()
72       */
73      public KualiDecimal getTargetTotal() {
74          KualiDecimal total = KualiDecimal.ZERO;
75          AccountingLineBase al = null;
76          Iterator iter = getTargetAccountingLines().iterator();
77          while (iter.hasNext()) {
78              al = (AccountingLineBase) iter.next();
79  
80              KualiDecimal amount = al.getAmount();
81              if (amount != null) {
82                  total = total.add(amount);
83              }
84          }
85          return total;
86      }
87  
88      /**
89       * Gets the documentNumber attribute.
90       * 
91       * @return Returns the documentNumber
92       */
93      public String getDocumentNumber() {
94          return documentNumber;
95      }
96  
97      /**
98       * Sets the documentNumber attribute.
99       * 
100      * @param documentNumber The documentNumber to set.
101      */
102     public void setDocumentNumber(String documentNumber) {
103         this.documentNumber = documentNumber;
104     }
105 
106 
107     /**
108      * Gets the financialDocumentTransactionLineNumber attribute.
109      * 
110      * @return Returns the financialDocumentTransactionLineNumber
111      */
112     public Integer getFinancialDocumentTransactionLineNumber() {
113         return financialDocumentTransactionLineNumber;
114     }
115 
116     /**
117      * Sets the financialDocumentTransactionLineNumber attribute.
118      * 
119      * @param financialDocumentTransactionLineNumber The financialDocumentTransactionLineNumber to set.
120      */
121     public void setFinancialDocumentTransactionLineNumber(Integer financialDocumentTransactionLineNumber) {
122         this.financialDocumentTransactionLineNumber = financialDocumentTransactionLineNumber;
123     }
124 
125 
126     /**
127      * Gets the transactionDate attribute.
128      * 
129      * @return Returns the transactionDate
130      */
131     public Date getTransactionDate() {
132         return transactionDate;
133     }
134 
135     /**
136      * Sets the transactionDate attribute.
137      * 
138      * @param transactionDate The transactionDate to set.
139      */
140     public void setTransactionDate(Date transactionDate) {
141         this.transactionDate = transactionDate;
142     }
143 
144 
145     /**
146      * Gets the transactionReferenceNumber attribute.
147      * 
148      * @return Returns the transactionReferenceNumber
149      */
150     public String getTransactionReferenceNumber() {
151         return transactionReferenceNumber;
152     }
153 
154     /**
155      * Sets the transactionReferenceNumber attribute.
156      * 
157      * @param transactionReferenceNumber The transactionReferenceNumber to set.
158      */
159     public void setTransactionReferenceNumber(String transactionReferenceNumber) {
160         this.transactionReferenceNumber = transactionReferenceNumber;
161     }
162 
163 
164     /**
165      * Gets the transactionPostingDate attribute.
166      * 
167      * @return Returns the transactionPostingDate
168      */
169     public Date getTransactionPostingDate() {
170         return transactionPostingDate;
171     }
172 
173     /**
174      * Sets the transactionPostingDate attribute.
175      * 
176      * @param transactionPostingDate The transactionPostingDate to set.
177      */
178     public void setTransactionPostingDate(Date transactionPostingDate) {
179         this.transactionPostingDate = transactionPostingDate;
180     }
181 
182 
183     /**
184      * Gets the transactionOriginalCurrencyCode attribute.
185      * 
186      * @return Returns the transactionOriginalCurrencyCode
187      */
188     public String getTransactionOriginalCurrencyCode() {
189         return transactionOriginalCurrencyCode;
190     }
191 
192     /**
193      * Sets the transactionOriginalCurrencyCode attribute.
194      * 
195      * @param transactionOriginalCurrencyCode The transactionOriginalCurrencyCode to set.
196      */
197     public void setTransactionOriginalCurrencyCode(String transactionOriginalCurrencyCode) {
198         this.transactionOriginalCurrencyCode = transactionOriginalCurrencyCode;
199     }
200 
201 
202     /**
203      * Gets the transactionBillingCurrencyCode attribute.
204      * 
205      * @return Returns the transactionBillingCurrencyCode
206      */
207     public String getTransactionBillingCurrencyCode() {
208         return transactionBillingCurrencyCode;
209     }
210 
211     /**
212      * Sets the transactionBillingCurrencyCode attribute.
213      * 
214      * @param transactionBillingCurrencyCode The transactionBillingCurrencyCode to set.
215      */
216     public void setTransactionBillingCurrencyCode(String transactionBillingCurrencyCode) {
217         this.transactionBillingCurrencyCode = transactionBillingCurrencyCode;
218     }
219 
220 
221     /**
222      * Gets the transactionOriginalCurrencyAmount attribute.
223      * 
224      * @return Returns the transactionOriginalCurrencyAmount
225      */
226     public KualiDecimal getTransactionOriginalCurrencyAmount() {
227         return transactionOriginalCurrencyAmount;
228     }
229 
230     /**
231      * Sets the transactionOriginalCurrencyAmount attribute.
232      * 
233      * @param transactionOriginalCurrencyAmount The transactionOriginalCurrencyAmount to set.
234      */
235     public void setTransactionOriginalCurrencyAmount(KualiDecimal transactionOriginalCurrencyAmount) {
236         this.transactionOriginalCurrencyAmount = transactionOriginalCurrencyAmount;
237     }
238 
239 
240     /**
241      * Gets the transactionCurrencyExchangeRate attribute.
242      * 
243      * @return Returns the transactionCurrencyExchangeRate
244      */
245     public BigDecimal getTransactionCurrencyExchangeRate() {
246         return transactionCurrencyExchangeRate;
247     }
248 
249     /**
250      * Sets the transactionCurrencyExchangeRate attribute.
251      * 
252      * @param transactionCurrencyExchangeRate The transactionCurrencyExchangeRate to set.
253      */
254     public void setTransactionCurrencyExchangeRate(BigDecimal transactionCurrencyExchangeRate) {
255         this.transactionCurrencyExchangeRate = transactionCurrencyExchangeRate;
256     }
257 
258 
259     /**
260      * Gets the transactionSettlementAmount attribute.
261      * 
262      * @return Returns the transactionSettlementAmount
263      */
264     public KualiDecimal getTransactionSettlementAmount() {
265         return transactionSettlementAmount;
266     }
267 
268     /**
269      * Sets the transactionSettlementAmount attribute.
270      * 
271      * @param transactionSettlementAmount The transactionSettlementAmount to set.
272      */
273     public void setTransactionSettlementAmount(KualiDecimal transactionSettlementAmount) {
274         this.transactionSettlementAmount = transactionSettlementAmount;
275     }
276 
277 
278     /**
279      * Gets the transactionSalesTaxAmount attribute.
280      * 
281      * @return Returns the transactionSalesTaxAmount
282      */
283     public KualiDecimal getTransactionSalesTaxAmount() {
284         return transactionSalesTaxAmount;
285     }
286 
287     /**
288      * Sets the transactionSalesTaxAmount attribute.
289      * 
290      * @param transactionSalesTaxAmount The transactionSalesTaxAmount to set.
291      */
292     public void setTransactionSalesTaxAmount(KualiDecimal transactionSalesTaxAmount) {
293         this.transactionSalesTaxAmount = transactionSalesTaxAmount;
294     }
295 
296 
297     /**
298      * Gets the transactionTaxExemptIndicator attribute.
299      * 
300      * @return Returns the transactionTaxExemptIndicator
301      */
302     public boolean getTransactionTaxExemptIndicator() {
303         return transactionTaxExemptIndicator;
304     }
305 
306     /**
307      * Sets the transactionTaxExemptIndicator attribute.
308      * 
309      * @param transactionTaxExemptIndicator The transactionTaxExemptIndicator to set.
310      */
311     public void setTransactionTaxExemptIndicator(boolean transactionTaxExemptIndicator) {
312         this.transactionTaxExemptIndicator = transactionTaxExemptIndicator;
313     }
314 
315 
316     /**
317      * Gets the transactionPurchaseIdentifierIndicator attribute.
318      * 
319      * @return Returns the transactionPurchaseIdentifierIndicator
320      */
321     public boolean getTransactionPurchaseIdentifierIndicator() {
322         return transactionPurchaseIdentifierIndicator;
323     }
324 
325     /**
326      * Sets the transactionPurchaseIdentifierIndicator attribute.
327      * 
328      * @param transactionPurchaseIdentifierIndicator The transactionPurchaseIdentifierIndicator to set.
329      */
330     public void setTransactionPurchaseIdentifierIndicator(boolean transactionPurchaseIdentifierIndicator) {
331         this.transactionPurchaseIdentifierIndicator = transactionPurchaseIdentifierIndicator;
332     }
333 
334 
335     /**
336      * Gets the transactionPurchaseIdentifierDescription attribute.
337      * 
338      * @return Returns the transactionPurchaseIdentifierDescription
339      */
340     public String getTransactionPurchaseIdentifierDescription() {
341         return transactionPurchaseIdentifierDescription;
342     }
343 
344     /**
345      * Sets the transactionPurchaseIdentifierDescription attribute.
346      * 
347      * @param transactionPurchaseIdentifierDescription The transactionPurchaseIdentifierDescription to set.
348      */
349     public void setTransactionPurchaseIdentifierDescription(String transactionPurchaseIdentifierDescription) {
350         this.transactionPurchaseIdentifierDescription = transactionPurchaseIdentifierDescription;
351     }
352 
353 
354     /**
355      * Gets the transactionUnitContactName attribute.
356      * 
357      * @return Returns the transactionUnitContactName
358      */
359     public String getTransactionUnitContactName() {
360         return transactionUnitContactName;
361     }
362 
363     /**
364      * Sets the transactionUnitContactName attribute.
365      * 
366      * @param transactionUnitContactName The transactionUnitContactName to set.
367      */
368     public void setTransactionUnitContactName(String transactionUnitContactName) {
369         this.transactionUnitContactName = transactionUnitContactName;
370     }
371 
372 
373     /**
374      * Gets the transactionTravelAuthorizationCode attribute.
375      * 
376      * @return Returns the transactionTravelAuthorizationCode
377      */
378     public String getTransactionTravelAuthorizationCode() {
379         return transactionTravelAuthorizationCode;
380     }
381 
382     /**
383      * Sets the transactionTravelAuthorizationCode attribute.
384      * 
385      * @param transactionTravelAuthorizationCode The transactionTravelAuthorizationCode to set.
386      */
387     public void setTransactionTravelAuthorizationCode(String transactionTravelAuthorizationCode) {
388         this.transactionTravelAuthorizationCode = transactionTravelAuthorizationCode;
389     }
390 
391 
392     /**
393      * Gets the transactionPointOfSaleCode attribute.
394      * 
395      * @return Returns the transactionPointOfSaleCode
396      */
397     public String getTransactionPointOfSaleCode() {
398         return transactionPointOfSaleCode;
399     }
400 
401     /**
402      * Sets the transactionPointOfSaleCode attribute.
403      * 
404      * @param transactionPointOfSaleCode The transactionPointOfSaleCode to set.
405      */
406     public void setTransactionPointOfSaleCode(String transactionPointOfSaleCode) {
407         this.transactionPointOfSaleCode = transactionPointOfSaleCode;
408     }
409 
410 
411     /**
412      * Gets the sourceAccountingLines attribute.
413      * 
414      * @return Returns the sourceAccountingLines.
415      */
416     public List getSourceAccountingLines() {
417         return sourceAccountingLines;
418     }
419 
420 
421     /**
422      * Sets the sourceAccountingLines attribute value.
423      * 
424      * @param sourceAccountingLines The sourceAccountingLines to set.
425      */
426     public void setSourceAccountingLines(List sourceAccountingLines) {
427         this.sourceAccountingLines = sourceAccountingLines;
428     }
429 
430 
431     /**
432      * Gets the targetAccountingLines attribute.
433      * 
434      * @return Returns the targetAccountingLines.
435      */
436     public List getTargetAccountingLines() {
437         return targetAccountingLines;
438     }
439 
440 
441     /**
442      * Sets the targetAccountingLines attribute value.
443      * 
444      * @param targetAccountingLines The targetAccountingLines to set.
445      */
446     public void setTargetAccountingLines(List targetAccountingLines) {
447         this.targetAccountingLines = targetAccountingLines;
448     }
449 
450 
451     /**
452      * Gets the transactionCycleEndDate attribute.
453      * 
454      * @return Returns the transactionCycleEndDate.
455      */
456     public Date getTransactionCycleEndDate() {
457         return transactionCycleEndDate;
458     }
459 
460     /**
461      * Sets the transactionCycleEndDate attribute value.
462      * 
463      * @param transactionCycleEndDate The transactionCycleEndDate to set.
464      */
465     public void setTransactionCycleEndDate(Date transactionCycleEndDate) {
466         this.transactionCycleEndDate = transactionCycleEndDate;
467     }
468 
469     /**
470      * Gets the transactionCycleStartDate attribute.
471      * 
472      * @return Returns the transactionCycleStartDate.
473      */
474     public Date getTransactionCycleStartDate() {
475         return transactionCycleStartDate;
476     }
477 
478     /**
479      * Sets the transactionCycleStartDate attribute value.
480      * 
481      * @param transactionCycleStartDate The transactionCycleStartDate to set.
482      */
483     public void setTransactionCycleStartDate(Date transactionCycleStartDate) {
484         this.transactionCycleStartDate = transactionCycleStartDate;
485     }
486 
487     /**
488      * Gets the procurementCardVendor attribute.
489      * 
490      * @return Returns the procurementCardVendor.
491      */
492     public ProcurementCardVendor getProcurementCardVendor() {
493         return procurementCardVendor;
494     }
495 
496     /**
497      * Sets the procurementCardVendor attribute value.
498      * 
499      * @param procurementCardVendor The procurementCardVendor to set.
500      */
501     public void setProcurementCardVendor(ProcurementCardVendor procurementCardVendor) {
502         this.procurementCardVendor = procurementCardVendor;
503     }
504 
505     /**
506      * Gets the transactionTotalAmount attribute.
507      * 
508      * @return Returns the transactionTotalAmount.
509      */
510     public KualiDecimal getTransactionTotalAmount() {
511         return transactionTotalAmount;
512     }
513 
514     /**
515      * Sets the transactionTotalAmount attribute value.
516      * 
517      * @param transactionTotalAmount The transactionTotalAmount to set.
518      */
519     public void setTransactionTotalAmount(KualiDecimal transactionTotalAmount) {
520         this.transactionTotalAmount = transactionTotalAmount;
521     }
522 
523     /**
524      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
525      */
526     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
527         LinkedHashMap m = new LinkedHashMap();
528         m.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
529         if (this.financialDocumentTransactionLineNumber != null) {
530             m.put("financialDocumentTransactionLineNumber", this.financialDocumentTransactionLineNumber.toString());
531         }
532         return m;
533     }
534 
535 }