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   * Invoice View Business Object.
30   */
31  public class InvoiceView extends AbstractRelatedView {
32  
33      private String invoiceNumber;
34      private Integer purchaseOrderIdentifier;
35      private boolean paymentHoldIndicator;
36      private boolean invoiceCancelIndicator;
37      private String vendorName;
38      private String vendorCustomerNumber;
39      private Date invoicePayDate;
40      private Timestamp paymentExtractedTimestamp;
41      private Timestamp paymentPaidTimestamp;
42      private Integer accountsPayablePurchasingDocumentLinkIdentifier;
43      private Integer invoiceIdentifier;
44  
45      // REFERENCE OBJECTS
46      private FinancialSystemDocumentHeader documentHeader;
47  
48      public Integer getAccountsPayablePurchasingDocumentLinkIdentifier() {
49          return accountsPayablePurchasingDocumentLinkIdentifier;
50      }
51  
52      public void setAccountsPayablePurchasingDocumentLinkIdentifier(Integer accountsPayablePurchasingDocumentLinkIdentifier) {
53          this.accountsPayablePurchasingDocumentLinkIdentifier = accountsPayablePurchasingDocumentLinkIdentifier;
54      }
55  
56      public Integer getInvoiceIdentifier() {
57          return invoiceIdentifier;
58      }
59  
60      public void setInvoiceIdentifier(Integer invoiceIdentifier) {
61          this.invoiceIdentifier = invoiceIdentifier;
62      }
63  
64      // GETTERS & SETTERS
65      public Object getTotalAmount() {
66          return (new CurrencyFormatter()).format(documentHeader.getFinancialDocumentTotalAmount());
67      }
68  
69      public String getInvoiceNumber() {
70          return invoiceNumber;
71      }
72  
73      public void setInvoiceNumber(String invoiceNumber) {
74          this.invoiceNumber = invoiceNumber;
75      }
76  
77      public Timestamp getPaymentExtractedTimestamp() {
78          return paymentExtractedTimestamp;
79      }
80  
81      public void setPaymentExtractedTimestamp(Timestamp paymentExtractedTimestamp) {
82          this.paymentExtractedTimestamp = paymentExtractedTimestamp;
83      }
84  
85      public boolean isPaymentHoldIndicator() {
86          return paymentHoldIndicator;
87      }
88  
89      public void setPaymentHoldIndicator(boolean paymentHoldIndicator) {
90          this.paymentHoldIndicator = paymentHoldIndicator;
91      }
92  
93      public Timestamp getPaymentPaidTimestamp() {
94          return paymentPaidTimestamp;
95      }
96  
97      public void setPaymentPaidTimestamp(Timestamp paymentPaidTimestamp) {
98          this.paymentPaidTimestamp = paymentPaidTimestamp;
99      }
100 
101     public boolean isInvoiceCancelIndicator() {
102         return invoiceCancelIndicator;
103     }
104 
105     public void setInvoiceCancelIndicator(boolean invoiceCancelIndicator) {
106         this.invoiceCancelIndicator = invoiceCancelIndicator;
107     }
108 
109     public Object getInvoicePayDate() {
110         return new DateFormatter().format(invoicePayDate);
111     }
112 
113     public void setInvoicePayDate(Date invoicePayDate) {
114         this.invoicePayDate = invoicePayDate;
115     }
116 
117     public Integer getPurchaseOrderIdentifier() {
118         return purchaseOrderIdentifier;
119     }
120 
121     public void setPurchaseOrderIdentifier(Integer purchaseOrderIdentifier) {
122         this.purchaseOrderIdentifier = purchaseOrderIdentifier;
123     }
124 
125     public String getVendorCustomerNumber() {
126         return vendorCustomerNumber;
127     }
128 
129     public void setVendorCustomerNumber(String vendorCustomerNumber) {
130         this.vendorCustomerNumber = vendorCustomerNumber;
131     }
132 
133     public String getVendorName() {
134         return vendorName;
135     }
136 
137     public void setVendorName(String vendorName) {
138         this.vendorName = vendorName;
139     }
140 
141     /**
142      * @return workflow document type for the InvoiceDocument
143      */
144     public String getDocumentType() {
145         return OLEConstants.FinancialDocumentTypeCodes.INVOICE;
146     }
147 
148     /**
149      * The next three methods are overridden but shouldnt be! If they arent overridden, they dont show up in the tag, not sure why
150      * at this point! (AAP)
151      */
152     @Override
153     public Integer getPurapDocumentIdentifier() {
154         return super.getPurapDocumentIdentifier();
155     }
156 
157     @Override
158     public String getDocumentIdentifierString() {
159         return super.getDocumentIdentifierString();
160     }
161 
162     /**
163      * @see AbstractRelatedView#getNotes()
164      */
165     @Override
166     public List<Note> getNotes() {
167         return super.getNotes();
168     }
169 
170     /**
171      * @see AbstractRelatedView#getUrl()
172      */
173     @Override
174     public String getUrl() {
175         return super.getUrl();
176     }
177 
178     /**
179      * @see AbstractRelatedView#getDocumentTypeName()
180      */
181     @Override
182     public String getDocumentTypeName() {
183         return OLEConstants.FinancialDocumentTypeCodes.INVOICE;
184     }
185 }