1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.kuali.ole.select.businessobject;
17  
18  import org.kuali.ole.describe.bo.SearchResultDisplayRow;
19  import org.kuali.ole.docstore.common.client.DocstoreClient;
20  import org.kuali.ole.docstore.common.client.DocstoreClientLocator;
21  import org.kuali.ole.docstore.common.document.BibTree;
22  import org.kuali.ole.docstore.common.document.HoldingsTree;
23  import org.kuali.ole.docstore.common.document.Item;
24  import  org.kuali.ole.docstore.common.document.Holdings;
25  import org.kuali.ole.docstore.common.document.content.instance.Items;
26  import org.kuali.ole.docstore.common.document.content.instance.OleHoldings;
27  import org.kuali.ole.docstore.common.document.content.instance.xstream.HoldingOlemlRecordProcessor;
28  import org.kuali.ole.DocumentUniqueIDPrefix;
29  import org.kuali.ole.docstore.model.bo.WorkBibDocument;
30  import org.kuali.ole.docstore.model.bo.WorkInstanceDocument;
31  import org.kuali.ole.docstore.model.bo.WorkItemDocument;
32  import org.kuali.ole.docstore.model.enums.DocType;
33  import org.kuali.ole.module.purap.businessobject.CorrectionReceivingItem;
34  import org.kuali.ole.module.purap.businessobject.LineItemReceivingItem;
35  import org.kuali.ole.module.purap.document.CorrectionReceivingDocument;
36  import org.kuali.ole.pojo.OleOrderRecord;
37  import org.kuali.ole.select.bo.OLELinkPurapDonor;
38  import org.kuali.ole.select.document.service.OleLineItemReceivingService;
39  import org.kuali.ole.select.document.service.impl.OleLineItemReceivingServiceImpl;
40  import org.kuali.ole.select.lookup.DocData;
41  import org.kuali.ole.sys.OLEConstants;
42  import org.kuali.ole.sys.context.SpringContext;
43  import org.kuali.rice.core.api.util.type.KualiDecimal;
44  import org.kuali.rice.core.api.util.type.KualiInteger;
45  import org.kuali.rice.krad.util.ObjectUtils;
46  
47  import java.util.ArrayList;
48  import java.util.Collections;
49  import java.util.LinkedHashMap;
50  import java.util.List;
51  
52  public class OleCorrectionReceivingItem extends CorrectionReceivingItem implements OleReceivingItem {
53  
54      private Integer itemFormatId;
55      private KualiDecimal itemOriginalReceivedTotalParts;
56      private KualiDecimal itemOriginalReturnedTotalParts;
57      private KualiDecimal itemOriginalDamagedTotalParts;
58      private KualiDecimal itemReceivedTotalParts;
59      private KualiDecimal itemReturnedTotalParts;
60      private KualiDecimal itemDamagedTotalParts;
61  
62      private List<OleCorrectionReceivingItemExceptionNotes> correctionExceptionNoteList;
63      private Integer exceptionTypeId;
64      private String exceptionNotes;
65      private List<OleCorrectionReceivingItemReceiptNotes> correctionReceiptNoteList;
66      private List<OleCorrectionReceivingItemReceiptNotes> correctionNoteList;
67      private List<OleCorrectionReceivingItemReceiptNotes> correctionSpecialHandlingNoteList;
68      private Integer noteTypeId;
69      private String receiptNotes;
70      private boolean notesAck = false;
71      private Integer correctionReceiptNoteListSize;
72      private String itemTitleId;
73      private BibInfoBean bibInfoBean;
74      private String bibUUID;
75      private DocData docData;
76      private OleLineItemCorrectionReceivingDoc oleLineItemReceivingCorrection;
77      private OleOrderRecord oleOrderRecord;
78      private List<OleLineItemCorrectionReceivingDoc> oleCorrectionReceivingItemDocList;
79      private String notes;
80      
81  
82  
83      private String donorCode;
84      private List<OLELinkPurapDonor> oleDonors=new ArrayList<>();
85      protected String localTitleId;
86      private Integer itemCopiesId;
87      private KualiInteger parts;
88      private KualiDecimal itemCopies;
89      private String partEnumeration;
90      private String locationCopies;
91      private KualiInteger startingCopyNumber;
92      private List<OleCopies> copies = new ArrayList<OleCopies>();
93      private String itemLocation;
94  
95      
96  
97  
98      private KualiInteger oleItemOriginalReceivedTotalQuantity;
99      private KualiInteger oleItemOriginalReturnedTotalQuantity;
100     private KualiInteger oleItemOriginalDamagedTotalQuantity;
101     private KualiInteger oleItemReceivedTotalQuantity;
102     private KualiInteger oleItemReturnedTotalQuantity;
103     private KualiInteger oleItemDamagedTotalQuantity;
104     private KualiInteger oleItemOriginalReceivedTotalParts;
105     private KualiInteger oleItemOriginalReturnedTotalParts;
106     private KualiInteger oleItemOriginalDamagedTotalParts;
107     private KualiInteger oleItemReceivedTotalParts;
108     private KualiInteger oleItemReturnedTotalParts;
109     private KualiInteger oleItemDamagedTotalParts;
110     private String docFormat;
111     private String enumeration;
112     private String location;
113     private String copyNumber;
114     private String receiptStatus;
115     private List<OleCopy> copyList = new ArrayList<>();
116 
117     private DocstoreClientLocator docstoreClientLocator;
118     public String getDocFormat() {
119         return docFormat;
120     }
121 
122     public DocstoreClientLocator getDocstoreClientLocator() {
123 
124         if (docstoreClientLocator == null) {
125             docstoreClientLocator = SpringContext.getBean(DocstoreClientLocator.class);
126         }
127         return docstoreClientLocator;
128     }
129     public void setDocFormat(String docFormat) {
130         this.docFormat = docFormat;
131     }
132 
133     public Class getOleLineItemCorrectionDocClass() {
134         return OleLineItemCorrectionReceivingDoc.class;
135     }
136 
137     
138 
139 
140     public OleCorrectionReceivingItem() {
141         correctionExceptionNoteList = new ArrayList();
142         correctionReceiptNoteList = new ArrayList();
143         correctionSpecialHandlingNoteList = new ArrayList();
144         correctionNoteList = new ArrayList();
145         oleCorrectionReceivingItemDocList = new ArrayList();
146     }
147 
148     public OleCorrectionReceivingItem(CorrectionReceivingDocument rld) {
149         oleCorrectionReceivingItemDocList = new ArrayList();
150     }
151 
152     public String getLocalTitleId() {
153         return localTitleId;
154     }
155 
156     public void setLocalTitleId(String localTitleId) {
157         this.localTitleId = localTitleId;
158     }
159 
160     
161 
162 
163 
164 
165 
166     public OleCorrectionReceivingItem(LineItemReceivingItem rli, CorrectionReceivingDocument rcd) {
167         super(rli, rcd);
168 
169         OleLineItemReceivingItem oleRli = (OleLineItemReceivingItem) rli;
170         this.setItemFormatId(oleRli.getOleFormatId());
171         this.setItemOriginalReceivedTotalParts(oleRli.getItemReceivedTotalParts());
172         this.setItemOriginalReturnedTotalParts(oleRli.getItemReturnedTotalParts());
173         this.setItemOriginalDamagedTotalParts(oleRli.getItemDamagedTotalParts());
174         this.setOleDonors(oleRli.getOleDonors());
175         this.setItemReceivedTotalParts(oleRli.getItemReceivedTotalParts());
176         this.setItemReturnedTotalParts(oleRli.getItemReturnedTotalParts());
177         this.setItemDamagedTotalParts(oleRli.getItemDamagedTotalParts());
178         this.setItemTitleId(oleRli.getItemTitleId());
179         if (oleRli.getItemTitleId() != null) {
180             this.setDocFormat(DocumentUniqueIDPrefix.getBibFormatType(oleRli.getItemTitleId()));
181         }
182         String titleId = oleRli.getItemTitleId();
183         OleLineItemReceivingService oleLineItemReceivingService = SpringContext.getBean(OleLineItemReceivingServiceImpl.class);
184         if (titleId == null) {
185             OlePurchaseOrderItem olePurchaseOrderItem = oleLineItemReceivingService.getOlePurchaseOrderItem(oleRli.getPurchaseOrderIdentifier());
186             this.setItemTitleId(olePurchaseOrderItem.getItemTitleId());
187         }
188         OleLineItemCorrectionReceivingDoc oleLineItemCorrectionReceivingDoc = new OleLineItemCorrectionReceivingDoc();
189         oleLineItemCorrectionReceivingDoc.setReceivingLineItemIdentifier(this.getReceivingItemIdentifier());
190         oleLineItemCorrectionReceivingDoc.setItemTitleId(oleRli.getItemTitleId());
191         oleCorrectionReceivingItemDocList = oleLineItemCorrectionReceivingDoc.getItemTitleId() != null ? Collections.singletonList(oleLineItemCorrectionReceivingDoc) : new ArrayList();
192 
193 
194         correctionExceptionNoteList = new ArrayList();
195         correctionReceiptNoteList = new ArrayList();
196         correctionSpecialHandlingNoteList = new ArrayList();
197         correctionNoteList = new ArrayList();
198 
199         if (oleRli.getNoteList() != null && oleRli.getNoteList().size() > 0) {
200             List receiptNoteList = new ArrayList();
201             List specialHandlingNoteList = new ArrayList();
202             List noteList = new ArrayList();
203             for (OleLineItemReceivingReceiptNotes receiveNotes : oleRli.getNoteList()) {
204                 OleCorrectionReceivingItemReceiptNotes receiptNote = new OleCorrectionReceivingItemReceiptNotes(receiveNotes);
205                 receiptNote.setCorrectionReceivingItem(this);
206                 receiptNote.setNoteType(receiveNotes.getNoteType());
207                 String note = receiptNote.getNoteType().getNoteType();
208                 if (note.equalsIgnoreCase(OLEConstants.SPECIAL_PROCESSING_INSTRUCTION_NOTE)) {
209                     specialHandlingNoteList.add(receiptNote);
210                 } else {
211                     receiptNoteList.add(receiptNote);
212                 }
213                 noteList.add(receiptNote);
214             }
215             this.setCorrectionSpecialHandlingNoteList(specialHandlingNoteList);
216             this.setCorrectionReceiptNoteList(receiptNoteList);
217             this.setCorrectionReceiptNoteListSize(receiptNoteList.size());
218             this.setCorrectionNoteList(noteList);
219         }
220 
221         if (oleRli.getExceptionNoteList() != null && oleRli.getExceptionNoteList().size() > 0) {
222             List exceptionNoteList = new ArrayList();
223             for (OleReceivingLineExceptionNotes receiveExceptionNotes : oleRli.getExceptionNoteList()) {
224                 OleCorrectionReceivingItemExceptionNotes exceptionNotes = new OleCorrectionReceivingItemExceptionNotes(receiveExceptionNotes);
225                 exceptionNotes.setReceivingLineItem(oleRli);
226                 exceptionNotes.setExceptionType(receiveExceptionNotes.getExceptionType());
227                 exceptionNoteList.add(exceptionNotes);
228             }
229             this.setCorrectionExceptionNoteList(exceptionNoteList);
230         }
231         this.setPurchaseOrderIdentifier(rli.getPurchaseOrderIdentifier());
232         BibTree bibTree=new BibTree();
233         if (null != this.itemTitleId) {
234             
235 
236             
237             try{
238             bibTree = getDocstoreClientLocator().getDocstoreClient().retrieveBibTree(this.itemTitleId);
239             }
240             catch (Exception e) {
241                 e.printStackTrace();
242             }
243 
244         }
245         if (null != this.itemTitleId ) {
246             if (this.getItemReceivedTotalQuantity().isGreaterThan(new KualiDecimal(1))
247                     || this.getItemReceivedTotalParts().isGreaterThan(new KualiDecimal(1))) {
248                     List<OleCopies> copies = setCopiesToLineItem(bibTree);
249                     this.setCopies(copies);
250                     this.setItemReceivedTotalQuantity(oleRli.getItemReceivedTotalQuantity());
251                     this.setItemReceivedTotalParts(oleRli.getItemReceivedTotalParts());
252 
253             }
254         }
255         this.setCopyList(oleRli.getCopyList());
256         
257     }
258 
259     
260 
261 
262 
263 
264     @Override
265     public boolean isConsideredEntered() {
266         boolean isConsideredEntered = super.isConsideredEntered();
267         isConsideredEntered |= !((ObjectUtils.isNull(this.getItemReceivedTotalParts()) || this.getItemReceivedTotalParts().isZero()) &&
268                 (ObjectUtils.isNull(this.getItemDamagedTotalParts()) || this.getItemDamagedTotalParts().isZero()) &&
269                 (ObjectUtils.isNull(this.getItemReturnedTotalParts()) || this.getItemReturnedTotalParts().isZero()));
270         return isConsideredEntered;
271     }
272 
273     public Integer getItemFormatId() {
274         return itemFormatId;
275     }
276 
277     public void setItemFormatId(Integer itemFormatId) {
278         this.itemFormatId = itemFormatId;
279     }
280 
281 
282     public List<OleLineItemCorrectionReceivingDoc> getOleCorrectionReceivingItemDocList() {
283         return oleCorrectionReceivingItemDocList;
284     }
285 
286     public void setOleCorrectionReceivingItemDocList(List<OleLineItemCorrectionReceivingDoc> oleCorrectionReceivingItemDocList) {
287         this.oleCorrectionReceivingItemDocList = oleCorrectionReceivingItemDocList;
288     }
289 
290     public String getDonorCode() {
291         return donorCode;
292     }
293 
294     public void setDonorCode(String donorCode) {
295         this.donorCode = donorCode;
296     }
297 
298     public List<OLELinkPurapDonor> getOleDonors() {
299         return oleDonors;
300     }
301 
302     public void setOleDonors(List<OLELinkPurapDonor> oleDonors) {
303         this.oleDonors = oleDonors;
304     }
305 
306     
307 
308 
309 
310 
311     @Override
312     public KualiDecimal getItemOriginalReceivedTotalParts() {
313         return itemOriginalReceivedTotalParts;
314     }
315 
316     
317 
318 
319 
320 
321     @Override
322     public void setItemOriginalReceivedTotalParts(KualiDecimal itemOriginalReceivedTotalParts) {
323         this.itemOriginalReceivedTotalParts = itemOriginalReceivedTotalParts;
324     }
325 
326     
327 
328 
329 
330 
331     @Override
332     public KualiDecimal getItemOriginalReturnedTotalParts() {
333         return itemOriginalReturnedTotalParts;
334     }
335 
336     
337 
338 
339 
340 
341     @Override
342     public void setItemOriginalReturnedTotalParts(KualiDecimal itemOriginalReturnedTotalParts) {
343         this.itemOriginalReturnedTotalParts = itemOriginalReturnedTotalParts;
344     }
345 
346     
347 
348 
349 
350 
351     @Override
352     public KualiDecimal getItemOriginalDamagedTotalParts() {
353         return itemOriginalDamagedTotalParts;
354     }
355 
356     
357 
358 
359 
360 
361     @Override
362     public void setItemOriginalDamagedTotalParts(KualiDecimal itemOriginalDamagedTotalParts) {
363         this.itemOriginalDamagedTotalParts = itemOriginalDamagedTotalParts;
364     }
365 
366     
367 
368 
369 
370 
371     @Override
372     public KualiDecimal getItemReceivedTotalParts() {
373         return itemReceivedTotalParts;
374     }
375 
376     
377 
378 
379 
380 
381     @Override
382     public void setItemReceivedTotalParts(KualiDecimal itemReceivedTotalParts) {
383         this.itemReceivedTotalParts = itemReceivedTotalParts;
384     }
385 
386     
387 
388 
389 
390 
391     @Override
392     public KualiDecimal getItemReturnedTotalParts() {
393         return itemReturnedTotalParts;
394     }
395 
396     
397 
398 
399 
400 
401     @Override
402     public void setItemReturnedTotalParts(KualiDecimal itemReturnedTotalParts) {
403         this.itemReturnedTotalParts = itemReturnedTotalParts;
404     }
405 
406     
407 
408 
409 
410 
411     @Override
412     public KualiDecimal getItemDamagedTotalParts() {
413         return itemDamagedTotalParts;
414     }
415 
416     
417 
418 
419 
420 
421     @Override
422     public void setItemDamagedTotalParts(KualiDecimal itemDamagedTotalParts) {
423         this.itemDamagedTotalParts = itemDamagedTotalParts;
424     }
425 
426     
427 
428 
429 
430 
431     public List<OleCorrectionReceivingItemExceptionNotes> getCorrectionExceptionNoteList() {
432         return correctionExceptionNoteList;
433     }
434 
435     
436 
437 
438 
439 
440     public void setCorrectionExceptionNoteList(List<OleCorrectionReceivingItemExceptionNotes> correctionExceptionNoteList) {
441         this.correctionExceptionNoteList = correctionExceptionNoteList;
442     }
443 
444     
445 
446 
447 
448 
449     public Integer getExceptionTypeId() {
450         return exceptionTypeId;
451     }
452 
453     
454 
455 
456 
457 
458     public void setExceptionTypeId(Integer exceptionTypeId) {
459         this.exceptionTypeId = exceptionTypeId;
460     }
461 
462     
463 
464 
465 
466 
467     public String getExceptionNotes() {
468         return exceptionNotes;
469     }
470 
471     
472 
473 
474 
475 
476     public void setExceptionNotes(String exceptionNotes) {
477         this.exceptionNotes = exceptionNotes;
478     }
479 
480     
481 
482 
483 
484 
485     public Class getExceptionNotesClass() {
486         return OleCorrectionReceivingItemExceptionNotes.class;
487     }
488 
489     
490 
491 
492 
493 
494     public void addExceptionNote(OleCorrectionReceivingItemExceptionNotes exceptionNotes) {
495         correctionExceptionNoteList.add(exceptionNotes);
496 
497     }
498 
499     
500 
501 
502 
503 
504     public void deleteExceptionNote(int lineNum) {
505         correctionExceptionNoteList.remove(lineNum);
506 
507     }
508 
509     
510 
511 
512 
513 
514     public List<OleCorrectionReceivingItemReceiptNotes> getCorrectionReceiptNoteList() {
515         return correctionReceiptNoteList;
516     }
517 
518     
519 
520 
521 
522 
523     public void setCorrectionReceiptNoteList(List<OleCorrectionReceivingItemReceiptNotes> correctionReceiptNoteList) {
524         this.correctionReceiptNoteList = correctionReceiptNoteList;
525     }
526 
527     
528 
529 
530 
531 
532     public Integer getNoteTypeId() {
533         return noteTypeId;
534     }
535 
536     
537 
538 
539 
540 
541     public void setNoteTypeId(Integer noteTypeId) {
542         this.noteTypeId = noteTypeId;
543     }
544 
545     
546 
547 
548 
549 
550     public String getReceiptNotes() {
551         return receiptNotes;
552     }
553 
554     
555 
556 
557 
558 
559     public void setReceiptNotes(String receiptNotes) {
560         this.receiptNotes = receiptNotes;
561     }
562 
563     
564 
565 
566 
567 
568     public Class getReceiptNotesClass() {
569         return OleCorrectionReceivingItemReceiptNotes.class;
570     }
571 
572     
573 
574 
575 
576 
577     public void addReceiptNote(OleCorrectionReceivingItemReceiptNotes receiptNotes) {
578         correctionReceiptNoteList.add(receiptNotes);
579 
580     }
581 
582     
583 
584 
585 
586 
587     public void deleteReceiptNote(int lineNum) {
588         correctionReceiptNoteList.remove(lineNum);
589 
590     }
591 
592     
593 
594 
595 
596 
597     public List<OleCorrectionReceivingItemReceiptNotes> getCorrectionSpecialHandlingNoteList() {
598         return correctionSpecialHandlingNoteList;
599     }
600 
601     
602 
603 
604 
605 
606 
607     public void setCorrectionSpecialHandlingNoteList(List<OleCorrectionReceivingItemReceiptNotes> specialHandlingNoteList) {
608         this.correctionSpecialHandlingNoteList = specialHandlingNoteList;
609     }
610 
611     
612 
613 
614 
615 
616     public boolean isNotesAck() {
617         return notesAck;
618     }
619 
620     
621 
622 
623 
624 
625     public void setNotesAck(boolean notesAck) {
626         this.notesAck = notesAck;
627     }
628 
629     
630 
631 
632 
633 
634     public List<OleCorrectionReceivingItemReceiptNotes> getCorrectionNoteList() {
635         return correctionNoteList;
636     }
637 
638     
639 
640 
641 
642 
643     public void setCorrectionNoteList(List<OleCorrectionReceivingItemReceiptNotes> correctionNoteList) {
644         this.correctionNoteList = correctionNoteList;
645     }
646 
647     
648 
649 
650 
651 
652     public void addNote(OleCorrectionReceivingItemReceiptNotes receiptNotes) {
653         correctionNoteList.add(receiptNotes);
654     }
655 
656     
657 
658 
659 
660 
661     public void deleteNote(int lineNum) {
662         correctionNoteList.remove(lineNum);
663 
664     }
665 
666     
667 
668 
669 
670 
671     public Integer getCorrectionReceiptNoteListSize() {
672         return correctionReceiptNoteListSize;
673     }
674 
675     
676 
677 
678 
679 
680     public void setCorrectionReceiptNoteListSize(Integer correctionReceiptNoteListSize) {
681         this.correctionReceiptNoteListSize = correctionReceiptNoteListSize;
682     }
683 
684     public String getItemTitleId() {
685         return itemTitleId;
686     }
687 
688     public void setItemTitleId(String itemTitleId) {
689         this.itemTitleId = itemTitleId;
690     }
691 
692     public BibInfoBean getBibInfoBean() {
693         return bibInfoBean;
694     }
695 
696     public void setBibInfoBean(BibInfoBean bibInfoBean) {
697         this.bibInfoBean = bibInfoBean;
698     }
699 
700     public String getBibUUID() {
701         return bibUUID;
702     }
703 
704     public void setBibUUID(String bibUUID) {
705         this.bibUUID = bibUUID;
706     }
707 
708     public DocData getDocData() {
709         return docData;
710     }
711 
712     public void setDocData(DocData docData) {
713         this.docData = docData;
714     }
715 
716     public OleLineItemCorrectionReceivingDoc getOleLineItemReceivingCorrection() {
717         return oleLineItemReceivingCorrection;
718     }
719 
720     public void setOleLineItemReceivingCorrection(OleLineItemCorrectionReceivingDoc oleLineItemReceivingCorrection) {
721         this.oleLineItemReceivingCorrection = oleLineItemReceivingCorrection;
722     }
723 
724     public OleOrderRecord getOleOrderRecord() {
725         return oleOrderRecord;
726     }
727 
728     public void setOleOrderRecord(OleOrderRecord oleOrderRecord) {
729         this.oleOrderRecord = oleOrderRecord;
730     }
731 
732     
733 
734 
735 
736 
737     public Integer getItemCopiesId() {
738         return itemCopiesId;
739     }
740 
741     
742 
743 
744 
745 
746     public void setItemCopiesId(Integer itemCopiesId) {
747         this.itemCopiesId = itemCopiesId;
748     }
749 
750     
751 
752 
753 
754 
755     public KualiInteger getParts() {
756         return parts;
757     }
758 
759     
760 
761 
762 
763 
764     public void setParts(KualiInteger parts) {
765         this.parts = parts;
766     }
767 
768     
769 
770 
771 
772 
773     public KualiDecimal getItemCopies() {
774         return itemCopies;
775     }
776 
777     
778 
779 
780 
781 
782     public void setItemCopies(KualiDecimal itemCopies) {
783         this.itemCopies = itemCopies;
784     }
785 
786     
787 
788 
789 
790 
791     public String getPartEnumeration() {
792         return partEnumeration;
793     }
794 
795     
796 
797 
798 
799 
800     public void setPartEnumeration(String partEnumeration) {
801         this.partEnumeration = partEnumeration;
802     }
803 
804     
805 
806 
807 
808 
809     public String getLocationCopies() {
810         return locationCopies;
811     }
812 
813     
814 
815 
816 
817 
818     public void setLocationCopies(String locationCopies) {
819         this.locationCopies = locationCopies;
820     }
821 
822     
823 
824 
825 
826 
827     public KualiInteger getStartingCopyNumber() {
828         return startingCopyNumber;
829     }
830 
831     
832 
833 
834 
835 
836     public void setStartingCopyNumber(KualiInteger startingCopyNumber) {
837         this.startingCopyNumber = startingCopyNumber;
838     }
839 
840     
841 
842 
843 
844 
845     public List<OleCopies> getCopies() {
846         return copies;
847     }
848 
849     
850 
851 
852 
853 
854     public void setCopies(List<OleCopies> copies) {
855         this.copies = copies;
856     }
857 
858     
859 
860 
861 
862 
863     public String getNotes() {
864         return notes;
865     }
866 
867     
868 
869 
870 
871 
872     public void setNotes(String notes) {
873         this.notes = notes;
874     }
875 
876     
877 
878 
879 
880 
881     public String getItemLocation() {
882         return itemLocation;
883     }
884 
885     
886 
887 
888 
889 
890     public void setItemLocation(String itemLocation) {
891         this.itemLocation = itemLocation;
892     }
893 
894     
895 
896 
897 
898 
899 
900 
901 
902 
903     
904 
905     
906 
907 
908 
909 
910 
911 
912     
913 
914 
915 
916 
917 
918 
919 
920 
921 
922 
923 
924 
925 
926 
927 
928 
929 
930 
931 
932 
933 
934 
935 
936 
937 
938 
939 
940 
941 
942 
943 
944 
945 
946 
947 
948     public List<OleCopies> setCopiesToLineItem(BibTree bibTree) {
949        List<HoldingsTree> holdingsTreeList= bibTree.getHoldingsTrees();
950         List<OleCopies> copies = new ArrayList<OleCopies>();
951         for (HoldingsTree holdingsTree : holdingsTreeList) {
952             OleHoldings oleHoldings=new OleHoldings();
953             HoldingOlemlRecordProcessor holdingOlemlRecordProcessor=new HoldingOlemlRecordProcessor();
954             oleHoldings=(OleHoldings)holdingOlemlRecordProcessor.fromXML(holdingsTree.getHoldings().getContent());
955             List<Item> items = holdingsTree.getItems();
956             StringBuffer enumeration = new StringBuffer();
957             for (int itemDocs = 0; itemDocs < items.size(); itemDocs++) {
958                 if (itemDocs + 1 == items.size()) {
959                     enumeration = enumeration.append(items.get(itemDocs).getEnumeration());
960                 } else {
961                     enumeration = enumeration.append(items.get(itemDocs).getEnumeration() + ",");
962                 }
963 
964             }
965             int startingCopy = 0;
966             if (this.getItemReturnedTotalParts().intValue() != 0 && null != enumeration) {
967                 String enumerationSplit = enumeration.substring(1, 2);
968                 boolean isint = checkIsEnumerationSplitIsIntegerOrNot(enumerationSplit);
969                 if (isint) {
970                     startingCopy = Integer.parseInt(enumerationSplit);
971                 }
972             }
973             int noOfCopies = holdingsTree.getItems().size()
974                     / this.getItemReceivedTotalParts().intValue();
975             OleRequisitionCopies copy = new OleRequisitionCopies();
976             copy.setParts(new KualiInteger(this.getItemReceivedTotalParts().intValue()));
977             copy.setLocationCopies(oleHoldings.getLocation().getLocationLevel().getName());
978             copy.setItemCopies(new KualiDecimal(noOfCopies));
979             copy.setPartEnumeration(enumeration.toString());
980             copy.setStartingCopyNumber(new KualiInteger(startingCopy));
981             copies.add(copy);
982             
983         }
984         return copies;
985     }
986 
987     
988 
989 
990 
991 
992     public KualiInteger getOleItemOriginalReceivedTotalQuantity() {
993         return new KualiInteger(super.getItemOriginalReceivedTotalQuantity().intValue());
994     }
995 
996     
997 
998 
999 
1000 
1001 
1002     public void setOleItemOriginalReceivedTotalQuantity(KualiInteger oleItemOriginalReceivedTotalQuantity) {
1003         super.setItemOriginalReceivedTotalQuantity(new KualiDecimal(oleItemOriginalReceivedTotalQuantity.intValue()));
1004     }
1005 
1006     
1007 
1008 
1009 
1010 
1011     public KualiInteger getOleItemOriginalReturnedTotalQuantity() {
1012         return new KualiInteger(super.getItemOriginalReturnedTotalQuantity().intValue());
1013     }
1014 
1015     
1016 
1017 
1018 
1019 
1020 
1021     public void setOleItemOriginalReturnedTotalQuantity(KualiInteger oleItemOriginalReturnedTotalQuantity) {
1022         super.setItemOriginalReturnedTotalQuantity(new KualiDecimal(oleItemOriginalReturnedTotalQuantity.intValue()));
1023     }
1024 
1025     
1026 
1027 
1028 
1029 
1030     public KualiInteger getOleItemOriginalDamagedTotalQuantity() {
1031         return new KualiInteger(super.getItemOriginalDamagedTotalQuantity().intValue());
1032     }
1033 
1034     
1035 
1036 
1037 
1038 
1039 
1040     public void setOleItemOriginalDamagedTotalQuantity(KualiInteger oleItemOriginalDamagedTotalQuantity) {
1041         super.setItemOriginalDamagedTotalQuantity(new KualiDecimal(oleItemOriginalDamagedTotalQuantity.intValue()));
1042     }
1043 
1044     
1045 
1046 
1047 
1048 
1049     public KualiInteger getOleItemReceivedTotalQuantity() {
1050         return new KualiInteger(super.getItemReceivedTotalQuantity().intValue());
1051     }
1052 
1053     
1054 
1055 
1056 
1057 
1058     public void setOleItemReceivedTotalQuantity(KualiInteger oleItemReceivedTotalQuantity) {
1059         super.setItemReceivedTotalQuantity(new KualiDecimal(oleItemReceivedTotalQuantity.intValue()));
1060     }
1061 
1062     
1063 
1064 
1065 
1066 
1067     public KualiInteger getOleItemReturnedTotalQuantity() {
1068         return new KualiInteger(super.getItemReturnedTotalQuantity().intValue());
1069     }
1070 
1071     
1072 
1073 
1074 
1075 
1076     public void setOleItemReturnedTotalQuantity(KualiInteger oleItemReturnedTotalQuantity) {
1077         super.setItemReturnedTotalQuantity(new KualiDecimal(oleItemReturnedTotalQuantity.intValue()));
1078     }
1079 
1080     
1081 
1082 
1083 
1084 
1085     public KualiInteger getOleItemDamagedTotalQuantity() {
1086         return new KualiInteger(super.getItemDamagedTotalQuantity().intValue());
1087     }
1088 
1089     
1090 
1091 
1092 
1093 
1094     public void setOleItemDamagedTotalQuantity(KualiInteger oleItemDamagedTotalQuantity) {
1095         super.setItemDamagedTotalQuantity(new KualiDecimal(oleItemDamagedTotalQuantity.intValue()));
1096     }
1097 
1098     
1099 
1100 
1101 
1102 
1103     public KualiInteger getOleItemOriginalReceivedTotalParts() {
1104         return new KualiInteger(getItemOriginalReceivedTotalParts().intValue());
1105     }
1106 
1107     
1108 
1109 
1110 
1111 
1112 
1113     public void setOleItemOriginalReceivedTotalParts(KualiInteger oleItemOriginalReceivedTotalParts) {
1114         setItemOriginalReceivedTotalParts(new KualiDecimal(oleItemOriginalReceivedTotalParts.intValue()));
1115     }
1116 
1117     
1118 
1119 
1120 
1121 
1122     public KualiInteger getOleItemOriginalReturnedTotalParts() {
1123         return new KualiInteger(getItemOriginalReturnedTotalParts().intValue());
1124     }
1125 
1126     
1127 
1128 
1129 
1130 
1131 
1132     public void setOleItemOriginalReturnedTotalParts(KualiInteger oleItemOriginalReturnedTotalParts) {
1133         setItemOriginalReturnedTotalParts(new KualiDecimal(oleItemOriginalReturnedTotalParts.intValue()));
1134     }
1135 
1136     
1137 
1138 
1139 
1140 
1141     public KualiInteger getOleItemOriginalDamagedTotalParts() {
1142         return new KualiInteger(getItemOriginalDamagedTotalParts().intValue());
1143     }
1144 
1145     
1146 
1147 
1148 
1149 
1150 
1151     public void setOleItemOriginalDamagedTotalParts(KualiInteger oleItemOriginalDamagedTotalParts) {
1152         setItemOriginalDamagedTotalParts(new KualiDecimal(oleItemOriginalDamagedTotalParts.intValue()));
1153     }
1154 
1155     
1156 
1157 
1158 
1159 
1160     public KualiInteger getOleItemReceivedTotalParts() {
1161         return new KualiInteger(getItemReceivedTotalParts().intValue());
1162     }
1163 
1164     
1165 
1166 
1167 
1168 
1169     public void setOleItemReceivedTotalParts(KualiInteger oleItemReceivedTotalParts) {
1170         setItemReceivedTotalParts(new KualiDecimal(oleItemReceivedTotalParts.intValue()));
1171     }
1172 
1173     
1174 
1175 
1176 
1177 
1178     public KualiInteger getOleItemReturnedTotalParts() {
1179         return new KualiInteger(getItemReturnedTotalParts().intValue());
1180     }
1181 
1182     
1183 
1184 
1185 
1186 
1187     public void setOleItemReturnedTotalParts(KualiInteger oleItemReturnedTotalParts) {
1188         setItemReturnedTotalParts(new KualiDecimal(oleItemReturnedTotalParts.intValue()));
1189     }
1190 
1191     
1192 
1193 
1194 
1195 
1196     public KualiInteger getOleItemDamagedTotalParts() {
1197         return new KualiInteger(getItemDamagedTotalParts().intValue());
1198     }
1199 
1200     
1201 
1202 
1203 
1204 
1205     public void setOleItemDamagedTotalParts(KualiInteger oleItemDamagedTotalParts) {
1206         setItemDamagedTotalParts(new KualiDecimal(oleItemDamagedTotalParts.intValue()));
1207     }
1208 
1209     public boolean checkIsEnumerationSplitIsIntegerOrNot(String enumerationSplit) {
1210         try {
1211             int startingCopy = Integer.parseInt(enumerationSplit);
1212         } catch (NumberFormatException e) {
1213             return false;
1214         }
1215         return true;
1216     }
1217 
1218     
1219 
1220 
1221     public String getEnumeration() {
1222         return enumeration;
1223     }
1224 
1225     public void setEnumeration(String enumeration) {
1226         this.enumeration = enumeration;
1227     }
1228 
1229     public String getLocation() {
1230         return location;
1231     }
1232 
1233     public void setLocation(String location) {
1234         this.location = location;
1235     }
1236 
1237     public String getCopyNumber() {
1238         return copyNumber;
1239     }
1240 
1241     public void setCopyNumber(String copyNumber) {
1242         this.copyNumber = copyNumber;
1243     }
1244 
1245     public String getReceiptStatus() {
1246         return receiptStatus;
1247     }
1248 
1249     public void setReceiptStatus(String receiptStatus) {
1250         this.receiptStatus = receiptStatus;
1251     }
1252 
1253     public List<OleCopy> getCopyList() {
1254         return copyList;
1255     }
1256 
1257     public void setCopyList(List<OleCopy> copyList) {
1258         this.copyList = copyList;
1259     }
1260 }