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.DocumentUniqueIDPrefix;
19 import org.kuali.ole.docstore.model.bo.WorkBibDocument;
20 import org.kuali.ole.docstore.model.bo.WorkInstanceDocument;
21 import org.kuali.ole.docstore.model.bo.WorkItemDocument;
22 import org.kuali.ole.docstore.model.enums.DocType;
23 import org.kuali.ole.module.purap.PurapConstants;
24 import org.kuali.ole.module.purap.businessobject.LineItemReceivingItem;
25 import org.kuali.ole.module.purap.businessobject.PurchaseOrderItem;
26 import org.kuali.ole.module.purap.document.LineItemReceivingDocument;
27 import org.kuali.ole.module.purap.document.PurchaseOrderDocument;
28 import org.kuali.ole.module.purap.exception.PurError;
29 import org.kuali.ole.pojo.OleOrderRecord;
30 import org.kuali.ole.select.bo.OLELinkPurapDonor;
31 import org.kuali.ole.select.document.OleLineItemReceivingDocument;
32 import org.kuali.ole.select.document.service.OleCopyHelperService;
33 import org.kuali.ole.select.document.service.OleDocstoreHelperService;
34 import org.kuali.ole.select.lookup.DocData;
35 import org.kuali.ole.sys.OLEConstants;
36 import org.kuali.ole.sys.context.SpringContext;
37 import org.kuali.rice.core.api.util.type.KualiDecimal;
38 import org.kuali.rice.core.api.util.type.KualiInteger;
39 import org.kuali.rice.krad.service.BusinessObjectService;
40 import org.kuali.rice.krad.util.ObjectUtils;
41
42 import java.util.*;
43
44
45
46
47
48 public class OleLineItemReceivingItem extends LineItemReceivingItem implements OleReceivingItem {
49 private KualiDecimal itemOrderedParts;
50 private KualiDecimal itemReceivedTotalParts;
51 private KualiDecimal itemReturnedTotalParts;
52 private KualiDecimal itemDamagedTotalParts;
53
54 private KualiDecimal itemReceivedPriorParts;
55 private KualiDecimal itemReceivedToBeParts;
56 private Boolean availableToPublic = true;
57 private Integer oleFormatId;
58 protected KualiDecimal itemOriginalReceivedTotalParts;
59 protected KualiDecimal itemOriginalReturnedTotalParts;
60 protected KualiDecimal itemOriginalDamagedTotalParts;
61 protected String localTitleId;
62
63 private List<OleReceivingLineExceptionNotes> exceptionNoteList;
64 private Integer exceptionTypeId;
65 private String exceptionNotes;
66
67
68
69 private List<OleLineItemReceivingReceiptNotes> noteList;
70 private List<OleLineItemReceivingReceiptNotes> receiptNoteList;
71 private Integer noteTypeId;
72 private String receiptNotes;
73 private String notes;
74 private Integer receiptNoteListSize;
75
76
77 private List<OleLineItemReceivingReceiptNotes> specialHandlingNoteList;
78 private boolean notesAck = false;
79
80 private String itemTitleId;
81 private BibInfoBean bibInfoBean;
82 private String bibUUID;
83 private DocData docData;
84
85 private List<OleLineItemReceivingDoc> oleLineItemReceivingItemDocList;
86 private BusinessObjectService businessObjectService;
87 private OleOrderRecord oleOrderRecord;
88 protected Integer receiptStatusId;
89 private OleReceiptStatus oleReceiptStatus;
90 private String donorCode;
91 private List<OLELinkPurapDonor> oleDonors=new ArrayList<>();
92
93
94
95 private Integer itemCopiesId;
96 private KualiInteger parts;
97 private KualiDecimal itemCopies;
98 private String partEnumeration;
99 private String locationCopies;
100 private KualiInteger startingCopyNumber;
101 private List<OleCopies> copies = new ArrayList<OleCopies>();
102
103
104
105
106 private KualiInteger oleItemOrderedQuantity;
107 private KualiInteger oleItemReceivedPriorQuantity;
108 private KualiInteger oleItemReceivedToBeQuantity;
109 private KualiInteger oleItemReceivedTotalQuantity;
110 private KualiInteger oleItemReturnedTotalQuantity;
111 private KualiInteger oleItemDamagedTotalQuantity;
112 private KualiInteger oleItemOrderedParts;
113 private KualiInteger oleItemReceivedPriorParts;
114 private KualiInteger oleItemReceivedToBeParts;
115 private KualiInteger oleItemReceivedTotalParts;
116 private KualiInteger oleItemReturnedTotalParts;
117 private KualiInteger oleItemDamagedTotalParts;
118
119 private String enumeration;
120 private String location;
121 private String copyNumber;
122 private String receiptStatus;
123 private List<OleCopy> copyList = new ArrayList<>();
124 private boolean poSelected;
125 private String docFormat;
126
127
128 public String getDocFormat() {
129 return docFormat;
130 }
131
132 public void setDocFormat(String docFormat) {
133 this.docFormat = docFormat;
134 }
135
136 public boolean isPoSelected() {
137 return poSelected;
138 }
139
140 public void setPoSelected(boolean poSelected) {
141 this.poSelected = poSelected;
142 }
143
144 public String getLocalTitleId() {
145 return localTitleId;
146 }
147
148 public void setLocalTitleId(String localTitleId) {
149 this.localTitleId = localTitleId;
150 }
151
152
153
154
155
156
157 public Integer getReceiptStatusId() {
158 return receiptStatusId;
159 }
160
161
162
163
164
165
166 public void setReceiptStatusId(Integer receiptStatusId) {
167 this.receiptStatusId = receiptStatusId;
168 }
169
170
171
172
173
174
175 public OleReceiptStatus getOleReceiptStatus() {
176 return oleReceiptStatus;
177 }
178
179
180
181
182
183
184 public void setOleReceiptStatus(OleReceiptStatus oleReceiptStatus) {
185 this.oleReceiptStatus = oleReceiptStatus;
186 }
187
188 public OleOrderRecord getOleOrderRecord() {
189 return oleOrderRecord;
190 }
191
192 public void setOleOrderRecord(OleOrderRecord oleOrderRecord) {
193 this.oleOrderRecord = oleOrderRecord;
194 }
195
196 public BusinessObjectService getBusinessObjectService() {
197 return businessObjectService;
198 }
199
200 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
201 this.businessObjectService = businessObjectService;
202 }
203
204
205
206
207
208
209
210
211
212 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OleLineItemReceivingItem.class);
213
214 public List<OleLineItemReceivingDoc> getOleLineItemReceivingItemDocList() {
215 return oleLineItemReceivingItemDocList;
216 }
217
218 public void setOleLineItemReceivingItemDocList(List<OleLineItemReceivingDoc> oleLineItemReceivingItemDocList) {
219 this.oleLineItemReceivingItemDocList = oleLineItemReceivingItemDocList;
220 }
221
222
223
224
225 public OleLineItemReceivingItem() {
226 this.setItemUnitOfMeasureCode(PurapConstants.LineItemReceivingDocumentStrings.CUSTOMER_INVOICE_DETAIL_UOM_DEFAULT);
227 this.setOleItemReceivedTotalQuantity(KualiInteger.ZERO);
228 this.setOleItemReturnedTotalQuantity(KualiInteger.ZERO);
229 this.setOleItemDamagedTotalQuantity(KualiInteger.ZERO);
230 this.setItemOriginalReceivedTotalQuantity(KualiDecimal.ZERO);
231 this.setItemOriginalReturnedTotalQuantity(KualiDecimal.ZERO);
232 this.setItemOriginalDamagedTotalQuantity(KualiDecimal.ZERO);
233 this.setItemReceivedTotalParts(KualiDecimal.ZERO);
234 this.setItemReturnedTotalParts(KualiDecimal.ZERO);
235 this.setItemDamagedTotalParts(KualiDecimal.ZERO);
236 this.setItemOriginalReceivedTotalParts(KualiDecimal.ZERO);
237 this.setItemOriginalReturnedTotalParts(KualiDecimal.ZERO);
238 this.setItemOriginalDamagedTotalParts(KualiDecimal.ZERO);
239 exceptionNoteList = new ArrayList();
240 receiptNoteList = new ArrayList();
241 specialHandlingNoteList = new ArrayList();
242 noteList = new ArrayList();
243 oleLineItemReceivingItemDocList = new ArrayList();
244 }
245
246
247
248
249
250
251 public OleLineItemReceivingItem(LineItemReceivingDocument rld) {
252 super(rld);
253 this.setItemReceivedTotalParts(KualiDecimal.ZERO);
254 this.setItemReturnedTotalParts(KualiDecimal.ZERO);
255 this.setItemDamagedTotalParts(KualiDecimal.ZERO);
256 this.setItemOriginalReceivedTotalParts(KualiDecimal.ZERO);
257 this.setItemOriginalReturnedTotalParts(KualiDecimal.ZERO);
258 this.setItemOriginalDamagedTotalParts(KualiDecimal.ZERO);
259
260 exceptionNoteList = new ArrayList();
261 receiptNoteList = new ArrayList();
262 specialHandlingNoteList = new ArrayList();
263 noteList = new ArrayList();
264 oleLineItemReceivingItemDocList = new ArrayList();
265 }
266
267
268
269
270
271
272
273
274 public OleLineItemReceivingItem(PurchaseOrderItem poi, LineItemReceivingDocument rld) {
275 super(poi, rld);
276 OlePurchaseOrderItem olePoi = (OlePurchaseOrderItem) poi;
277 this.setReceiptStatusId(olePoi.getReceiptStatusId());
278 OleLineItemReceivingDocument oleLineItemRecvDoc = (OleLineItemReceivingDocument) rld;
279 if (this.getItemTitleId() == null) {
280 this.setItemTitleId(olePoi.getItemTitleId());
281 }
282 OleLineItemReceivingDoc oleLineItemReceivingDoc = new OleLineItemReceivingDoc();
283 oleLineItemReceivingDoc.setReceivingLineItemIdentifier(this.getReceivingItemIdentifier());
284 oleLineItemReceivingDoc.setItemTitleId(olePoi.getItemTitleId());
285 oleLineItemReceivingItemDocList = oleLineItemReceivingDoc.getItemTitleId() != null ? Collections.singletonList(oleLineItemReceivingDoc) : new ArrayList();
286 if (ObjectUtils.isNotNull(olePoi.getItemNoOfParts())) {
287 this.setItemOrderedParts((olePoi.getItemNoOfParts().kualiDecimalValue()));
288 } else {
289 this.setItemOrderedParts(new KualiDecimal(0));
290 }
291
292 if (ObjectUtils.isNull(olePoi.getItemReceivedTotalParts())) {
293 this.setItemReceivedPriorParts(KualiDecimal.ZERO);
294 } else {
295 this.setItemReceivedPriorParts(olePoi.getItemReceivedTotalParts());
296 }
297
298 this.setItemReceivedToBeParts(this.getItemOrderedParts().subtract(this.getItemReceivedPriorParts()));
299
300 this.setItemReceivedTotalParts(KualiDecimal.ZERO);
301 this.setItemReturnedTotalParts(KualiDecimal.ZERO);
302 this.setItemDamagedTotalParts(KualiDecimal.ZERO);
303 this.setItemOriginalReceivedTotalParts(KualiDecimal.ZERO);
304 this.setItemOriginalReturnedTotalParts(KualiDecimal.ZERO);
305 this.setItemOriginalDamagedTotalParts(KualiDecimal.ZERO);
306 exceptionNoteList = new ArrayList();
307 receiptNoteList = new ArrayList();
308 specialHandlingNoteList = new ArrayList();
309 noteList = new ArrayList();
310 if (olePoi.getNotes() != null && olePoi.getNotes().size() > 0) {
311 List receiptNoteList = new ArrayList();
312 List specialHandlingNoteList = new ArrayList();
313 List noteList = new ArrayList();
314 for (OleNotes poNote : olePoi.getNotes()) {
315 OleLineItemReceivingReceiptNotes receiptNote = new OleLineItemReceivingReceiptNotes(poNote);
316 receiptNote.setReceivingLineItem(this);
317 receiptNote.setNoteType(poNote.getNoteType());
318 String note = receiptNote.getNoteType().getNoteType();
319 if (note.equalsIgnoreCase(OLEConstants.SPECIAL_PROCESSING_INSTRUCTION_NOTE)) {
320 specialHandlingNoteList.add(receiptNote);
321 } else {
322 receiptNoteList.add(receiptNote);
323 }
324 noteList.add(receiptNote);
325 }
326 this.setSpecialHandlingNoteList(specialHandlingNoteList);
327 this.setReceiptNoteList(receiptNoteList);
328 this.setReceiptNoteListSize(receiptNoteList.size());
329 this.setNoteList(noteList);
330 }
331 this.setPurchaseOrderIdentifier(poi.getItemIdentifier());
332 this.setOleFormatId(olePoi.getFormatTypeId());
333 this.setOleDonors(olePoi.getOleDonors());
334
335 if(olePoi.getItemTitleId()!=null){
336 this.setDocFormat(DocumentUniqueIDPrefix.getBibFormatType(olePoi.getItemTitleId()));
337 }
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356 this.setCopies(olePoi.getCopies());
357 this.setCopyList(olePoi.getCopyList());
358 List<OleCopy> copyList = this.getCopyList() != null ? this.getCopyList() : new ArrayList<OleCopy>();
359 OleCopyHelperService oleCopyHelperService = SpringContext.getBean(OleCopyHelperService.class);
360
361 HashMap<String, List<OleCopy>> copyListBasedOnCopyNumber = oleCopyHelperService.getCopyListBasedOnCopyNumber(copyList,olePoi.getItemNoOfParts().intValue());
362 Iterator<Map.Entry<String, List<OleCopy>>> entries = copyListBasedOnCopyNumber.entrySet().iterator();
363 Integer receivedCopyCount = 0;
364 while (entries.hasNext()) {
365 Map.Entry<String, List<OleCopy>> entry = entries.next();
366 List<OleCopy> copyMap = entry.getValue();
367 Integer copyCount = 0;
368 for (OleCopy copy : copyMap) {
369 if (copy.getReceiptStatus()!=null && copy.getReceiptStatus().equalsIgnoreCase(OLEConstants.OleLineItemReceiving.RECEIVED_STATUS)) {
370 copyCount++;
371 }
372 }
373 if (copyCount == this.getItemOrderedParts().intValue()) {
374 receivedCopyCount++;
375 }
376 }
377 if (receivedCopyCount > 0) {
378 this.setItemReceivedTotalQuantity(new KualiDecimal(receivedCopyCount));
379 this.setItemReceivedTotalParts(new KualiDecimal(this.getItemOrderedParts().intValue()));
380 }
381 }
382
383
384
385
386
387
388 public KualiDecimal getItemOrderedParts() {
389 return itemOrderedParts;
390 }
391
392
393
394
395
396
397 public void setItemOrderedParts(KualiDecimal itemOrderedParts) {
398 this.itemOrderedParts = itemOrderedParts;
399 }
400
401
402
403
404
405
406 @Override
407 public KualiDecimal getItemReceivedTotalParts() {
408 return itemReceivedTotalParts;
409 }
410
411
412
413
414
415
416 @Override
417 public void setItemReceivedTotalParts(KualiDecimal itemReceivedTotalParts) {
418 this.itemReceivedTotalParts = itemReceivedTotalParts;
419 }
420
421
422
423
424
425
426 @Override
427 public KualiDecimal getItemReturnedTotalParts() {
428 return itemReturnedTotalParts;
429 }
430
431
432
433
434
435
436 @Override
437 public void setItemReturnedTotalParts(KualiDecimal itemReturnedTotalParts) {
438 this.itemReturnedTotalParts = itemReturnedTotalParts;
439 }
440
441
442
443
444
445
446 @Override
447 public KualiDecimal getItemDamagedTotalParts() {
448 return itemDamagedTotalParts;
449 }
450
451
452
453
454
455
456 @Override
457 public void setItemDamagedTotalParts(KualiDecimal itemDamagedTotalParts) {
458 this.itemDamagedTotalParts = itemDamagedTotalParts;
459 }
460
461
462
463
464
465
466 public KualiDecimal getItemReceivedPriorParts() {
467 if (ObjectUtils.isNull(itemReceivedPriorParts)) {
468 OlePurchaseOrderItem olePoi = (OlePurchaseOrderItem) getPurchaseOrderItem();
469 KualiDecimal priorParts = olePoi.getItemReceivedTotalParts();
470 if (priorParts == null) {
471 priorParts = new KualiDecimal(0.00);
472 }
473 setItemReceivedPriorParts(priorParts);
474 }
475 return itemReceivedPriorParts;
476 }
477
478
479
480
481
482
483 public void setItemReceivedPriorParts(KualiDecimal itemReceivedPriorParts) {
484 this.itemReceivedPriorParts = itemReceivedPriorParts;
485 }
486
487
488
489
490
491
492 public KualiDecimal getItemReceivedToBeParts() {
493
494 if (null != this.getItemOrderedParts()) {
495 KualiDecimal priorParts = getItemReceivedPriorParts();
496 if (priorParts == null) {
497 priorParts = new KualiDecimal(0.00);
498 }
499 KualiDecimal toBeParts = this.getItemOrderedParts().subtract(priorParts);
500 if (toBeParts.isNegative()) {
501 toBeParts = KualiDecimal.ZERO;
502 }
503 setItemReceivedToBeParts(toBeParts);
504
505 }
506 return itemReceivedToBeParts;
507 }
508
509
510
511
512
513
514 public void setItemReceivedToBeParts(KualiDecimal itemReceivedToBeParts) {
515 this.itemReceivedToBeParts = itemReceivedToBeParts;
516 }
517
518
519
520
521
522
523 public Boolean getAvailableToPublic() {
524 return availableToPublic;
525 }
526
527
528
529
530
531
532 public void setAvailableToPublic(Boolean availableToPublic) {
533 this.availableToPublic = availableToPublic;
534 }
535
536
537
538
539
540
541 public Integer getOleFormatId() {
542 return oleFormatId;
543 }
544
545
546
547
548
549
550 public void setOleFormatId(Integer oleFormatId) {
551 this.oleFormatId = oleFormatId;
552 }
553
554
555
556
557
558
559 @Override
560 public KualiDecimal getItemOriginalReceivedTotalParts() {
561 return itemOriginalReceivedTotalParts;
562 }
563
564
565
566
567
568
569 @Override
570 public void setItemOriginalReceivedTotalParts(KualiDecimal itemOriginalReceivedTotalParts) {
571 this.itemOriginalReceivedTotalParts = itemOriginalReceivedTotalParts;
572 }
573
574
575
576
577
578
579 @Override
580 public KualiDecimal getItemOriginalReturnedTotalParts() {
581 return itemOriginalReturnedTotalParts;
582 }
583
584
585
586
587
588
589 @Override
590 public void setItemOriginalReturnedTotalParts(KualiDecimal itemOriginalReturnedTotalParts) {
591 this.itemOriginalReturnedTotalParts = itemOriginalReturnedTotalParts;
592 }
593
594
595
596
597
598
599 @Override
600 public KualiDecimal getItemOriginalDamagedTotalParts() {
601 return itemOriginalDamagedTotalParts;
602 }
603
604
605
606
607
608
609 @Override
610 public void setItemOriginalDamagedTotalParts(KualiDecimal itemOriginalDamagedTotalParts) {
611 this.itemOriginalDamagedTotalParts = itemOriginalDamagedTotalParts;
612 }
613
614
615
616
617
618
619 @Override
620 public boolean isConsideredEntered() {
621 LOG.debug("Inside OleLineItemReceivingItem isConsideredEntered");
622 boolean isConsideredEntered = super.isConsideredEntered();
623 if (LOG.isDebugEnabled()) {
624 LOG.debug("isConsideredEntered from LineItemReceivingItem :" + isConsideredEntered);
625 }
626 isConsideredEntered &= !((ObjectUtils.isNotNull(this.getItemOrderedParts()) && this.getItemOrderedParts().isGreaterThan(KualiDecimal.ZERO)) && ((ObjectUtils.isNull(this.getItemReceivedTotalParts()) || this.getItemReceivedTotalParts().isZero()) &&
627 (ObjectUtils.isNull(this.getItemDamagedTotalParts()) || this.getItemDamagedTotalParts().isZero()) &&
628 (ObjectUtils.isNull(this.getItemReturnedTotalParts()) || this.getItemReturnedTotalParts().isZero())));
629
630 if (LOG.isDebugEnabled()) {
631 LOG.debug("isConsideredEntered from OleLineItemReceivingItem :" + isConsideredEntered);
632 }
633 return isConsideredEntered;
634 }
635
636
637
638
639
640
641
642
643 public List<OleReceivingLineExceptionNotes> getExceptionNoteList() {
644 return exceptionNoteList;
645 }
646
647
648
649
650
651
652 public void setExceptionNoteList(List<OleReceivingLineExceptionNotes> exceptionNoteList) {
653 this.exceptionNoteList = exceptionNoteList;
654 }
655
656
657
658
659
660
661 public Integer getExceptionTypeId() {
662 return exceptionTypeId;
663 }
664
665
666
667
668
669
670 public void setExceptionTypeId(Integer exceptionTypeId) {
671 this.exceptionTypeId = exceptionTypeId;
672 }
673
674
675
676
677
678
679 public String getExceptionNotes() {
680 return exceptionNotes;
681 }
682
683
684
685
686
687
688 public void setExceptionNotes(String exceptionNotes) {
689 this.exceptionNotes = exceptionNotes;
690 }
691
692
693
694
695
696
697 public Class getExceptionNotesClass() {
698 return OleReceivingLineExceptionNotes.class;
699 }
700
701
702
703
704
705
706 public void addExceptionNote(OleReceivingLineExceptionNotes exceptionNotes) {
707 exceptionNoteList.add(exceptionNotes);
708
709 }
710
711
712
713
714
715
716 public void deleteExceptionNote(int lineNum) {
717 exceptionNoteList.remove(lineNum);
718
719 }
720
721
722
723
724
725
726
727
728
729 public List<OleLineItemReceivingReceiptNotes> getNoteList() {
730 return noteList;
731 }
732
733
734
735
736
737
738 public void setNoteList(List<OleLineItemReceivingReceiptNotes> noteList) {
739 this.noteList = noteList;
740 }
741
742
743
744
745
746
747 public List<OleLineItemReceivingReceiptNotes> getReceiptNoteList() {
748 return receiptNoteList;
749 }
750
751
752
753
754
755
756 public void setReceiptNoteList(List<OleLineItemReceivingReceiptNotes> receiptNoteList) {
757 this.receiptNoteList = receiptNoteList;
758 }
759
760
761
762
763
764
765 public Integer getNoteTypeId() {
766 return noteTypeId;
767 }
768
769
770
771
772
773
774 public void setNoteTypeId(Integer noteTypeId) {
775 this.noteTypeId = noteTypeId;
776 }
777
778
779
780
781
782
783 public String getReceiptNotes() {
784 return receiptNotes;
785 }
786
787
788
789
790
791
792 public void setReceiptNotes(String receiptNotes) {
793 this.receiptNotes = receiptNotes;
794 }
795
796
797 public String getNotes() {
798 return notes;
799 }
800
801 public void setNotes(String notes) {
802 this.notes = notes;
803 }
804
805
806
807
808
809
810 public Class getOleLineItemReceivingDocClass() {
811 return OleLineItemReceivingDoc.class;
812 }
813
814
815
816
817
818
819 public Class getReceiptNotesClass() {
820 return OleLineItemReceivingReceiptNotes.class;
821 }
822
823
824
825
826
827
828 public void addReceiptNote(OleLineItemReceivingReceiptNotes receiptNotes) {
829 receiptNoteList.add(receiptNotes);
830
831 }
832
833
834
835
836
837
838 public void deleteReceiptNote(int lineNum) {
839 receiptNoteList.remove(lineNum);
840
841 }
842
843
844
845
846
847
848 public void addNote(OleLineItemReceivingReceiptNotes receiptNotes) {
849 noteList.add(receiptNotes);
850 }
851
852
853
854
855
856
857 public void deleteNote(int lineNum) {
858 noteList.remove(lineNum);
859
860 }
861
862
863
864
865
866
867
868 public List<OleLineItemReceivingReceiptNotes> getSpecialHandlingNoteList() {
869 return specialHandlingNoteList;
870 }
871
872
873
874
875
876
877 public void setSpecialHandlingNoteList(List<OleLineItemReceivingReceiptNotes> specialHandlingNoteList) {
878 this.specialHandlingNoteList = specialHandlingNoteList;
879 }
880
881
882
883
884
885
886 public boolean isNotesAck() {
887 return notesAck;
888 }
889
890
891
892
893
894
895 public void setNotesAck(boolean notesAck) {
896 this.notesAck = notesAck;
897 }
898
899
900
901
902
903
904 public Integer getReceiptNoteListSize() {
905 return receiptNoteListSize;
906 }
907
908
909
910
911
912
913 public void setReceiptNoteListSize(Integer receiptNoteListSize) {
914 this.receiptNoteListSize = receiptNoteListSize;
915 }
916
917 public String getItemTitleId() {
918 return itemTitleId;
919 }
920
921 public void setItemTitleId(String itemTitleId) {
922 this.itemTitleId = itemTitleId;
923 }
924
925
926
927
928
929
930
931 @Override
932 public PurchaseOrderItem getPurchaseOrderItem() {
933 if (LOG.isDebugEnabled()) {
934 LOG.debug("Inside OleLineItemReceivingItem getPurchaseOrderItem");
935 LOG.debug("Ole Line Item Receiving Document before refresh :" + getLineItemReceivingDocument());
936 }
937
938 if (ObjectUtils.isNull(this.getLineItemReceivingDocument())) {
939 this.refreshReferenceObject("lineItemReceivingDocument");
940 }
941
942
943
944 if (getLineItemReceivingDocument() != null) {
945 PurchaseOrderDocument po = getLineItemReceivingDocument().getPurchaseOrderDocument();
946 PurchaseOrderItem poi = null;
947 if (this.getItemType().isLineItemIndicator()) {
948 poi = (PurchaseOrderItem) po.getItem(this.getItemLineNumber().intValue() - 1);
949
950 }
951 if (poi != null) {
952 return poi;
953 } else {
954
955
956 return null;
957 }
958 } else {
959 LOG.error("getLineItemReceivingDocument() Returning null in getPurchaseOrderItem()");
960 throw new PurError("Receiving Line Object in Purchase Order item line number " + getItemLineNumber() + "or itemType " + getItemTypeCode() + " is null");
961 }
962 }
963
964 public BibInfoBean getBibInfoBean() {
965 return bibInfoBean;
966 }
967
968 public void setBibInfoBean(BibInfoBean bibInfoBean) {
969 this.bibInfoBean = bibInfoBean;
970 }
971
972 public String getBibUUID() {
973 return bibUUID;
974 }
975
976 public void setBibUUID(String bibUUID) {
977 this.bibUUID = bibUUID;
978 }
979
980 public DocData getDocData() {
981 return docData;
982 }
983
984 public void setDocData(DocData docData) {
985 this.docData = docData;
986 }
987
988
989
990
991
992
993 public Integer getItemCopiesId() {
994 return itemCopiesId;
995 }
996
997
998
999
1000
1001
1002 public void setItemCopiesId(Integer itemCopiesId) {
1003 this.itemCopiesId = itemCopiesId;
1004 }
1005
1006
1007
1008
1009
1010
1011 public KualiInteger getParts() {
1012 return parts;
1013 }
1014
1015
1016
1017
1018
1019
1020 public void setParts(KualiInteger parts) {
1021 this.parts = parts;
1022 }
1023
1024
1025
1026
1027
1028
1029 public KualiDecimal getItemCopies() {
1030 return itemCopies;
1031 }
1032
1033
1034
1035
1036
1037
1038 public void setItemCopies(KualiDecimal itemCopies) {
1039 this.itemCopies = itemCopies;
1040 }
1041
1042
1043
1044
1045
1046
1047 public String getPartEnumeration() {
1048 return partEnumeration;
1049 }
1050
1051
1052
1053
1054
1055
1056 public void setPartEnumeration(String partEnumeration) {
1057 this.partEnumeration = partEnumeration;
1058 }
1059
1060
1061
1062
1063
1064
1065 public String getLocationCopies() {
1066 return locationCopies;
1067 }
1068
1069
1070
1071
1072
1073
1074 public void setLocationCopies(String locationCopies) {
1075 this.locationCopies = locationCopies;
1076 }
1077
1078
1079
1080
1081
1082
1083 public KualiInteger getStartingCopyNumber() {
1084 return startingCopyNumber;
1085 }
1086
1087
1088
1089
1090
1091
1092 public void setStartingCopyNumber(KualiInteger startingCopyNumber) {
1093 this.startingCopyNumber = startingCopyNumber;
1094 }
1095
1096
1097
1098
1099
1100
1101 public List<OleCopies> getCopies() {
1102 return copies;
1103 }
1104
1105
1106
1107
1108
1109
1110 public void setCopies(List<OleCopies> copies) {
1111 this.copies = copies;
1112 }
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123 public List<OleCopies> setCopiesToLineItem(WorkBibDocument workBibDocument) {
1124 List<WorkInstanceDocument> instanceDocuments = workBibDocument.getWorkInstanceDocumentList();
1125 List<OleCopies> copies = new ArrayList<OleCopies>();
1126 for (WorkInstanceDocument workInstanceDocument : instanceDocuments) {
1127 List<WorkItemDocument> itemDocuments = workInstanceDocument.getItemDocumentList();
1128 StringBuffer enumeration = new StringBuffer();
1129 for (int itemDocs = 0; itemDocs < itemDocuments.size(); itemDocs++) {
1130 if (itemDocs + 1 == itemDocuments.size()) {
1131 enumeration = enumeration.append(itemDocuments.get(itemDocs).getEnumeration());
1132 } else {
1133 enumeration = enumeration.append(itemDocuments.get(itemDocs).getEnumeration() + ",");
1134 }
1135
1136 }
1137 int startingCopy = 0;
1138 if (this.getItemReturnedTotalParts().intValue() != 0 && null != enumeration) {
1139 String enumerationSplit = enumeration.substring(1, 2);
1140 boolean isint = checkIsEnumerationSplitIsIntegerOrNot(enumerationSplit);
1141 if (isint) {
1142 startingCopy = Integer.parseInt(enumerationSplit);
1143 }
1144 }
1145 int noOfCopies = workInstanceDocument.getItemDocumentList().size() / this.getItemOrderedParts().intValue();
1146 OleRequisitionCopies copy = new OleRequisitionCopies();
1147 copy.setParts(new KualiInteger(this.getItemOrderedParts().intValue()));
1148 copy.setLocationCopies(workInstanceDocument.getHoldingsDocument().getLocationName());
1149 copy.setItemCopies(new KualiDecimal(noOfCopies));
1150 copy.setPartEnumeration(enumeration.toString());
1151 copy.setStartingCopyNumber(new KualiInteger(startingCopy));
1152 copies.add(copy);
1153 }
1154 return copies;
1155 }
1156
1157 public boolean checkIsEnumerationSplitIsIntegerOrNot(String enumerationSplit) {
1158 try {
1159 int startingCopy = Integer.parseInt(enumerationSplit);
1160 } catch (NumberFormatException e) {
1161 return false;
1162 }
1163 return true;
1164 }
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197 public KualiInteger getOleItemOrderedQuantity() {
1198 return new KualiInteger(super.getItemOrderedQuantity().intValue());
1199 }
1200
1201
1202
1203
1204
1205
1206 public void setOleItemOrderedQuantity(KualiInteger oleItemOrderedQuantity) {
1207 super.setItemOrderedQuantity(new KualiDecimal(oleItemOrderedQuantity.intValue()));
1208 }
1209
1210
1211
1212
1213
1214
1215 public KualiInteger getOleItemReceivedPriorQuantity() {
1216 return new KualiInteger(super.getItemReceivedPriorQuantity().intValue());
1217 }
1218
1219
1220
1221
1222
1223
1224 public void setOleItemReceivedPriorQuantity(KualiInteger oleItemReceivedPriorQuantity) {
1225 super.setItemReceivedPriorQuantity(new KualiDecimal(oleItemReceivedPriorQuantity.intValue()));
1226 }
1227
1228
1229
1230
1231
1232
1233 public KualiInteger getOleItemReceivedToBeQuantity() {
1234 return new KualiInteger(super.getItemReceivedToBeQuantity().intValue());
1235 }
1236
1237
1238
1239
1240
1241
1242 public void setOleItemReceivedToBeQuantity(KualiInteger oleItemReceivedToBeQuantity) {
1243 super.setItemReceivedToBeQuantity(new KualiDecimal(oleItemReceivedToBeQuantity.intValue()));
1244 }
1245
1246
1247
1248
1249
1250
1251 public KualiInteger getOleItemReceivedTotalQuantity() {
1252 return new KualiInteger(super.getItemReceivedTotalQuantity().intValue());
1253 }
1254
1255
1256
1257
1258
1259
1260 public void setOleItemReceivedTotalQuantity(KualiInteger oleItemReceivedTotalQuantity) {
1261 super.setItemReceivedTotalQuantity(new KualiDecimal(oleItemReceivedTotalQuantity.intValue()));
1262 }
1263
1264
1265
1266
1267
1268
1269 public KualiInteger getOleItemReturnedTotalQuantity() {
1270 return new KualiInteger(super.getItemReturnedTotalQuantity().intValue());
1271 }
1272
1273
1274
1275
1276
1277
1278 public void setOleItemReturnedTotalQuantity(KualiInteger oleItemReturnedTotalQuantity) {
1279 super.setItemReturnedTotalQuantity(new KualiDecimal(oleItemReturnedTotalQuantity.intValue()));
1280 }
1281
1282
1283
1284
1285
1286
1287 public KualiInteger getOleItemDamagedTotalQuantity() {
1288 return new KualiInteger(super.getItemDamagedTotalQuantity().intValue());
1289 }
1290
1291
1292
1293
1294
1295
1296 public void setOleItemDamagedTotalQuantity(KualiInteger oleItemDamagedTotalQuantity) {
1297 super.setItemDamagedTotalQuantity(new KualiDecimal(oleItemDamagedTotalQuantity.intValue()));
1298 }
1299
1300
1301
1302
1303
1304
1305 public KualiInteger getOleItemOrderedParts() {
1306 return new KualiInteger(getItemOrderedParts().intValue());
1307 }
1308
1309
1310
1311
1312
1313
1314 public void setOleItemOrderedParts(KualiInteger oleItemOrderedParts) {
1315 setItemOrderedParts(new KualiDecimal(oleItemOrderedParts.intValue()));
1316 }
1317
1318
1319
1320
1321
1322
1323 public KualiInteger getOleItemReceivedPriorParts() {
1324 return new KualiInteger(getItemReceivedPriorParts().intValue());
1325 }
1326
1327
1328
1329
1330
1331
1332 public void setOleItemReceivedPriorParts(KualiInteger oleItemReceivedPriorParts) {
1333 setItemReceivedPriorParts(new KualiDecimal(oleItemReceivedPriorParts.intValue()));
1334 }
1335
1336
1337
1338
1339
1340
1341 public KualiInteger getOleItemReceivedToBeParts() {
1342 return new KualiInteger(getItemReceivedToBeParts().intValue());
1343 }
1344
1345
1346
1347
1348
1349
1350 public void setOleItemReceivedToBeParts(KualiInteger oleItemReceivedToBeParts) {
1351 setItemReceivedToBeParts(new KualiDecimal(oleItemReceivedToBeParts.intValue()));
1352 }
1353
1354
1355
1356
1357
1358
1359 public KualiInteger getOleItemReceivedTotalParts() {
1360 return new KualiInteger(getItemReceivedTotalParts().intValue());
1361 }
1362
1363
1364
1365
1366
1367
1368 public void setOleItemReceivedTotalParts(KualiInteger oleItemReceivedTotalParts) {
1369 setItemReceivedTotalParts(new KualiDecimal(oleItemReceivedTotalParts.intValue()));
1370 }
1371
1372
1373
1374
1375
1376
1377 public KualiInteger getOleItemReturnedTotalParts() {
1378 return new KualiInteger(getItemReturnedTotalParts().intValue());
1379 }
1380
1381
1382
1383
1384
1385
1386 public void setOleItemReturnedTotalParts(KualiInteger oleItemReturnedTotalParts) {
1387 setItemReturnedTotalParts(new KualiDecimal(oleItemReturnedTotalParts.intValue()));
1388 }
1389
1390
1391
1392
1393
1394
1395 public KualiInteger getOleItemDamagedTotalParts() {
1396 return new KualiInteger(getItemDamagedTotalParts().intValue());
1397 }
1398
1399
1400
1401
1402
1403
1404 public void setOleItemDamagedTotalParts(KualiInteger oleItemDamagedTotalParts) {
1405 setItemDamagedTotalParts(new KualiDecimal(oleItemDamagedTotalParts.intValue()));
1406 }
1407
1408
1409
1410
1411
1412 public String getDonorCode() {
1413 return donorCode;
1414 }
1415
1416 public void setDonorCode(String donorCode) {
1417 this.donorCode = donorCode;
1418 }
1419
1420 public List<OLELinkPurapDonor> getOleDonors() {
1421 return oleDonors;
1422 }
1423
1424 public void setOleDonors(List<OLELinkPurapDonor> oleDonors) {
1425 this.oleDonors = oleDonors;
1426 }
1427
1428 public String getEnumeration() {
1429 return enumeration;
1430 }
1431
1432 public void setEnumeration(String enumeration) {
1433 this.enumeration = enumeration;
1434 }
1435
1436 public String getLocation() {
1437 return location;
1438 }
1439
1440 public void setLocation(String location) {
1441 this.location = location;
1442 }
1443
1444 public String getCopyNumber() {
1445 return copyNumber;
1446 }
1447
1448 public void setCopyNumber(String copyNumber) {
1449 this.copyNumber = copyNumber;
1450 }
1451
1452 public String getReceiptStatus() {
1453 return receiptStatus;
1454 }
1455
1456 public void setReceiptStatus(String receiptStatus) {
1457 this.receiptStatus = receiptStatus;
1458 }
1459
1460 public List<OleCopy> getCopyList() {
1461 return copyList;
1462 }
1463
1464 public void setCopyList(List<OleCopy> copyList) {
1465 this.copyList = copyList;
1466 }
1467 }
1468