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  package org.kuali.ole.module.purap.document;
17  
18  import org.kuali.ole.module.purap.businessobject.PurApItem;
19  import org.kuali.ole.sys.document.AccountingDocument;
20  import org.kuali.ole.vnd.businessobject.VendorAddress;
21  import org.kuali.ole.vnd.businessobject.VendorDetail;
22  import org.kuali.rice.core.api.util.type.KualiDecimal;
23  import org.kuali.rice.location.framework.country.CountryEbo;
24  
25  import java.sql.Date;
26  import java.util.List;
27  
28  
29  /**
30   * Interface for Purchasing-Accounts Payable Documents.
31   */
32  public interface PurchasingAccountsPayableDocument extends AccountingDocument, PurapItemOperations {
33  
34      /**
35       * Returns true if posting year on document is set to use NEXT fiscal year. If set to anything besides NEXT, then return false.
36       *
37       * @return boolean
38       */
39      public boolean isPostingYearNext();
40  
41      /**
42       * Returns true if posting year on document is set to use PRIOR fiscal year. If set to anything besides PRIOR, then return false.
43       *
44       * @return boolean
45       */
46      public boolean isPostingYearPrior();
47  
48      /**
49       * If posting year on document is set to use NEXT fiscal year, then return NEXT. If set to anything besides NEXT, then return
50       * CURRENT fiscal year.  This is assuming that the system does not allow the user to set a posting year beyond NEXT.
51       *
52       * @return Integer
53       */
54      public Integer getPostingYearNextOrCurrent();
55  
56      /**
57       * Returns the Item Class.
58       *
59       * @return the Item Class.
60       */
61      @Override
62      public Class getItemClass();
63  
64      /**
65       * Returns the source of this Purchasing Accounts Payable Document if exists.
66       *
67       * @return the source of this document if exists, else null.
68       */
69      public PurchasingAccountsPayableDocument getPurApSourceDocumentIfPossible();
70  
71      /**
72       * Returns the label of the source of this Purchasing Accounts Payable Document if exists.
73       *
74       * @return the label of the document source if exists, else null.
75       */
76      public String getPurApSourceDocumentLabelIfPossible();
77  
78      /**
79       * Returns true if this document is stopped in the specified route node.
80       *
81       * @param nodeDetails the node details of the specified node.
82       * @return true if this document is stopped in the specified route node.
83       */
84      public boolean isDocumentStoppedInRouteNode(String nodeName);
85  
86      /**
87       * Adds the specified item to this document.
88       *
89       * @param item the specified item to add.
90       */
91      public void addItem(PurApItem item);
92  
93      /**
94       * Deletes the specified item from this document.
95       *
96       * @param item the specified item to delete.
97       */
98      public void deleteItem(int lineNum);
99  
100     /**
101      * Renumbers the item starting from the specified index.
102      *
103      * @param start the index of the starting item to be renumbered.
104      */
105     public void renumberItems(int start);
106 
107     /**
108      * Swaps the specified two items based on their item line numbers (which are one higher than the item positions in the list).
109      *
110      * @param position1 the position of the first item
111      * @param position2 the position of the second item
112      */
113     public void itemSwap(int position1, int position2);
114 
115     /**
116      * Determines the item line position if the user did not specify the line number on an above the line items before clicking on
117      * the add button. It subtracts the number of the below the line items on the list with the total item list size.
118      *
119      * @return the item line position of the last (highest) line number of above the line items.
120      */
121     public int getItemLinePosition();
122 
123     /**
124      * Gets the item at the specified index.
125      *
126      * @param pos the specified index.
127      * @return the item at the specified index.
128      */
129     @Override
130     public PurApItem getItem(int pos);
131 
132     /**
133      * Gets all below the line item types.
134      *
135      * @return Returns a list of below the line item types.
136      */
137     public String[] getBelowTheLineTypes();
138 
139     /**
140      * Computes the total dollar amount of all items.
141      *
142      * @return the total dollar amount of all items.
143      */
144     public KualiDecimal getTotalDollarAmount();
145 
146     /**
147      * Sets the total dollar amount to the specified amount.
148      *
149      * @param the specified total amount.
150      */
151     public void setTotalDollarAmount(KualiDecimal totalDollarAmount);
152 
153     /**
154      * Computes the total dollar amount with the specified item types excluded.
155      *
156      * @param excludedTypes the types of items to be excluded.
157      * @return the total dollar amount with the specified item types excluded.
158      */
159     public KualiDecimal getTotalDollarAmountAllItems(String[] excludedTypes);
160 
161     public KualiDecimal getTotalDollarAmountAboveLineItems();
162 
163     /**
164      * Computes the pre tax total dollar amount of all items.
165      *
166      * @return the pre tax total dollar amount of all items.
167      */
168     public KualiDecimal getTotalPreTaxDollarAmount();
169 
170     /**
171      * Sets the pre tax total dollar amount to the specified amount.
172      *
173      * @param the specified total amount.
174      */
175     public void setTotalPreTaxDollarAmount(KualiDecimal totalDollarAmount);
176 
177     /**
178      * Computes the pre tax total dollar amount with the specified item types excluded.
179      *
180      * @param excludedTypes the types of items to be excluded.
181      * @return the pre tax total dollar amount with the specified item types excluded.
182      */
183     public KualiDecimal getTotalPreTaxDollarAmountAllItems(String[] excludedTypes);
184 
185     public KualiDecimal getTotalTaxAmount();
186 
187     public void setTotalTaxAmount(KualiDecimal amount);
188 
189     public KualiDecimal getTotalTaxAmountAllItems(String[] excludedTypes);
190 
191     public KualiDecimal getTotalTaxAmountAboveLineItems();
192 
193     public KualiDecimal getTotalTaxAmountAboveLineItems(String[] excludedTypes);
194 
195     public KualiDecimal getTotalTaxAmountWithExclusions(String[] excludedTypes, boolean includeBelowTheLine);
196 
197     /**
198      * Sets vendor address fields based on a given VendorAddress.
199      *
200      * @param vendorAddress
201      */
202     public void templateVendorAddress(VendorAddress vendorAddress);
203 
204     public CountryEbo getVendorCountry();
205 
206     public VendorDetail getVendorDetail();
207 
208     @Override
209     public List<PurApItem> getItems();
210 
211     @Override
212     public void setItems(List<PurApItem> items);
213 
214     public String getVendorNumber();
215 
216     public void setVendorNumber(String vendorNumber);
217 
218     public Integer getVendorHeaderGeneratedIdentifier();
219 
220     public void setVendorHeaderGeneratedIdentifier(Integer vendorHeaderGeneratedIdentifier);
221 
222     public Integer getVendorDetailAssignedIdentifier();
223 
224     public void setVendorDetailAssignedIdentifier(Integer vendorDetailAssignedIdentifier);
225 
226     public String getVendorCustomerNumber();
227 
228     public void setVendorCustomerNumber(String vendorCustomerNumber);
229 
230     public Integer getPurapDocumentIdentifier();
231 
232     public void setPurapDocumentIdentifier(Integer identifier);
233 
234     public String getApplicationDocumentStatus();
235 
236     public void setApplicationDocumentStatus(String appDocStatus);
237 
238     public String getVendorCityName();
239 
240     public void setVendorCityName(String vendorCityName);
241 
242     public String getVendorCountryCode();
243 
244     public void setVendorCountryCode(String vendorCountryCode);
245 
246     public String getVendorLine1Address();
247 
248     public void setVendorLine1Address(String vendorLine1Address);
249 
250     public String getVendorLine2Address();
251 
252     public void setVendorLine2Address(String vendorLine2Address);
253 
254     public String getVendorName();
255 
256     public void setVendorName(String vendorName);
257 
258     public String getVendorPostalCode();
259 
260     public void setVendorPostalCode(String vendorPostalCode);
261 
262     public String getVendorStateCode();
263 
264     public void setVendorStateCode(String vendorStateCode);
265 
266     public String getVendorAddressInternationalProvinceName();
267 
268     public void setVendorAddressInternationalProvinceName(String vendorAddressInternationalProvinceName);
269 
270     public Integer getAccountsPayablePurchasingDocumentLinkIdentifier();
271 
272     public void setAccountsPayablePurchasingDocumentLinkIdentifier(Integer accountsPayablePurchasingDocumentLinkIdentifier);
273 
274     public Integer getVendorAddressGeneratedIdentifier();
275 
276     public void setVendorAddressGeneratedIdentifier(Integer vendorAddressGeneratedIdentifier);
277 
278     public boolean isUseTaxIndicator();
279 
280     public void setUseTaxIndicator(boolean useTaxIndicator);
281 
282     public void fixItemReferences();
283 
284     public Date getTransactionTaxDate();
285 
286     public PurApItem getTradeInItem();
287 
288     public KualiDecimal getTotalDollarAmountForTradeIn();
289 
290     public List<PurApItem> getTradeInItems();
291 
292     /**
293      * Always returns true.
294      * This method is needed here because it's called by some tag files shared with PurAp documents.
295      *
296      * @return true.
297      */
298     public boolean getIsATypeOfPurAPRecDoc();
299 
300     /**
301      * Determines whether the document is a type of PurchasingDocument.
302      *
303      * @return true if the document is a type of PurchasingDocument.
304      */
305     public boolean getIsATypeOfPurDoc();
306 
307     /**
308      * Determines whether the document is a type of PurchseOrderDocument (including its subclass documents).
309      *
310      * @return true if the document is a type of PurchseOrderDocument.
311      */
312     public boolean getIsATypeOfPODoc();
313 
314     /**
315      * Determines whether the document is a PurchaseOrderDocument (excluding its subclass documents).
316      *
317      * @return true if the document is a PurchaseOrderDocument.
318      */
319     public boolean getIsPODoc();
320 
321     /**
322      * Determines whether the document is a RequisitionDocument.
323      *
324      * @return true if the document is a RequisitionDocument.
325      */
326     public boolean getIsReqsDoc();
327 
328     /**
329      * Determines whether the inquiry links should be rendered
330      * for Object Code and Sub Object Code.
331      *
332      * @return
333      */
334     public boolean isInquiryRendered();
335 
336     public boolean shouldGiveErrorForEmptyAccountsProration();
337 
338     public boolean isCalculated();
339 
340     public void setCalculated(boolean calculated);
341     /**
342      * Gets the License request Doc Number for the given requisition document number
343      * @return licenseRequestDocNumber
344      */
345     /*public String getLicenseRequestDocNum();*/
346     /**
347      *
348      * Sets the License request document number
349      * @param licenseRequestDocNum
350      */
351     /*public void setLicenseRequestDocNum(String licenseRequestDocNum);*/
352 }