001/* 002 * Copyright 2006 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.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/ecl2.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 */ 016package org.kuali.ole.module.purap.document; 017 018import org.kuali.ole.module.purap.businessobject.PurApItem; 019import org.kuali.ole.sys.document.AccountingDocument; 020import org.kuali.ole.vnd.businessobject.VendorAddress; 021import org.kuali.ole.vnd.businessobject.VendorDetail; 022import org.kuali.rice.core.api.util.type.KualiDecimal; 023import org.kuali.rice.location.framework.country.CountryEbo; 024 025import java.sql.Date; 026import java.util.List; 027 028 029/** 030 * Interface for Purchasing-Accounts Payable Documents. 031 */ 032public interface PurchasingAccountsPayableDocument extends AccountingDocument, PurapItemOperations { 033 034 /** 035 * Returns true if posting year on document is set to use NEXT fiscal year. If set to anything besides NEXT, then return false. 036 * 037 * @return boolean 038 */ 039 public boolean isPostingYearNext(); 040 041 /** 042 * Returns true if posting year on document is set to use PRIOR fiscal year. If set to anything besides PRIOR, then return false. 043 * 044 * @return boolean 045 */ 046 public boolean isPostingYearPrior(); 047 048 /** 049 * If posting year on document is set to use NEXT fiscal year, then return NEXT. If set to anything besides NEXT, then return 050 * CURRENT fiscal year. This is assuming that the system does not allow the user to set a posting year beyond NEXT. 051 * 052 * @return Integer 053 */ 054 public Integer getPostingYearNextOrCurrent(); 055 056 /** 057 * Returns the Item Class. 058 * 059 * @return the Item Class. 060 */ 061 @Override 062 public Class getItemClass(); 063 064 /** 065 * Returns the source of this Purchasing Accounts Payable Document if exists. 066 * 067 * @return the source of this document if exists, else null. 068 */ 069 public PurchasingAccountsPayableDocument getPurApSourceDocumentIfPossible(); 070 071 /** 072 * Returns the label of the source of this Purchasing Accounts Payable Document if exists. 073 * 074 * @return the label of the document source if exists, else null. 075 */ 076 public String getPurApSourceDocumentLabelIfPossible(); 077 078 /** 079 * Returns true if this document is stopped in the specified route node. 080 * 081 * @param nodeDetails the node details of the specified node. 082 * @return true if this document is stopped in the specified route node. 083 */ 084 public boolean isDocumentStoppedInRouteNode(String nodeName); 085 086 /** 087 * Adds the specified item to this document. 088 * 089 * @param item the specified item to add. 090 */ 091 public void addItem(PurApItem item); 092 093 /** 094 * Deletes the specified item from this document. 095 * 096 * @param item the specified item to delete. 097 */ 098 public void deleteItem(int lineNum); 099 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}