View Javadoc
1   /*
2    * Copyright 2011 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.select.businessobject;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.kuali.ole.DocumentUniqueIDPrefix;
20  import org.kuali.ole.docstore.engine.service.storage.rdbms.pojo.BibInfoRecord;
21  import org.kuali.ole.module.purap.PurapConstants;
22  import org.kuali.ole.module.purap.businessobject.*;
23  import org.kuali.ole.module.purap.document.PurchaseOrderDocument;
24  import org.kuali.ole.pojo.OleOrderRecord;
25  import org.kuali.ole.select.bo.OLELinkPurapDonor;
26  import org.kuali.ole.select.bo.OLEPOClaimHistory;
27  import org.kuali.ole.select.document.OLEEResourceRecordDocument;
28  import org.kuali.ole.select.document.OleInvoiceDocument;
29  import org.kuali.ole.select.document.OlePurchaseOrderDocument;
30  import org.kuali.ole.select.lookup.DocData;
31  import org.kuali.ole.sys.OLEConstants;
32  import org.kuali.ole.sys.context.SpringContext;
33  import org.kuali.rice.core.api.config.property.ConfigContext;
34  import org.kuali.rice.core.api.util.type.KualiDecimal;
35  import org.kuali.rice.core.api.util.type.KualiInteger;
36  import org.kuali.rice.kew.api.KewApiConstants;
37  import org.kuali.rice.kim.api.identity.Person;
38  import org.kuali.rice.kim.api.identity.PersonService;
39  import org.kuali.rice.krad.service.KRADServiceLocator;
40  import org.kuali.rice.krad.service.SequenceAccessorService;
41  import org.kuali.rice.krad.util.GlobalVariables;
42  import org.kuali.rice.krad.util.KRADConstants;
43  import org.kuali.rice.krad.util.ObjectUtils;
44  
45  import java.math.BigDecimal;
46  import java.util.ArrayList;
47  import java.sql.Date;
48  import java.util.List;
49  
50  
51  public class OlePurchaseOrderItem extends PurchaseOrderItem implements OlePurchasingItem {
52  
53      protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OleRequisitionItem.class);
54      private boolean selected;
55      private BibInfoBean bibInfoBean;
56      protected String itemTitleId;
57      protected String linkToOrderOption;
58      protected String localTitleId;
59      protected String itemTitle;
60      protected String itemAuthor;
61      protected String requestorId;
62      protected String requestorFirstName;
63      private DocData docData;
64      protected KualiInteger itemNoOfParts;
65      private String noOfItemParts;
66      protected String internalRequestorId;
67      protected Integer requestorTypeId;
68      protected KualiDecimal itemListPrice;
69      protected KualiDecimal itemDiscount;
70      protected String itemDiscountType;
71      protected String vendorItemPoNumber;
72      protected String itemCurrencyType;
73      protected String donorSearchCodes;
74      protected KualiDecimal itemForeignListPrice;
75      protected KualiDecimal itemForeignDiscount;
76      protected String itemForeignDiscountType;
77      protected KualiDecimal itemForeignDiscountAmt;
78      protected KualiDecimal itemForeignUnitCost;
79      protected KualiDecimal itemExchangeRate;
80      protected KualiDecimal itemUnitCostUSD;
81      protected boolean latestExchangeRate;
82      protected Integer categoryId;
83      protected Integer formatTypeId;
84      protected Integer requestSourceTypeId;
85      protected Integer receiptStatusId;
86      private OleCategory category;
87      private OleFormatType formatTypeName;
88      private OleRequestSourceType oleRequestSourceType;
89      private OleReceiptStatus oleReceiptStatus;
90      protected Integer itemPriceSourceId;
91      private OleItemPriceSource itemPriceSource;
92      private String purposeId;
93      protected boolean itemRouteToRequestorIndicator;
94      protected boolean itemPublicViewIndicator;
95      private PurchaseOrderDocument purchaseOrder;
96      private OleOrderRecord oleOrderRecord;
97      private boolean poAdded = false;
98      protected String bibUUID;
99      private String noOfCopiesReceived;
100     private String noOfPartsReceived;
101     private KualiDecimal invoicePrice;
102     private KualiDecimal itemForeignUnitPrice;
103     private KualiInteger itemPoQty;
104     private String singleCopyNumber;
105     private String oleERSIdentifier;
106     private String eResLink;
107 
108     private String donorId;
109     private String donorCode;
110     private List<OLELinkPurapDonor> oleDonors=new ArrayList<>();
111 
112     protected KualiDecimal itemForiegnExtendedPrice;
113     private String itemLocation;
114     /**
115      * For List of copies
116      */
117     private Integer itemCopiesId;
118     private KualiInteger parts;
119     private KualiDecimal itemCopies;
120     private String partEnumeration;
121     private String locationCopies;
122     private KualiInteger startingCopyNumber;
123     private List<OleCopies> copies = new ArrayList<OleCopies>();
124     private List<OleRequisitionCopies> oleCopies = new ArrayList<OleRequisitionCopies>();
125     private List<OleCopy> deletedCopiesList = new ArrayList<>();
126 
127     //For Displaying the Invoice List
128     private List<OleInvoiceDocument> invoiceDocuments = new ArrayList<OleInvoiceDocument>();
129     private List<InvoiceView> paymentHistoryInvoiceViews = null;
130     //For Invoice
131     private String invoiceItemListPrice;
132     private String invoiceForeignItemListPrice;
133     private String invoiceForeignDiscount;
134     private String invoiceExchangeRate;
135     private String invoiceForeignUnitCost;
136     private String invoiceForeignCurrency;
137     private String invoiceForeignDiscountType;
138 
139     private boolean doNotClaim;
140 
141     private KualiInteger claimCount;
142     private boolean claimPoAdded;
143     private Date claimDate;
144     private String claimNote;
145     private List<OLEPOClaimHistory> claimHistories = new ArrayList<>();
146 
147     private boolean claimFilter = false;
148     private String title;
149     private BibInfoRecord bibInfoRecord;
150     private String fundCode;
151 
152     public List<OLEPOClaimHistory> getClaimHistories() {
153         return claimHistories;
154     }
155 
156     public String getDonorSearchCodes() {
157         return donorSearchCodes;
158     }
159 
160     public void setDonorSearchCodes(String donorSearchCodes) {
161         this.donorSearchCodes = donorSearchCodes;
162     }
163 
164     public void setClaimHistories(List<OLEPOClaimHistory> claimHistories) {
165         this.claimHistories = claimHistories;
166     }
167 
168     public String getClaimNote() {
169         return claimNote;
170     }
171 
172     public void setClaimNote(String claimNote) {
173         this.claimNote = claimNote;
174     }
175 
176     public Date getClaimDate() {
177         return claimDate;
178     }
179 
180     public void setClaimDate(Date claimDate) {
181         this.claimDate = claimDate;
182     }
183 
184     public boolean isClaimPoAdded() {
185         return claimPoAdded;
186     }
187 
188     public void setClaimPoAdded(boolean claimPoAdded) {
189         this.claimPoAdded = claimPoAdded;
190     }
191 
192     public String getSingleCopyNumber() {
193         return singleCopyNumber;
194     }
195 
196     public void setSingleCopyNumber(String singleCopyNumber) {
197         this.singleCopyNumber = singleCopyNumber;
198     }
199 
200     public KualiInteger getClaimCount() {
201         return claimCount;
202     }
203 
204     public void setClaimCount(KualiInteger claimCount) {
205         this.claimCount = claimCount;
206     }
207 
208     public boolean isDoNotClaim() {
209         return doNotClaim;
210     }
211 
212     public void setDoNotClaim(boolean doNotClaim) {
213         this.doNotClaim = doNotClaim;
214     }
215 
216     public List<OLELinkPurapDonor> getOleDonors() {
217         return oleDonors;
218     }
219 
220     public void setOleDonors(List<OLELinkPurapDonor> oleDonors) {
221         this.oleDonors = oleDonors;
222     }
223 
224     public String getDonorId() {
225         return donorId;
226     }
227 
228     public void setDonorId(String donorId) {
229         this.donorId = donorId;
230     }
231 
232     public String getDonorCode() {
233         return donorCode;
234     }
235 
236     public void setDonorCode(String donorCode) {
237         this.donorCode = donorCode;
238     }
239     /**
240      * For List Payment History
241      */
242     private String paymentHistory;
243     private List<OleRequisitionPaymentHistory> requisitionPaymentHistory = new ArrayList<OleRequisitionPaymentHistory>();
244     private String itemTypeDescription;
245 
246     /**
247      * For Quantity As Integer
248      */
249     private KualiInteger oleItemQuantity;
250     private String copiesOrdered;
251 
252 
253     private OLERequestorPatronDocument olePatronDocument;
254     protected String olePatronId;
255     private String firstName;
256     private String enumeration;
257     private String location;
258     private String copyNumber;
259     private String receiptStatus;
260     private String caption;
261     private String volumeNumber;
262     private List<OleCopy> copyList = new ArrayList<>();
263 
264     private String                               itemStatus;
265 
266     private String vendorName;
267     private OlePurchaseOrderDocument olePurchaseOrderDocument;
268     // Subscription Date for Invoice Document
269     private Date subscriptionFromDate;
270     private Date subscriptionToDate;
271     private boolean subscriptionOverlap;
272 
273     public OlePurchaseOrderDocument getOlePurchaseOrderDocument() {
274         return olePurchaseOrderDocument;
275     }
276 
277     public void setOlePurchaseOrderDocument(OlePurchaseOrderDocument olePurchaseOrderDocument) {
278         this.olePurchaseOrderDocument = olePurchaseOrderDocument;
279     }
280     private String docFormat;
281     public String getDocFormat() {
282         return docFormat;
283     }
284 
285     public void setDocFormat(String docFormat) {
286         this.docFormat = docFormat;
287     }
288     // For Invoice Document
289     private boolean itemForInvoice = true;
290     private String openQuantity;
291     private KualiDecimal poOutstandingQuantity;
292     private List<OleInvoiceNote> invoiceNotes = new ArrayList<OleInvoiceNote>();
293     private boolean locationFlag;
294     private boolean itemLocationChangeFlag;
295     private KualiDecimal previousItemQuantity;
296     private KualiInteger previousItemNoOfParts;
297 
298     public String getLocalTitleId() {
299         return localTitleId;
300     }
301 
302     public void setLocalTitleId(String localTitleId) {
303         this.localTitleId = localTitleId;
304     }
305 
306     //Invoice Changes
307     private BigDecimal itemSurcharge;
308 
309     public String getItemStatus() {
310         return itemStatus;
311     }
312 
313     public void setItemStatus(String itemStatus) {
314         this.itemStatus = itemStatus;
315     }
316 
317     public BigDecimal getItemSurcharge() {
318         return itemSurcharge;
319     }
320 
321     public void setItemSurcharge(BigDecimal itemSurcharge) {
322         this.itemSurcharge = itemSurcharge;
323     }
324 
325     public List<OleRequisitionCopies> getOleCopies() {
326         return oleCopies;
327     }
328 
329     public void setOleCopies(List<OleRequisitionCopies> oleCopies) {
330         this.oleCopies = oleCopies;
331     }
332 
333     public String getEnumeration() {
334         return enumeration;
335     }
336 
337     public void setEnumeration(String enumeration) {
338         this.enumeration = enumeration;
339     }
340 
341     public String getLocation() {
342         return location;
343     }
344 
345     public void setLocation(String location) {
346         this.location = location;
347     }
348 
349     public String getCopyNumber() {
350         return copyNumber;
351     }
352 
353     public void setCopyNumber(String copyNumber) {
354         this.copyNumber = copyNumber;
355     }
356 
357     public boolean isSelected() {
358         return selected;
359     }
360 
361     public void setSelected(boolean selected) {
362         this.selected = selected;
363     }
364 
365     public String getReceiptStatus() {
366         return receiptStatus;
367     }
368 
369     public void setReceiptStatus(String receiptStatus) {
370         this.receiptStatus = receiptStatus;
371     }
372 
373     public String getCaption() {
374         return caption;
375     }
376 
377     public void setCaption(String caption) {
378         this.caption = caption;
379     }
380 
381     public String getVolumeNumber() {
382         return volumeNumber;
383     }
384 
385     public void setVolumeNumber(String volumeNumber) {
386         this.volumeNumber = volumeNumber;
387     }
388 
389     public List<OleCopy> getCopyList() {
390         return copyList;
391     }
392 
393     public void setCopyList(List<OleCopy> copyList) {
394         this.copyList = copyList;
395     }
396 
397     /**
398      * Gets the value of the receiptStatusId property
399      *
400      * @return receiptStatusId
401      */
402     public Integer getReceiptStatusId() {
403         return receiptStatusId;
404     }
405 
406     /**
407      * Sets the receiptStatusId value
408      *
409      * @param receiptStatusId
410      */
411     public void setReceiptStatusId(Integer receiptStatusId) {
412         this.receiptStatusId = receiptStatusId;
413     }
414 
415     /**
416      * Gets the instance of OleReceiptStatus
417      *
418      * @return oleReceiptStatus
419      */
420     public OleReceiptStatus getOleReceiptStatus() {
421         return oleReceiptStatus;
422     }
423 
424     /**
425      * Sets the instance value for OleReceiptStatus
426      *
427      * @param oleReceiptStatus
428      */
429     public void setOleReceiptStatus(OleReceiptStatus oleReceiptStatus) {
430         this.oleReceiptStatus = oleReceiptStatus;
431     }
432 
433     /**
434      * Gets the poAdded attribute.
435      *
436      * @return Returns the poAdded.
437      */
438     public boolean isPoAdded() {
439         return poAdded;
440     }
441 
442     /**
443      * Sets the poAdded attribute value.
444      *
445      * @param poAdded The poAdded to set.
446      */
447     public void setPoAdded(boolean poAdded) {
448         this.poAdded = poAdded;
449     }
450 
451     /**
452      * This for List of Notes
453      */
454     /*private List<OleNotes> notes;
455     private Integer noteTypeId;
456     private String note;*/
457 
458     private KualiDecimal itemReceivedTotalParts; // Added for OLE-2058
459     private KualiDecimal itemDamagedTotalParts; // Adde for OLE-2058
460 
461     /**
462      * This method... for getting NoteType Id
463      *
464      * @return noteTypeId
465      */
466    /* public Integer getNoteTypeId() {
467         return noteTypeId;
468     }
469 
470     *//**
471      * This method... for setting the NoteType Id
472      *
473      * @param noteTypeId
474      *//*
475     public void setNoteTypeId(Integer noteTypeId) {
476         this.noteTypeId = noteTypeId;
477     }
478 
479     *//**
480      * This method... for getting the Note description
481      *
482      * @return note
483      *//*
484     public String getNote() {
485         return note;
486     }
487 
488     *//**
489      * This method... for setting the Note description
490      *
491      * @param note
492      *//*
493     public void setNote(String note) {
494         this.note = note;
495     }
496 
497     *//**
498      * This method... for setting List of notes
499      *
500      * @param notes
501      *//*
502     public void setNotes(List<OleNotes> notes) {
503         this.notes = notes;
504     }
505 
506     *//**
507      * This method... for getting List of Notes
508      *
509      * @return notes
510      *//*
511     public List<OleNotes> getNotes() {
512         return notes;
513     }*/
514 
515     public OleOrderRecord getOleOrderRecord() {
516         return oleOrderRecord;
517     }
518 
519     public void setOleOrderRecord(OleOrderRecord oleOrderRecord) {
520         this.oleOrderRecord = oleOrderRecord;
521     }
522 
523     public OlePurchaseOrderItem() {
524         this.setItemNoOfParts(new KualiInteger(1));
525         this.setItemPublicViewIndicator(true);
526         this.setItemUnitOfMeasureCode(PurapConstants.PODocumentsStrings.CUSTOMER_INVOICE_DETAIL_UOM_DEFAULT);
527         this.setOleItemQuantity(new KualiInteger(1));
528         this.setItemListPrice(new KualiDecimal(0.00));
529         this.setNoOfCopiesReceived("");
530         this.getNewSourceLine().setAccountLinePercent(new BigDecimal(0));
531         this.setNoOfPartsReceived("");
532         /*if (GlobalVariables.getUserSession() != null) {
533             this.internalRequestorId = GlobalVariables.getUserSession().getPrincipalId();
534             this.setRequestorFirstName(getPersonName(GlobalVariables.getUserSession().getPrincipalId()));
535         }*/
536         /*    if(SpringContext.getBean(OleRequisitionService.class).getRequestor()!=null) {
537             String requestor=SpringContext.getBean(OleRequisitionService.class).getRequestor();
538             this.setRequestorFirstName(requestor);
539         }
540         OleRequisitionService oleRequestionService=new OleRequisitionServiceImpl();
541         if(oleRequestionService.getRequestor()!=null) {
542              String requestor=oleRequestionService.getRequestor();
543              this.setRequestorFirstName(requestor);
544          }*/
545         /**
546          * Initializing poNotes List
547          */
548         LOG.debug("Initializing OlePurchaseOrderNotes List");
549         //notes = new ArrayList<OleNotes>();
550     }
551 
552 
553     @Override
554     public PurchaseOrderDocument getPurchaseOrder() {
555         // TODO Auto-generated method stub
556         return super.getPurchaseOrder();
557     }
558 
559 
560     @Override
561     public void setPurchaseOrder(PurchaseOrderDocument purchaseOrder) {
562         // TODO Auto-generated method stub
563         setPurapDocument(purchaseOrder);
564         super.setPurchaseOrder(purchaseOrder);
565     }
566 
567 
568     public OlePurchaseOrderItem(OleRequisitionItem ri, OlePurchaseOrderDocument po, RequisitionCapitalAssetItem reqCamsItem) {
569         this();
570         // po.setVendorPoNumber(ri.getVendorItemPoNumber());
571         this.setPurchaseOrder(po);
572         SequenceAccessorService sas = SpringContext.getBean(SequenceAccessorService.class);
573         Integer itemIdentifier = sas.getNextAvailableSequenceNumber("PO_ITM_ID", PurchaseOrderDocument.class).intValue();
574         this.setItemIdentifier(itemIdentifier);
575         this.setItemLineNumber(ri.getItemLineNumber());
576         this.setItemUnitOfMeasureCode(ri.getItemUnitOfMeasureCode());
577         this.setItemNoOfParts(ri.getItemNoOfParts());
578         this.setItemQuantity(ri.getItemQuantity());
579         this.setItemCatalogNumber(ri.getItemCatalogNumber());
580         this.setPreviousItemQuantity(ri.getItemQuantity());
581         this.setPreviousItemNoOfParts(ri.getItemNoOfParts());
582         this.setItemDescription(ri.getItemDescription());
583         this.setSingleCopyNumber(ri.getSingleCopyNumber());
584         if(ri.getItemTitleId()!=null){
585             this.setDocFormat(DocumentUniqueIDPrefix.getBibFormatType(ri.getItemTitleId()));
586         }
587         if(ri.getItemUnitPrice()!=null){
588             this.setItemUnitPrice(ri.getItemUnitPrice().setScale(2, BigDecimal.ROUND_HALF_UP));
589         }
590         else{
591             this.setItemUnitPrice(ri.getItemUnitPrice());
592         }
593         this.setItemAuxiliaryPartIdentifier(ri.getItemAuxiliaryPartIdentifier());
594         this.setItemAssignedToTradeInIndicator(ri.getItemAssignedToTradeInIndicator());
595         this.setItemTaxAmount(ri.getItemTaxAmount());
596         this.setItemTitleId(ri.getItemTitleId());
597         this.setOleERSIdentifier(ri.getOleERSIdentifier());
598         this.setRequestorId(ri.getRequestorId());
599         this.setInternalRequestorId(ri.getInternalRequestorId());
600         this.setRequestorTypeId(ri.getRequestorTypeId());
601         this.setItemListPrice(ri.getItemListPrice());
602         this.setItemDiscount(ri.getItemDiscount());
603         this.setItemDiscountType(ri.getItemDiscountType());
604         this.setItemRouteToRequestorIndicator(ri.isItemRouteToRequestorIndicator());
605         this.setItemPublicViewIndicator(ri.isItemPublicViewIndicator());
606         this.setVendorItemPoNumber(ri.getVendorItemPoNumber());
607         // Foreign Currency Conversion
608         this.setItemCurrencyType(ri.getItemCurrencyType());
609         this.setItemForeignListPrice(ri.getItemForeignListPrice());
610         this.setItemForeignDiscount(ri.getItemForeignDiscount());
611         this.setItemForeignDiscountAmt(ri.getItemForeignDiscountAmt());
612         this.setItemForeignDiscountType(ri.getItemForeignDiscountType());
613         this.setItemForeignUnitCost(ri.getItemForeignUnitCost());
614         this.setItemExchangeRate(ri.getItemExchangeRate());
615         this.setItemUnitCostUSD(ri.getItemUnitCostUSD());
616         this.setCategory(ri.getCategory());
617         this.setCategoryId(ri.getCategoryId());
618         this.setFormatTypeName(ri.getFormatTypeName());
619         this.setFormatTypeId(ri.getFormatTypeId());
620         this.setOleRequestSourceType(ri.getOleRequestSourceType());
621         this.setRequestSourceTypeId(ri.getRequestSourceTypeId());
622         this.setReceiptStatusId(ri.getReceiptStatusId());
623         this.setItemPriceSource(ri.getItemPriceSource());
624         this.setItemPriceSourceId(ri.getItemPriceSourceId());
625         this.setPurposeId(ri.getPurposeId());
626         this.setItemLocation(ri.getItemLocation());
627         this.setItemStatus(ri.getItemStatus());
628         this.setOleDonors(ri.getOleDonors());
629         this.setDoNotClaim(ri.isDoNotClaim());
630         this.setClaimDate(ri.getClaimDate());
631         this.setLinkToOrderOption(ri.getLinkToOrderOption());
632 
633 
634         //copy use tax items over, and blank out keys (useTaxId and itemIdentifier)
635         for (PurApItemUseTax useTaxItem : ri.getUseTaxItems()) {
636             PurchaseOrderItemUseTax newItemUseTax = new PurchaseOrderItemUseTax(useTaxItem);
637             newItemUseTax.setItemIdentifier(itemIdentifier);
638             this.getUseTaxItems().add(newItemUseTax);
639 
640         }
641 
642         this.setExternalOrganizationB2bProductReferenceNumber(ri.getExternalOrganizationB2bProductReferenceNumber());
643         this.setExternalOrganizationB2bProductTypeName(ri.getExternalOrganizationB2bProductTypeName());
644 
645         this.setItemReceivedTotalQuantity(org.kuali.rice.core.api.util.type.KualiDecimal.ZERO);
646         this.setItemDamagedTotalQuantity(org.kuali.rice.core.api.util.type.KualiDecimal.ZERO);
647 
648         this.setItemTypeCode(ri.getItemTypeCode());
649 
650         if (ri.getSourceAccountingLines() != null && ri.getSourceAccountingLines().size() > 0 &&
651                 !StringUtils.equals(PurapConstants.ItemTypeCodes.ITEM_TYPE_ORDER_DISCOUNT_CODE, ri.getItemType().getItemTypeCode())) {
652             List accounts = new ArrayList();
653             for (PurApAccountingLine account : ri.getSourceAccountingLines()) {
654                 PurchaseOrderAccount poAccount = new PurchaseOrderAccount(account);
655                 poAccount.setPurchaseOrderItem(this);
656                 accounts.add(poAccount);
657             }
658             this.setSourceAccountingLines(accounts);
659         }
660         /**
661          * Setting the Notes of each item from OleRequisitionNotes to OlePurchaseOrderNotes List
662          */
663         if (ri.getNotes() != null && ri.getNotes().size() > 0 &&
664                 !StringUtils.equals(PurapConstants.ItemTypeCodes.ITEM_TYPE_ORDER_DISCOUNT_CODE, ri.getItemType().getItemTypeCode())) {
665             List notes = new ArrayList();
666             LOG.debug("Adding Notes from RequisitionItem to corresponding PurchaseOrderItem");
667             for (OleNotes note : ri.getNotes()) {
668                 OlePurchaseOrderNotes poNote = new OlePurchaseOrderNotes(note);
669                 poNote.setOlePurchaseOrderItem(this);
670                 poNote.setNoteType(note.getNoteType());
671                 notes.add(poNote);
672             }
673             this.setNotes(notes);
674         }
675         this.setCopyList(ri.getCopyList());
676         // By default, set the item active indicator to true.
677         // In amendment, the user can set it to false when they click on
678         // the inactivate button.
679         this.setItemActiveIndicator(true);
680 
681         this.setPurchasingCommodityCode(ri.getPurchasingCommodityCode());
682         this.setCommodityCode(getCommodityCode());
683 
684         // If the RequisitionItem has a CapitalAssetItem, create a new PurchasingCapitalAssetItem and add it to the PO.
685         if (ObjectUtils.isNotNull(reqCamsItem)) {
686             PurchaseOrderCapitalAssetItem newPOCapitalAssetItem = new PurchaseOrderCapitalAssetItem(reqCamsItem, itemIdentifier);
687             po.getPurchasingCapitalAssetItems().add(newPOCapitalAssetItem);
688         }
689     }
690 
691 
692     @Override
693     public Integer getRequestorTypeId() {
694         return requestorTypeId;
695     }
696 
697 
698     public void setRequestorTypeId(Integer requestorTypeId) {
699         this.requestorTypeId = requestorTypeId;
700     }
701 
702 
703     @Override
704     public String getInternalRequestorId() {
705         return internalRequestorId;
706     }
707 
708 
709     public void setInternalRequestorId(String internalRequestorId) {
710         this.internalRequestorId = internalRequestorId;
711     }
712 
713     @Override
714     public String getItemTitleId() {
715         return itemTitleId;
716     }
717 
718     public void setItemTitleId(String itemTitleId) {
719         this.itemTitleId = itemTitleId;
720     }
721 
722     public String getLinkToOrderOption() {
723         return linkToOrderOption;
724     }
725 
726     public void setLinkToOrderOption(String linkToOrderOption) {
727         this.linkToOrderOption = linkToOrderOption;
728     }
729 
730     public String getItemTitle() {
731         return itemTitle;
732     }
733 
734     public void setItemTitle(String itemTitle) {
735         this.itemTitle = itemTitle;
736     }
737 
738     public String getItemAuthor() {
739         return itemAuthor;
740     }
741 
742     public void setItemAuthor(String itemAuthor) {
743         this.itemAuthor = itemAuthor;
744     }
745 
746     @Override
747     public String getRequestorFirstName() {
748         return requestorFirstName;
749     }
750 
751     @Override
752     public void setRequestorFirstName(String requestorFirstName) {
753         this.requestorFirstName = requestorFirstName;
754     }
755 
756     @Override
757     public String getRequestorId() {
758         return requestorId;
759     }
760 
761 
762     public void setRequestorId(String requestorId) {
763         this.requestorId = requestorId;
764     }
765 
766     public BibInfoBean getBibInfoBean() {
767         return bibInfoBean;
768     }
769 
770 
771     @Override
772     public void setBibInfoBean(BibInfoBean bibInfoBean) {
773         this.bibInfoBean = bibInfoBean;
774     }
775 
776     public DocData getDocData() {
777         return docData;
778     }
779 
780     public void setDocData(DocData docData) {
781         this.docData = docData;
782     }
783 
784     public String getNoOfItemParts() {
785         if (this.itemNoOfParts != null) {
786             return String.valueOf(itemNoOfParts);
787         } else {
788             return String.valueOf(itemNoOfParts);
789         }
790     }
791 
792     public void setNoOfItemParts(String noOfItemParts) {
793         this.itemNoOfParts = new KualiInteger(noOfItemParts);
794     }
795 
796     public KualiInteger getItemNoOfParts() {
797         if (this.itemNoOfParts != null) {
798             return itemNoOfParts;
799         } else {
800             return itemNoOfParts;
801         }
802     }
803 
804 
805     public void setItemNoOfParts(KualiInteger itemNoOfParts) {
806         this.itemNoOfParts = itemNoOfParts;
807     }
808 
809     public KualiDecimal getItemListPrice() {
810         return itemListPrice;
811     }
812 
813 
814     public void setItemListPrice(KualiDecimal itemListPrice) {
815         this.itemListPrice = itemListPrice;
816     }
817 
818 
819     public KualiDecimal getItemDiscount() {
820         return itemDiscount;
821     }
822 
823 
824     public void setItemDiscount(KualiDecimal itemDiscount) {
825         this.itemDiscount = itemDiscount;
826     }
827 
828 
829     public String getItemDiscountType() {
830         return itemDiscountType;
831     }
832 
833 
834     public void setItemDiscountType(String itemDiscountType) {
835         this.itemDiscountType = itemDiscountType;
836     }
837 
838     public String getItemCurrencyType() {
839         return itemCurrencyType;
840     }
841 
842     public void setItemCurrencyType(String itemCurrencyType) {
843         this.itemCurrencyType = itemCurrencyType;
844     }
845 
846     public KualiDecimal getItemForeignListPrice() {
847         return itemForeignListPrice;
848     }
849 
850     public void setItemForeignListPrice(KualiDecimal itemForeignListPrice) {
851         this.itemForeignListPrice = itemForeignListPrice;
852     }
853 
854     public KualiDecimal getItemForeignDiscount() {
855         return itemForeignDiscount;
856     }
857 
858     public void setItemForeignDiscount(KualiDecimal itemForeignDiscount) {
859         this.itemForeignDiscount = itemForeignDiscount;
860     }
861 
862     public String getItemForeignDiscountType() {
863         return itemForeignDiscountType;
864     }
865 
866     public void setItemForeignDiscountType(String itemForeignDiscountType) {
867         this.itemForeignDiscountType = itemForeignDiscountType;
868     }
869 
870     public KualiDecimal getItemForeignDiscountAmt() {
871         return itemForeignDiscountAmt;
872     }
873 
874     public void setItemForeignDiscountAmt(KualiDecimal itemForeignDiscountAmt) {
875         this.itemForeignDiscountAmt = itemForeignDiscountAmt;
876     }
877 
878     public KualiDecimal getItemForeignUnitCost() {
879         return itemForeignUnitCost;
880     }
881 
882     public void setItemForeignUnitCost(KualiDecimal itemForeignUnitCost) {
883         this.itemForeignUnitCost = itemForeignUnitCost;
884     }
885 
886     public KualiDecimal getItemExchangeRate() {
887         return itemExchangeRate;
888     }
889 
890     public void setItemExchangeRate(KualiDecimal itemExchangeRate) {
891         this.itemExchangeRate = itemExchangeRate;
892     }
893 
894     public KualiDecimal getItemUnitCostUSD() {
895         return itemUnitCostUSD;
896     }
897 
898     public void setItemUnitCostUSD(KualiDecimal itemUnitCostUSD) {
899         this.itemUnitCostUSD = itemUnitCostUSD;
900     }
901 
902 
903     public Integer getCategoryId() {
904         return categoryId;
905     }
906 
907 
908     public void setCategoryId(Integer categoryId) {
909         this.categoryId = categoryId;
910     }
911 
912 
913     public Integer getFormatTypeId() {
914         return formatTypeId;
915     }
916 
917 
918     public void setFormatTypeId(Integer formatTypeId) {
919         this.formatTypeId = formatTypeId;
920     }
921 
922     public Integer getRequestSourceTypeId() {
923         return requestSourceTypeId;
924     }
925 
926 
927     public void setRequestSourceTypeId(Integer requestSourceTypeId) {
928         this.requestSourceTypeId = requestSourceTypeId;
929     }
930 
931     public OleCategory getCategory() {
932         return category;
933     }
934 
935 
936     public void setCategory(OleCategory category) {
937         this.category = category;
938     }
939 
940 
941     public OleFormatType getFormatTypeName() {
942         return formatTypeName;
943     }
944 
945 
946     public void setFormatTypeName(OleFormatType formatTypeName) {
947         this.formatTypeName = formatTypeName;
948     }
949 
950 
951     public OleRequestSourceType getOleRequestSourceType() {
952         return oleRequestSourceType;
953     }
954 
955 
956     public void setOleRequestSourceType(OleRequestSourceType oleRequestSourceType) {
957         this.oleRequestSourceType = oleRequestSourceType;
958     }
959 
960 
961     public Integer getItemPriceSourceId() {
962         return itemPriceSourceId;
963     }
964 
965 
966     public void setItemPriceSourceId(Integer itemPriceSourceId) {
967         this.itemPriceSourceId = itemPriceSourceId;
968     }
969 
970 
971     public OleItemPriceSource getItemPriceSource() {
972         return itemPriceSource;
973     }
974 
975 
976     public void setItemPriceSource(OleItemPriceSource itemPriceSource) {
977         this.itemPriceSource = itemPriceSource;
978     }
979 
980 
981     // Added for OLE-2058 Starts
982 
983     /**
984      * Gets the total parts received in a purchase order item.
985      *
986      * @return itemReceivedTotalParts.
987      */
988     public KualiDecimal getItemReceivedTotalParts() {
989         return itemReceivedTotalParts;
990     }
991 
992     /**
993      * Sets the total parts received in a purchase order item.
994      *
995      * @param itemReceivedTotalParts to set.
996      */
997     public void setItemReceivedTotalParts(KualiDecimal itemReceivedTotalParts) {
998         this.itemReceivedTotalParts = itemReceivedTotalParts;
999     }
1000 
1001     /**
1002      * Gets the total parts damaged in a purchase order item.
1003      *
1004      * @return itemDamagedTotalParts.
1005      */
1006     public KualiDecimal getItemDamagedTotalParts() {
1007         return itemDamagedTotalParts;
1008     }
1009 
1010     /**
1011      * Sets the total parts damaged in a purchase order item.
1012      *
1013      * @param itemDamagedTotalParts to set.
1014      */
1015     public void setItemDamagedTotalParts(KualiDecimal itemDamagedTotalParts) {
1016         this.itemDamagedTotalParts = itemDamagedTotalParts;
1017     }
1018     // Added for OLE-2058 Ends
1019 
1020     public boolean isItemRouteToRequestorIndicator() {
1021         return itemRouteToRequestorIndicator;
1022     }
1023 
1024     public void setItemRouteToRequestorIndicator(boolean itemRouteToRequestorIndicator) {
1025         this.itemRouteToRequestorIndicator = itemRouteToRequestorIndicator;
1026     }
1027 
1028     public boolean isItemPublicViewIndicator() {
1029         return itemPublicViewIndicator;
1030     }
1031 
1032     public void setItemPublicViewIndicator(boolean itemPublicViewIndicator) {
1033         this.itemPublicViewIndicator = itemPublicViewIndicator;
1034     }
1035 
1036     public boolean isLatestExchangeRate() {
1037         return latestExchangeRate;
1038     }
1039 
1040     public void setLatestExchangeRate(boolean latestExchangeRate) {
1041         this.latestExchangeRate = latestExchangeRate;
1042     }
1043 
1044 
1045     /**
1046      * @see org.kuali.ole.module.purap.businessobject.PurchasingItemBase#getAccountingLineClass()
1047      */
1048     @Override
1049     public Class getAccountingLineClass() {
1050         return OlePurchaseOrderAccount.class;
1051     }
1052 
1053 
1054     public String getBibUUID() {
1055         return bibUUID;
1056     }
1057 
1058     public void setBibUUID(String bibUUID) {
1059         this.bibUUID = bibUUID;
1060     }
1061 
1062     public String getVendorItemPoNumber() {
1063         return vendorItemPoNumber;
1064     }
1065 
1066     public void setVendorItemPoNumber(String vendorItemPoNumber) {
1067         this.vendorItemPoNumber = vendorItemPoNumber;
1068     }
1069 
1070     @Override
1071     public void refresh() {
1072         // TODO Auto-generated method stub
1073 
1074     }
1075 
1076     public String getPersonName(String principalId) {
1077         Person person = SpringContext.getBean(PersonService.class).getPerson(principalId);
1078         if (person != null) {
1079             return person.getName();
1080         } else {
1081             return null;
1082         }
1083     }
1084 
1085     /**
1086      * Gets the no Of CopiesReceived in a purchase order item.
1087      *
1088      * @return noOfCopiesReceived.
1089      */
1090     public String getNoOfCopiesReceived() {
1091         return noOfCopiesReceived;
1092     }
1093 
1094     /**
1095      * Sets the no Of CopiesReceived in a purchase order item.
1096      *
1097      * @param noOfCopiesReceived to set.
1098      */
1099     public void setNoOfCopiesReceived(String noOfCopiesReceived) {
1100         this.noOfCopiesReceived = noOfCopiesReceived;
1101     }
1102 
1103     /**
1104      * Gets the no Of Parts Received in a purchase order item.
1105      *
1106      * @return noOfPartsReceived.
1107      */
1108     public String getNoOfPartsReceived() {
1109         return noOfPartsReceived;
1110     }
1111 
1112     /**
1113      * Sets the no Of Parts Received in a purchase order item.
1114      *
1115      * @param noOfPartsReceived to set.
1116      */
1117     public void setNoOfPartsReceived(String noOfPartsReceived) {
1118         this.noOfPartsReceived = noOfPartsReceived;
1119     }
1120 
1121     public KualiDecimal getInvoicePrice() {
1122         return invoicePrice;
1123     }
1124 
1125     public void setInvoicePrice(KualiDecimal invoicePrice) {
1126         this.invoicePrice = invoicePrice;
1127     }
1128 
1129     public KualiDecimal getItemForeignUnitPrice() {
1130         return itemForeignUnitPrice;
1131     }
1132 
1133     public void setItemForeignUnitPrice(KualiDecimal itemForeignUnitPrice) {
1134         this.itemForeignUnitPrice = itemForeignUnitPrice;
1135     }
1136 
1137     public KualiInteger getItemPoQty() {
1138         if (itemPoQty == null || itemPoQty.equals(KualiInteger.ZERO)) {
1139             itemPoQty = new KualiInteger(this.getItemQuantity().bigDecimalValue());
1140         }
1141         return itemPoQty;
1142     }
1143 
1144     public void setItemPoQty(KualiInteger itemPoQty) {
1145         this.itemPoQty = itemPoQty;
1146     }
1147 
1148     /**
1149      * Gets the itemForiegnExtendedPrice attribute.
1150      *
1151      * @return Returns the itemForiegnExtendedPrice.
1152      */
1153     public KualiDecimal getItemForiegnExtendedPrice() {
1154         return itemForiegnExtendedPrice;
1155     }
1156 
1157     /**
1158      * Sets the itemForiegnExtendedPrice attribute value.
1159      *
1160      * @param itemForiegnExtendedPrice The itemForiegnExtendedPrice to set.
1161      */
1162     public void setItemForiegnExtendedPrice(KualiDecimal itemForiegnExtendedPrice) {
1163         this.itemForiegnExtendedPrice = itemForiegnExtendedPrice;
1164     }
1165 
1166     /**
1167      * Gets the itemLocation attribute.
1168      *
1169      * @return Returns the itemLocation.
1170      */
1171     public String getItemLocation() {
1172         return itemLocation;
1173     }
1174 
1175     /**
1176      * Sets the itemLocation attribute value.
1177      *
1178      * @param itemLocation The itemLocation to set.
1179      */
1180     public void setItemLocation(String itemLocation) {
1181         this.itemLocation = itemLocation;
1182     }
1183 
1184     /**
1185      * Gets the itemCopiesId attribute.
1186      *
1187      * @return Returns the itemCopiesId.
1188      */
1189     public Integer getItemCopiesId() {
1190         return itemCopiesId;
1191     }
1192 
1193     /**
1194      * Sets the itemCopiesId attribute value.
1195      *
1196      * @param itemCopiesId The itemCopiesId to set.
1197      */
1198     public void setItemCopiesId(Integer itemCopiesId) {
1199         this.itemCopiesId = itemCopiesId;
1200     }
1201 
1202     /**
1203      * Gets the parts attribute.
1204      *
1205      * @return Returns the parts.
1206      */
1207     public KualiInteger getParts() {
1208         return parts;
1209     }
1210 
1211     /**
1212      * Sets the parts attribute value.
1213      *
1214      * @param parts The parts to set.
1215      */
1216     public void setParts(KualiInteger parts) {
1217         this.parts = parts;
1218     }
1219 
1220     /**
1221      * Gets the itemCopies attribute.
1222      *
1223      * @return Returns the itemCopies.
1224      */
1225     public KualiDecimal getItemCopies() {
1226         return itemCopies;
1227     }
1228 
1229     /**
1230      * Sets the itemCopies attribute value.
1231      *
1232      * @param itemCopies The itemCopies to set.
1233      */
1234     public void setItemCopies(KualiDecimal itemCopies) {
1235         this.itemCopies = itemCopies;
1236     }
1237 
1238     /**
1239      * Gets the partEnumeration attribute.
1240      *
1241      * @return Returns the partEnumeration.
1242      */
1243     public String getPartEnumeration() {
1244         return partEnumeration;
1245     }
1246 
1247     /**
1248      * Sets the partEnumeration attribute value.
1249      *
1250      * @param partEnumeration The partEnumeration to set.
1251      */
1252     public void setPartEnumeration(String partEnumeration) {
1253         this.partEnumeration = partEnumeration;
1254     }
1255 
1256     /**
1257      * Gets the locationCopies attribute.
1258      *
1259      * @return Returns the locationCopies.
1260      */
1261     public String getLocationCopies() {
1262         return locationCopies;
1263     }
1264 
1265     /**
1266      * Sets the locationCopies attribute value.
1267      *
1268      * @param locationCopies The locationCopies to set.
1269      */
1270     public void setLocationCopies(String locationCopies) {
1271         this.locationCopies = locationCopies;
1272     }
1273 
1274     /**
1275      * Gets the startingCopyNumber attribute.
1276      *
1277      * @return Returns the startingCopyNumber.
1278      */
1279     public KualiInteger getStartingCopyNumber() {
1280         return startingCopyNumber;
1281     }
1282 
1283     /**
1284      * Sets the startingCopyNumber attribute value.
1285      *
1286      * @param startingCopyNumber The startingCopyNumber to set.
1287      */
1288     public void setStartingCopyNumber(KualiInteger startingCopyNumber) {
1289         this.startingCopyNumber = startingCopyNumber;
1290     }
1291 
1292     /**
1293      * Gets the copies attribute.
1294      *
1295      * @return Returns the copies.
1296      */
1297     public List<OleCopies> getCopies() {
1298         return copies;
1299     }
1300 
1301     /**
1302      * Sets the copies attribute value.
1303      *
1304      * @param copies The copies to set.
1305      */
1306     public void setCopies(List<OleCopies> copies) {
1307         this.copies = copies;
1308     }
1309 
1310     /**
1311      * Gets the paymentHistory attribute.
1312      *
1313      * @return Returns the paymentHistory.
1314      */
1315     public String getPaymentHistory() {
1316         return paymentHistory;
1317     }
1318 
1319     /**
1320      * Sets the paymentHistory attribute value.
1321      *
1322      * @param paymentHistory The paymentHistory to set.
1323      */
1324     public void setPaymentHistory(String paymentHistory) {
1325         this.paymentHistory = paymentHistory;
1326     }
1327 
1328     /**
1329      * Gets the requisitionPaymentHistory attribute.
1330      *
1331      * @return Returns the requisitionPaymentHistory.
1332      */
1333     public List<OleRequisitionPaymentHistory> getRequisitionPaymentHistory() {
1334         return requisitionPaymentHistory;
1335     }
1336 
1337     /**
1338      * Sets the requisitionPaymentHistory attribute value.
1339      *
1340      * @param requisitionPaymentHistory The requisitionPaymentHistory to set.
1341      */
1342     public void setRequisitionPaymentHistory(List<OleRequisitionPaymentHistory> requisitionPaymentHistory) {
1343         this.requisitionPaymentHistory = requisitionPaymentHistory;
1344     }
1345 
1346     /**
1347      * Gets the itemTypeDescription attribute.
1348      *
1349      * @return Returns the itemTypeDescription.
1350      */
1351     public String getItemTypeDescription() {
1352         return itemTypeDescription;
1353     }
1354 
1355     /**
1356      * Sets the itemTypeDescription attribute value.
1357      *
1358      * @param itemTypeDescription The itemTypeDescription to set.
1359      */
1360     public void setItemTypeDescription(String itemTypeDescription) {
1361         this.itemTypeDescription = itemTypeDescription;
1362     }
1363 
1364     public String getCopiesOrdered() {
1365         return String.valueOf(super.getItemQuantity().intValue());
1366     }
1367 
1368     public void setCopiesOrdered(String copiesOrdered) {
1369         super.setItemQuantity(new KualiDecimal(copiesOrdered));
1370     }
1371 
1372     /**
1373      * Gets the oleItemQuantity attribute.
1374      *
1375      * @return Returns the oleItemQuantity.
1376      */
1377     public KualiInteger getOleItemQuantity() {
1378         return new KualiInteger(super.getItemQuantity().intValue());
1379     }
1380 
1381     /**
1382      * Sets the oleItemQuantity attribute value.
1383      *
1384      * @param oleItemQuantity The oleItemQuantity to set.
1385      */
1386     public void setOleItemQuantity(KualiInteger oleItemQuantity) {
1387         super.setItemQuantity(new KualiDecimal(oleItemQuantity.intValue()));
1388     }
1389 
1390     /**
1391      * Gets the olePatronDocument attribute.
1392      *
1393      * @return Returns the olePatronDocument.
1394      */
1395     public OLERequestorPatronDocument getOlePatronDocument() {
1396         return olePatronDocument;
1397     }
1398 
1399     /**
1400      * Sets the olePatronDocument attribute value.
1401      *
1402      * @param olePatronDocument The olePatronDocument to set.
1403      */
1404     public void setOlePatronDocument(OLERequestorPatronDocument olePatronDocument) {
1405         this.olePatronDocument = olePatronDocument;
1406     }
1407 
1408     /**
1409      * Gets the olePatronId attribute.
1410      *
1411      * @return Returns the olePatronId.
1412      */
1413     public String getOlePatronId() {
1414         return olePatronId;
1415     }
1416 
1417     /**
1418      * Sets the olePatronId attribute value.
1419      *
1420      * @param olePatronId The olePatronId to set.
1421      */
1422     public void setOlePatronId(String olePatronId) {
1423         this.olePatronId = olePatronId;
1424     }
1425 
1426     /**
1427      * Sets the firstName attribute value.
1428      *
1429      * @param firstName The firstName to set.
1430      */
1431     public void setFirstName(String firstName) {
1432         this.firstName = firstName;
1433     }
1434 
1435     /**
1436      * Gets the firstName attribute.
1437      *
1438      * @return Returns the firstName.
1439      */
1440     public String getFirstName() {
1441         return firstName;
1442     }
1443 
1444 
1445     //Invoice Document
1446     private String copiesInvoicedNumber;
1447     private KualiInteger noOfCopiesInvoiced;
1448     private String partsInvoicedNumber;
1449     private KualiInteger noOfPartsInvoiced;
1450 
1451     public String getPartsInvoicedNumber() {
1452         return String.valueOf(noOfPartsInvoiced);
1453     }
1454 
1455     public void setPartsInvoicedNumber(String partsInvoicedNumber) {
1456         this.noOfPartsInvoiced = new KualiInteger(partsInvoicedNumber);
1457     }
1458 
1459     public String getCopiesInvoicedNumber() {
1460         return String.valueOf(noOfCopiesInvoiced);
1461     }
1462 
1463     public void setCopiesInvoicedNumber(String copiesInvoicedNumber) {
1464         // this.copiesInvoicedNumber = copiesInvoicedNumber;
1465         this.noOfCopiesInvoiced = new KualiInteger(copiesInvoicedNumber);
1466     }
1467 
1468     public KualiInteger getNoOfCopiesInvoiced() {
1469         return noOfCopiesInvoiced;
1470     }
1471 
1472     public void setNoOfCopiesInvoiced(KualiInteger noOfCopiesInvoiced) {
1473         this.noOfCopiesInvoiced = noOfCopiesInvoiced;
1474     }
1475 
1476     public KualiInteger getNoOfPartsInvoiced() {
1477         return noOfPartsInvoiced;
1478     }
1479 
1480     public void setNoOfPartsInvoiced(KualiInteger noOfPartsInvoiced) {
1481         this.noOfPartsInvoiced = noOfPartsInvoiced;
1482     }
1483 
1484     public boolean isItemForInvoice() {
1485         return itemForInvoice;
1486     }
1487 
1488     public void setItemForInvoice(boolean itemForInvoice) {
1489         this.itemForInvoice = itemForInvoice;
1490     }
1491 
1492     public List<OleInvoiceNote> getInvoiceNotes() {
1493         return invoiceNotes;
1494     }
1495 
1496     public void setInvoiceNotes(List<OleInvoiceNote> invoiceNotes) {
1497         this.invoiceNotes = invoiceNotes;
1498     }
1499 
1500     public String getOpenQuantity() {
1501         return String.valueOf(poOutstandingQuantity);
1502     }
1503 
1504     public void setOpenQuantity(String openQuantity) {
1505         this.poOutstandingQuantity = new KualiDecimal(openQuantity);
1506     }
1507 
1508     public KualiDecimal getPoOutstandingQuantity() {
1509         return poOutstandingQuantity;
1510     }
1511 
1512     public void setPoOutstandingQuantity(KualiDecimal poOutstandingQuantity) {
1513         this.poOutstandingQuantity = poOutstandingQuantity;
1514     }
1515 
1516     public String getInvoiceItemListPrice() {
1517         return invoiceItemListPrice;
1518     }
1519 
1520     public void setInvoiceItemListPrice(String invoiceItemListPrice) {
1521         this.invoiceItemListPrice = invoiceItemListPrice;
1522     }
1523 
1524     public String getInvoiceForeignItemListPrice() {
1525         return invoiceForeignItemListPrice;
1526     }
1527 
1528     public void setInvoiceForeignItemListPrice(String invoiceForeignItemListPrice) {
1529         this.invoiceForeignItemListPrice = invoiceForeignItemListPrice;
1530     }
1531 
1532     public String getInvoiceExchangeRate() {
1533         return invoiceExchangeRate;
1534     }
1535 
1536     public void setInvoiceExchangeRate(String invoiceExchangeRate) {
1537         this.invoiceExchangeRate = invoiceExchangeRate;
1538     }
1539 
1540     public String getInvoiceForeignDiscount() {
1541         return invoiceForeignDiscount;
1542     }
1543 
1544     public void setInvoiceForeignDiscount(String invoiceForeignDiscount) {
1545         this.invoiceForeignDiscount = invoiceForeignDiscount;
1546     }
1547 
1548     public String getInvoiceForeignUnitCost() {
1549         return invoiceForeignUnitCost;
1550     }
1551 
1552     public void setInvoiceForeignUnitCost(String invoiceForeignUnitCost) {
1553         this.invoiceForeignUnitCost = invoiceForeignUnitCost;
1554     }
1555 
1556     public String getInvoiceForeignCurrency() {
1557         return invoiceForeignCurrency;
1558     }
1559 
1560     public void setInvoiceForeignCurrency(String invoiceForeignCurrency) {
1561         this.invoiceForeignCurrency = invoiceForeignCurrency;
1562     }
1563 
1564     public String getInvoiceForeignDiscountType() {
1565         return invoiceForeignDiscountType;
1566     }
1567 
1568     public void setInvoiceForeignDiscountType(String invoiceForeignDiscountType) {
1569         this.invoiceForeignDiscountType = invoiceForeignDiscountType;
1570     }
1571 
1572     public Date getSubscriptionFromDate() {
1573         return subscriptionFromDate;
1574     }
1575 
1576     public void setSubscriptionFromDate(Date subscriptionFromDate) {
1577         this.subscriptionFromDate = subscriptionFromDate;
1578     }
1579 
1580     public Date getSubscriptionToDate() {
1581         return subscriptionToDate;
1582     }
1583 
1584     public void setSubscriptionToDate(Date subscriptionToDate) {
1585         this.subscriptionToDate = subscriptionToDate;
1586     }
1587 
1588     public boolean isSubscriptionOverlap() {
1589         return subscriptionOverlap;
1590     }
1591 
1592     public void setSubscriptionOverlap(boolean subscriptionOverlap) {
1593         this.subscriptionOverlap = subscriptionOverlap;
1594     }
1595 
1596     public List<OleCopy> getDeletedCopiesList() {
1597         return deletedCopiesList;
1598     }
1599 
1600     public void setDeletedCopiesList(List<OleCopy> deletedCopiesList) {
1601         this.deletedCopiesList = deletedCopiesList;
1602     }
1603 
1604     /**
1605      * This method returns the Invoice History for the given Item
1606      * @return paymentHistoryInvoiceViews
1607      */
1608     public List<InvoiceView> getPaymentHistoryInvoiceViews() {
1609         if (this.getPurapDocument() != null && ((OlePurchaseOrderDocument)this.getPurapDocument()).getRelatedViews() != null) {
1610             paymentHistoryInvoiceViews = ((OlePurchaseOrderDocument)this.getPurapDocument()).getRelatedViews().updateRelatedView
1611                     (InvoiceView.class, paymentHistoryInvoiceViews, false);
1612         }
1613 
1614         return paymentHistoryInvoiceViews;
1615     }
1616 
1617     /**
1618      * This method sets the Invoice History for the Given Items
1619      * @param paymentHistoryInvoiceViews
1620      */
1621     public void setPaymentHistoryInvoiceViews(List<InvoiceView> paymentHistoryInvoiceViews) {
1622         this.paymentHistoryInvoiceViews = paymentHistoryInvoiceViews;
1623     }
1624 
1625     public List<OleInvoiceDocument> getInvoiceDocuments() {
1626         return invoiceDocuments;
1627     }
1628 
1629     public void setInvoiceDocuments(List<OleInvoiceDocument> invoiceDocuments) {
1630         this.invoiceDocuments = invoiceDocuments;
1631     }
1632 
1633     public boolean isLocationFlag() {
1634         return locationFlag;
1635     }
1636 
1637     public void setLocationFlag(boolean locationFlag) {
1638         this.locationFlag = locationFlag;
1639     }
1640 
1641     public boolean isClaimFilter() {
1642         return claimFilter;
1643     }
1644 
1645     public void setClaimFilter(boolean claimFilter) {
1646         this.claimFilter = claimFilter;
1647     }
1648 
1649     public boolean isItemLocationChangeFlag() {
1650         return itemLocationChangeFlag;
1651     }
1652 
1653     public void setItemLocationChangeFlag(boolean itemLocationChangeFlag) {
1654         this.itemLocationChangeFlag = itemLocationChangeFlag;
1655     }
1656 
1657     public KualiDecimal getPreviousItemQuantity() {
1658         return previousItemQuantity;
1659     }
1660 
1661     public void setPreviousItemQuantity(KualiDecimal previousItemQuantity) {
1662         this.previousItemQuantity = previousItemQuantity;
1663     }
1664 
1665     public KualiInteger getPreviousItemNoOfParts() {
1666         return previousItemNoOfParts;
1667     }
1668 
1669     public void setPreviousItemNoOfParts(KualiInteger previousItemNoOfParts) {
1670         this.previousItemNoOfParts = previousItemNoOfParts;
1671     }
1672 
1673     //Added for Jira OLE-5370
1674     public String getTitle() {
1675         title = getItemDescription();
1676         if(title.contains(OLEConstants.ANGLE_BRACKET_LESS_THAN)){
1677             title = title.replace(OLEConstants.ANGLE_BRACKET_LESS_THAN,"&#60;");
1678         }
1679         if(title.contains(OLEConstants.ANGLE_BRACKET_GREATER_THAN)){
1680             title = title.replace(OLEConstants.ANGLE_BRACKET_GREATER_THAN,"&#62;");
1681         }
1682         return title;
1683     }
1684 
1685     public void setTitle(String title) {
1686         this.title = title;
1687     }
1688 
1689     public BibInfoRecord getBibInfoRecord() {
1690         return bibInfoRecord;
1691     }
1692 
1693     public void setBibInfoRecord(BibInfoRecord bibInfoRecord) {
1694         this.bibInfoRecord = bibInfoRecord;
1695     }
1696 
1697     public String getOleERSIdentifier() {
1698         if (this.getCopyList()!=null && this.getCopyList().size()>0){
1699             return this.getCopyList().get(0).getOleERSIdentifier();
1700         }
1701         return oleERSIdentifier;
1702     }
1703 
1704     public void setOleERSIdentifier(String oleERSIdentifier) {
1705         this.oleERSIdentifier = oleERSIdentifier;
1706     }
1707 
1708     public String geteResLink() {
1709         if (this.getOleERSIdentifier() != null) {
1710             OLEEResourceRecordDocument oleeResourceRecordDocument = KRADServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(OLEEResourceRecordDocument.class, this.getOleERSIdentifier());
1711             if (oleeResourceRecordDocument != null) {
1712                 String eResourceurl = ConfigContext.getCurrentContextConfig().getProperty("ole.eresource.url");
1713                 String url = eResourceurl + "oleERSController?viewId=OLEEResourceRecordView&amp;" + KRADConstants.DISPATCH_REQUEST_PARAMETER + "=" + KRADConstants.DOC_HANDLER_METHOD + "&" + KRADConstants.PARAMETER_DOC_ID + "=" + oleeResourceRecordDocument.getDocumentNumber() + "&" + KRADConstants.PARAMETER_COMMAND + "=" + KewApiConstants.DOCSEARCH_COMMAND;
1714                 return url;
1715 
1716             }
1717         }
1718         return eResLink;
1719     }
1720 
1721     public void seteResLink(String eResLink) {
1722         this.eResLink = eResLink;
1723     }
1724 
1725     public String getPurposeId() {
1726         return purposeId;
1727     }
1728 
1729     public void setPurposeId(String purposeId) {
1730         this.purposeId = purposeId;
1731     }
1732 
1733     public String getFundCode() {
1734         return fundCode;
1735     }
1736 
1737     public void setFundCode(String fundCode) {
1738         this.fundCode = fundCode;
1739     }
1740 }