View Javadoc
1   /*
2    * Copyright 2007 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.module.purap.businessobject;
17  
18  import org.kuali.ole.sys.OLEConstants;
19  import org.kuali.ole.sys.businessobject.FinancialSystemDocumentHeader;
20  import org.kuali.rice.core.web.format.CurrencyFormatter;
21  import org.kuali.rice.core.web.format.DateFormatter;
22  import org.kuali.rice.krad.bo.Note;
23  
24  import java.sql.Date;
25  import java.sql.Timestamp;
26  import java.util.List;
27  
28  /**
29   * Payment Request View Business Object.
30   */
31  public class PaymentRequestView extends AbstractRelatedView {
32  
33      private String invoiceNumber;
34      private Integer purchaseOrderIdentifier;
35      private boolean paymentHoldIndicator;
36      private boolean paymentRequestedCancelIndicator;
37      private String vendorName;
38      private String vendorCustomerNumber;
39      private Date paymentRequestPayDate;
40      private Timestamp paymentExtractedTimestamp;
41      private Timestamp paymentPaidTimestamp;
42      private Integer invoiceIdentifier;
43  
44      // REFERENCE OBJECTS
45      private FinancialSystemDocumentHeader documentHeader;
46  
47  
48      // GETTERS & SETTERS
49      public Object getTotalAmount() {
50          return (new CurrencyFormatter()).format(documentHeader.getFinancialDocumentTotalAmount());
51      }
52  
53      public String getInvoiceNumber() {
54          return invoiceNumber;
55      }
56  
57      public void setInvoiceNumber(String invoiceNumber) {
58          this.invoiceNumber = invoiceNumber;
59      }
60  
61      public Timestamp getPaymentExtractedTimestamp() {
62          return paymentExtractedTimestamp;
63      }
64  
65      public void setPaymentExtractedTimestamp(Timestamp paymentExtractedTimestamp) {
66          this.paymentExtractedTimestamp = paymentExtractedTimestamp;
67      }
68  
69      public boolean isPaymentHoldIndicator() {
70          return paymentHoldIndicator;
71      }
72  
73      public void setPaymentHoldIndicator(boolean paymentHoldIndicator) {
74          this.paymentHoldIndicator = paymentHoldIndicator;
75      }
76  
77      public Timestamp getPaymentPaidTimestamp() {
78          return paymentPaidTimestamp;
79      }
80  
81      public void setPaymentPaidTimestamp(Timestamp paymentPaidTimestamp) {
82          this.paymentPaidTimestamp = paymentPaidTimestamp;
83      }
84  
85      public boolean isPaymentRequestedCancelIndicator() {
86          return paymentRequestedCancelIndicator;
87      }
88  
89      public void setPaymentRequestedCancelIndicator(boolean paymentRequestedCancelIndicator) {
90          this.paymentRequestedCancelIndicator = paymentRequestedCancelIndicator;
91      }
92  
93      public Object getPaymentRequestPayDate() {
94          return new DateFormatter().format(paymentRequestPayDate);
95      }
96  
97      public void setPaymentRequestPayDate(Date paymentRequestPayDate) {
98          this.paymentRequestPayDate = paymentRequestPayDate;
99      }
100 
101     public Integer getPurchaseOrderIdentifier() {
102         return purchaseOrderIdentifier;
103     }
104 
105     public void setPurchaseOrderIdentifier(Integer purchaseOrderIdentifier) {
106         this.purchaseOrderIdentifier = purchaseOrderIdentifier;
107     }
108 
109     public String getVendorCustomerNumber() {
110         return vendorCustomerNumber;
111     }
112 
113     public void setVendorCustomerNumber(String vendorCustomerNumber) {
114         this.vendorCustomerNumber = vendorCustomerNumber;
115     }
116 
117     public String getVendorName() {
118         return vendorName;
119     }
120 
121     public void setVendorName(String vendorName) {
122         this.vendorName = vendorName;
123     }
124 
125     public Integer getInvoiceIdentifier() {
126         return invoiceIdentifier;
127     }
128 
129     public void setInvoiceIdentifier(Integer invoiceIdentifier) {
130         this.invoiceIdentifier = invoiceIdentifier;
131     }
132 
133     /**
134      * @return workflow document type for the PaymentRequestDocument
135      */
136     public String getDocumentType() {
137         return OLEConstants.FinancialDocumentTypeCodes.PAYMENT_REQUEST;
138     }
139 
140     /**
141      * The next three methods are overridden but shouldnt be! If they arent overridden, they dont show up in the tag, not sure why
142      * at this point! (AAP)
143      */
144     @Override
145     public Integer getPurapDocumentIdentifier() {
146         return super.getPurapDocumentIdentifier();
147     }
148 
149     @Override
150     public String getDocumentIdentifierString() {
151         return super.getDocumentIdentifierString();
152     }
153 
154     /**
155      * @see org.kuali.ole.module.purap.businessobject.AbstractRelatedView#getNotes()
156      */
157     @Override
158     public List<Note> getNotes() {
159         return super.getNotes();
160     }
161 
162     /**
163      * @see org.kuali.ole.module.purap.businessobject.AbstractRelatedView#getUrl()
164      */
165     @Override
166     public String getUrl() {
167         return super.getUrl();
168     }
169 
170     /**
171      * @see org.kuali.ole.module.purap.businessobject.AbstractRelatedView#getDocumentTypeName()
172      */
173     @Override
174     public String getDocumentTypeName() {
175         return OLEConstants.FinancialDocumentTypeCodes.PAYMENT_REQUEST;
176     }
177 }