View Javadoc
1   package org.kuali.ole.deliver.bo;
2   
3   import org.apache.commons.lang3.StringUtils;
4   import org.kuali.ole.OLEConstants;
5   import org.kuali.ole.deliver.drools.LoanPeriodUtil;
6   import org.kuali.ole.deliver.service.CircDeskLocationResolver;
7   import org.kuali.ole.describe.bo.OleInstanceItemType;
8   import org.kuali.ole.describe.bo.OleLocation;
9   import org.kuali.ole.docstore.common.document.content.instance.Item;
10  import org.kuali.ole.service.OleCirculationPolicyServiceImpl;
11  import org.kuali.rice.kim.impl.identity.entity.EntityBo;
12  import org.kuali.rice.krad.bo.PersistableBusinessObject;
13  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
14  import org.kuali.rice.krad.service.KRADServiceLocator;
15  
16  import java.math.BigDecimal;
17  import java.sql.Timestamp;
18  import java.util.*;
19  
20  /**
21   * The OleLoanDocument is a BO class that defines the loan document fields with getters and setters which
22   * is used for interacting the loan data with the persistence layer in OLE.
23   */
24  public class OleLoanDocument extends PersistableBusinessObjectBase implements Comparable<OleLoanDocument> {
25  
26      private String loanId;
27      private String loanStatusId;
28      private String patronBarcode;
29      private String patronId;
30      private String itemId;
31      private boolean blockLoan;
32      private String requestFlag;
33      private boolean vuFindFlag = false;
34      private Date loanPeriodDate;
35      private Integer loanPeriod;
36      private String loanTermUnitId;
37      private Timestamp loanDueDate;
38      private String loanOperatorId;
39      private String loanApproverId;
40      private String borrowerTypeId;
41      private String borrowerTypeName;
42      private String itemInstitution;
43      private String itemCampus;
44      private String itemLibrary;
45      private String itemCollection;
46      private String itemLocation;
47      private String itemType;
48      private String itemTypeName;
49      private String itemLoanStatus;
50      private String errorMessage;
51      private String successMessage;
52      private String patronUserNotes;
53      private String patronNoteTypeId;
54      private String itemUuid;
55      private String bibUuid;
56      private transient Item oleItem;
57      private String instanceUuid;
58      private String claimsReturnNote;
59      private String location;
60      private String locationCode;
61      private boolean checkNo;
62      private boolean isValidPatron;
63      private String title;
64      private String author;
65      private OleLocation oleLocation;
66      private EntityBo entity;
67      private OleBorrowerType oleBorrowerType;
68      private OlePatronDocument olePatron;
69      private OleLoanStatus oleLoanStatus;
70      private OleLoanTermUnit oleLoanTermUnit;
71      private OleInstanceItemType oleInstanceItemType;
72      private String patronName;
73      private java.util.Date expirationDate;
74      private boolean dueDateEmpty;
75      private String itemCallNumber;
76      private String itemCallNumberPrefix;
77      private String itemCopyNumber;
78      private List<OlePatronDocument> realPatron;
79      private String realPatronBarcode;
80      private String realPatronType;
81      private String realPatronName;
82      private String itemVolumeNumber;
83      private boolean inDefinite = false;
84      private String dueDateType = "Indefinite";
85      private boolean nonCirculatingItem = false;
86      private Timestamp manualRenewalDueDate;
87      private Date renewalDateMap;
88      private String renewalDateTime;
89      private boolean renewNotFlag=false;
90      /**
91       * New Fields added
92       */
93      private boolean addressVerified;
94      private boolean generalBlock;
95      private String preferredAddress;
96      private String email;
97      private String phoneNumber;
98      private String proxyPatronId;
99      private boolean validateProxyPatron = false;
100     private String circulationLocationId;
101     private String machineId;
102     private String numberOfRenewals;
103     private String numberOfOverdueNoticesSent;
104     private String oleRequestId;
105     private String repaymentFeePatronBillId;
106     private boolean claimsReturnedIndicator;
107     private Date createDate;
108     private Date pastDueDate;
109     private Date dummyPastDueDate;
110     private Date overDueNoticeDate;
111     private String circulationPolicyId;
112     private OleCirculationDesk oleCirculationDesk;
113     private String noOfOverdueNoticesSentForBorrower;
114     private boolean renewalItemFlag = false;
115     private BigDecimal fineRate;
116     private boolean isCheckOut = false;
117     private boolean isBackGroundCheckOut = false;
118     private boolean numberOfPieces = false;
119     private boolean continueCheckIn = false;
120     private String description;
121     private String matchCheck;
122     private String billName;
123     private boolean damagedCheckInOption;
124     private OlePatronDocument oleRequestPatron;
125     private OleDeliverRequestBo oleDeliverRequestBo;
126     private Integer itemNumberOfPieces;
127     private boolean copyRequest = false;
128     private boolean requestPatron = false;
129     private BigDecimal itemPrice;
130     private BigDecimal replacementBill;
131     private boolean noticeForClaimsReturned = false;
132     private String circulationPolicySetId;
133     private String operatorsCirculationLocation;
134     private String itemFullPathLocation;
135     private String routeToLocation;
136     private String routeToLocationName;
137     private Date loanDueDateToAlter;
138     private String itemStatusCode;
139     private Timestamp claimsReturnedDate;
140     private String loanDueDateTimeToAlter;
141     private String locationId;
142 
143     private String borrowerTypeCode;
144     private boolean blockCheckinItem;
145     private String roleName;
146     private String overrideErrorMessage;
147     private HashMap<String,String> errorsAndPermission = new HashMap<>();
148     private boolean renewPermission = true;
149     private boolean renewPermissionForRequestedItem = false;
150     private boolean  replacementFeeExist ;
151     private boolean overdueFineExist;
152     private boolean differentPatron;
153     private boolean itemDamagedStatus;
154     private String  itemDamagedNote;
155     private boolean skipDamagedCheckIn;
156     private String missingPiecesCount;
157     private boolean missingPieceFlag;
158     private String missingPieceNote;
159     private String noOfMissingPiece;
160     private boolean backgroundCheckInMissingPiece;
161     private boolean lostPatron;
162     private boolean noOfPiecesEditable;
163     private boolean noOfMissingPiecesEditable;
164     private String backUpNoOfPieces;
165     private String enumeration;
166     private String chronology;
167     public String itemFullLocation;
168     public String itemStatusEffectiveDate;
169     private boolean loanModified;
170     private String noticeType;
171     private String noticeSendType;
172     private OLEDeliverNotice oleDeliverNotice;
173     private String oleLocationCode;
174     private boolean indefiniteCheckFlag= false;
175     private boolean invalidBarcodeFlag = false;
176     private boolean fastAddItemIndicator = false;
177     private String holdingsLocation;
178     private boolean itemLevelLocationExist;
179     private boolean damagedItemIndicator;
180     private Timestamp damagedItemDate;
181     private Timestamp missingPieceItemDate;
182 
183     public Date getDummyPastDueDate() {
184         return dummyPastDueDate;
185     }
186 
187     public void setDummyPastDueDate(Date dummyPastDueDate) {
188         this.dummyPastDueDate = dummyPastDueDate;
189     }
190 
191     public boolean isIndefiniteCheckFlag() {
192         return indefiniteCheckFlag;
193     }
194 
195     public void setIndefiniteCheckFlag(boolean indefiniteCheckFlag) {
196         this.indefiniteCheckFlag = indefiniteCheckFlag;
197     }
198 
199     public boolean isRenewNotFlag() {
200         return renewNotFlag;
201     }
202 
203     public void setRenewNotFlag(boolean renewNotFlag) {
204         this.renewNotFlag = renewNotFlag;
205     }
206 
207     public String getRequestFlag() {
208         return requestFlag;
209     }
210 
211     public void setRequestFlag(String requestFlag) {
212         this.requestFlag = requestFlag;
213     }
214 
215     public Date getRenewalDateMap() {
216         return renewalDateMap;
217     }
218 
219     public void setRenewalDateMap(Date renewalDateMap) {
220         this.renewalDateMap = renewalDateMap;
221     }
222 
223     public String getRenewalDateTime() {
224         return renewalDateTime;
225     }
226 
227     public void setRenewalDateTime(String renewalDateTime) {
228         this.renewalDateTime = renewalDateTime;
229     }
230 
231     /*private boolean statusLost;
232 
233     public boolean isStatusLost() {
234         return statusLost;
235     }
236 
237 
238     public void setStatusLost(boolean statusLost) {
239         this.statusLost = statusLost;
240     }*/
241 
242     public String getItemCallNumberPrefix() {
243         return itemCallNumberPrefix;
244     }
245 
246     public void setItemCallNumberPrefix(String itemCallNumberPrefix) {
247         this.itemCallNumberPrefix = itemCallNumberPrefix;
248     }
249 
250     public Timestamp getManualRenewalDueDate() {
251         return manualRenewalDueDate;
252     }
253 
254     public void setManualRenewalDueDate(Timestamp manualRenewalDueDate) {
255         this.manualRenewalDueDate = manualRenewalDueDate;
256     }
257 
258     public boolean isVuFindFlag() {
259         return vuFindFlag;
260     }
261 
262     public void setVuFindFlag(boolean vuFindFlag) {
263         this.vuFindFlag = vuFindFlag;
264     }
265 
266     public String getRouteToLocationName() {
267         return routeToLocationName;
268     }
269 
270     public void setRouteToLocationName(String routeToLocationName) {
271         this.routeToLocationName = routeToLocationName;
272     }
273 
274     //added for OLE-5119
275     private boolean courtesyNoticeFlag;
276 
277     public boolean isCourtesyNoticeFlag() {
278         return courtesyNoticeFlag;
279     }
280 
281     public String getEnumeration() {
282         return enumeration;
283     }
284 
285     public void setEnumeration(String enumeration) {
286         this.enumeration = enumeration;
287     }
288 
289     public String getChronology() {
290         return chronology;
291     }
292 
293     public void setChronology(String chronology) {
294         this.chronology = chronology;
295     }
296 
297     public void setCourtesyNoticeFlag(boolean courtesyNoticeFlag) {
298         this.courtesyNoticeFlag = courtesyNoticeFlag;
299     }
300 
301     public String getRoleName() {
302         return roleName;
303     }
304 
305     public void setRoleName(String roleName) {
306         this.roleName = roleName;
307     }
308 
309     public boolean isBlockCheckinItem() {
310         return blockCheckinItem;
311     }
312 
313     public void setBlockCheckinItem(boolean blockCheckinItem) {
314         this.blockCheckinItem = blockCheckinItem;
315     }
316 
317     public String getBorrowerTypeCode() {
318         return borrowerTypeCode;
319     }
320 
321     public void setBorrowerTypeCode(String borrowerTypeCode) {
322         this.borrowerTypeCode = borrowerTypeCode;
323     }
324 
325     public String getLocationId() {
326         return locationId;
327     }
328 
329     public void setLocationId(String locationId) {
330         this.locationId = locationId;
331     }
332 
333     public boolean isNonCirculatingItem() {
334         return nonCirculatingItem;
335     }
336 
337     public void setNonCirculatingItem(boolean nonCirculatingItem) {
338         this.nonCirculatingItem = nonCirculatingItem;
339     }
340 
341     public String getItemStatusCode() {
342         return itemStatusCode;
343     }
344 
345     public void setItemStatusCode(String itemStatusCode) {
346         this.itemStatusCode = itemStatusCode;
347     }
348 
349     public Date getLoanDueDateToAlter() {
350         return loanDueDateToAlter;
351     }
352 
353     public void setLoanDueDateToAlter(Date loanDueDateToAlter) {
354         this.loanDueDateToAlter = loanDueDateToAlter;
355     }
356 
357     public String getRouteToLocation() {
358         return routeToLocation;
359     }
360 
361     public void setRouteToLocation(String routeToLocation) {
362         this.routeToLocation = routeToLocation;
363     }
364 
365     public String getLocationCode() {
366         return locationCode;
367     }
368 
369     public void setLocationCode(String locationCode) {
370         this.locationCode = locationCode;
371     }
372 
373     public String getItemFullPathLocation() {
374         return itemFullPathLocation;
375     }
376 
377     public void setItemFullPathLocation(String itemFullPathLocation) {
378         this.itemFullPathLocation = itemFullPathLocation;
379     }
380 
381     public String getBibUuid() {
382         return bibUuid;
383     }
384 
385     public void setBibUuid(String bibUuid) {
386         this.bibUuid = bibUuid;
387     }
388 
389     public String getOperatorsCirculationLocation() {
390         return operatorsCirculationLocation;
391     }
392 
393     public void setOperatorsCirculationLocation(String operatorsCirculationLocation) {
394         this.operatorsCirculationLocation = operatorsCirculationLocation;
395     }
396 
397     public String getCirculationPolicySetId() {
398         return circulationPolicySetId;
399     }
400 
401     public void setCirculationPolicySetId(String circulationPolicySetId) {
402         this.circulationPolicySetId = circulationPolicySetId;
403     }
404 
405     public boolean isNoticeForClaimsReturned() {
406         return noticeForClaimsReturned;
407     }
408 
409     public void setNoticeForClaimsReturned(boolean noticeForClaimsReturned) {
410         this.noticeForClaimsReturned = noticeForClaimsReturned;
411     }
412 
413     public boolean isInDefinite() {
414         return inDefinite;
415     }
416 
417     public void setInDefinite(boolean inDefinite) {
418         this.inDefinite = inDefinite;
419     }
420 
421     //renewal
422     private Timestamp renewalLoanDueDate;
423     private boolean renewCheckNo;
424 
425     public String getDueDateType() {
426         return dueDateType;
427     }
428 
429     public void setDueDateType(String dueDateType) {
430         this.dueDateType = dueDateType;
431     }
432 
433     public boolean isRenewCheckNo() {
434         return renewCheckNo;
435     }
436 
437     public void setRenewCheckNo(boolean renewCheckNo) {
438         this.renewCheckNo = renewCheckNo;
439     }
440 
441     public Timestamp getRenewalLoanDueDate() {
442         return renewalLoanDueDate;
443     }
444 
445     public void setRenewalLoanDueDate(Timestamp renewalLoanDueDate) {
446         this.renewalLoanDueDate = renewalLoanDueDate;
447     }
448 
449     public boolean isAddressVerified() {
450         return addressVerified;
451     }
452 
453     public void setAddressVerified(boolean addressVerified) {
454         this.addressVerified = addressVerified;
455     }
456 
457     public boolean isGeneralBlock() {
458         return generalBlock;
459     }
460 
461     public void setGeneralBlock(boolean generalBlock) {
462         this.generalBlock = generalBlock;
463     }
464 
465     public boolean isRequestPatron() {
466         return requestPatron;
467     }
468 
469     public void setRequestPatron(boolean requestPatron) {
470         this.requestPatron = requestPatron;
471     }
472 
473     public BigDecimal getReplacementBill() {
474         return replacementBill;
475     }
476 
477     public void setReplacementBill(BigDecimal replacementBill) {
478         this.replacementBill = replacementBill;
479     }
480 
481     public BigDecimal getItemPrice() {
482         return itemPrice;
483     }
484 
485     public void setItemPrice(BigDecimal itemPrice) {
486         this.itemPrice = itemPrice;
487     }
488 
489     public String getItemCopyNumber() {
490         return itemCopyNumber;
491     }
492 
493     public void setItemCopyNumber(String itemCopyNumber) {
494         this.itemCopyNumber = itemCopyNumber;
495     }
496 
497     public boolean isCopyRequest() {
498         return copyRequest;
499     }
500 
501     public void setCopyRequest(boolean copyRequest) {
502         this.copyRequest = copyRequest;
503     }
504 
505     public boolean isValidateProxyPatron() {
506         return validateProxyPatron;
507     }
508 
509     public void setValidateProxyPatron(boolean validateProxyPatron) {
510         this.validateProxyPatron = validateProxyPatron;
511     }
512 
513     public Integer getItemNumberOfPieces() {
514         return itemNumberOfPieces;
515     }
516 
517     public void setItemNumberOfPieces(Integer itemNumberOfPieces) {
518         this.itemNumberOfPieces = itemNumberOfPieces;
519     }
520 
521     public OleDeliverRequestBo getOleDeliverRequestBo() {
522         return oleDeliverRequestBo;
523     }
524 
525     public void setOleDeliverRequestBo(OleDeliverRequestBo oleDeliverRequestBo) {
526         this.oleDeliverRequestBo = oleDeliverRequestBo;
527     }
528 
529     public OlePatronDocument getOleRequestPatron() {
530         return oleRequestPatron;
531     }
532 
533     public void setOleRequestPatron(OlePatronDocument oleRequestPatron) {
534         this.oleRequestPatron = oleRequestPatron;
535     }
536 
537     public String getRealPatronName() {
538         return realPatronName;
539     }
540 
541     public void setRealPatronName(String realPatronName) {
542         this.realPatronName = realPatronName;
543     }
544 
545     public boolean isBlockLoan() {
546         return blockLoan;
547     }
548 
549     public void setBlockLoan(boolean blockLoan) {
550         this.blockLoan = blockLoan;
551     }
552 
553     public boolean isDamagedCheckInOption() {
554         return damagedCheckInOption;
555     }
556 
557     public void setDamagedCheckInOption(boolean damagedCheckInOption) {
558         this.damagedCheckInOption = damagedCheckInOption;
559     }
560 
561     public String getBillName() {
562         return billName;
563     }
564 
565     public void setBillName(String billName) {
566         this.billName = billName;
567     }
568 
569     public boolean isContinueCheckIn() {
570         return continueCheckIn;
571     }
572 
573     public void setContinueCheckIn(boolean continueCheckIn) {
574         this.continueCheckIn = continueCheckIn;
575     }
576 
577     public OleCirculationDesk getOleCirculationDesk() {
578         return oleCirculationDesk;
579     }
580 
581     public void setOleCirculationDesk(OleCirculationDesk oleCirculationDesk) {
582         this.oleCirculationDesk = oleCirculationDesk;
583     }
584 
585     public String getDescription() {
586         return description;
587     }
588 
589     public void setDescription(String description) {
590         this.description = description;
591     }
592 
593     public String getMatchCheck() {
594         return matchCheck;
595     }
596 
597     public void setMatchCheck(String matchCheck) {
598         this.matchCheck = matchCheck;
599     }
600 
601     public boolean isNumberOfPieces() {
602         return numberOfPieces;
603     }
604 
605     public void setNumberOfPieces(boolean numberOfPieces) {
606         this.numberOfPieces = numberOfPieces;
607     }
608 
609     public BigDecimal getFineRate() {
610         return fineRate;
611     }
612 
613     public void setFineRate(BigDecimal fineRate) {
614         this.fineRate = fineRate;
615     }
616 
617     public boolean isCheckOut() {
618         return isCheckOut;
619     }
620 
621     public void setCheckOut(boolean checkOut) {
622         isCheckOut = checkOut;
623     }
624 
625     public String getRealPatronType() {
626         return realPatronType;
627     }
628 
629     public void setRealPatronType(String realPatronType) {
630         this.realPatronType = realPatronType;
631     }
632 
633     public String getRealPatronBarcode() {
634         return realPatronBarcode;
635     }
636 
637     public void setRealPatronBarcode(String realPatronBarcode) {
638         this.realPatronBarcode = realPatronBarcode;
639     }
640 
641     public List<OlePatronDocument> getRealPatron() {
642         return realPatron;
643     }
644 
645     public void setRealPatron(List<OlePatronDocument> realPatron) {
646         this.realPatron = realPatron;
647     }
648 
649     public String getPatronNoteTypeId() {
650         return patronNoteTypeId;
651     }
652 
653     public void setPatronNoteTypeId(String patronNoteTypeId) {
654         this.patronNoteTypeId = patronNoteTypeId;
655     }
656 
657     public String getPatronUserNotes() {
658         return patronUserNotes;
659     }
660 
661     public void setPatronUserNotes(String patronUserNotes) {
662         this.patronUserNotes = patronUserNotes;
663     }
664 
665     //For Check-in
666     private String itemStatus;
667     private Timestamp checkInDate;
668 
669     public Timestamp getCheckInDate() {
670         return checkInDate;
671     }
672 
673     public void setCheckInDate(Timestamp checkInDate) {
674         this.checkInDate = checkInDate;
675     }
676 
677     public boolean isRenewalItemFlag() {
678         return renewalItemFlag;
679     }
680 
681     public void setRenewalItemFlag(boolean renewalItemFlag) {
682         this.renewalItemFlag = renewalItemFlag;
683     }
684 
685 
686     public String getItemStatus() {
687         return itemStatus;
688     }
689 
690     public void setItemStatus(String itemStatus) {
691         this.itemStatus = itemStatus;
692     }
693 
694     public String getLocation() {
695         return location;
696     }
697 
698     public void setLocation(String location) {
699         this.location = location;
700     }
701 
702     public String getAuthor() {
703         return author;
704     }
705 
706     public void setAuthor(String author) {
707         this.author = author;
708     }
709 
710     public String getPreferredAddress() {
711         return preferredAddress;
712     }
713 
714     public void setPreferredAddress(String preferredAddress) {
715         this.preferredAddress = preferredAddress;
716     }
717 
718     public String getEmail() {
719         return email;
720     }
721 
722     public void setEmail(String email) {
723         this.email = email;
724     }
725 
726     public String getPhoneNumber() {
727         return phoneNumber;
728     }
729 
730     public void setPhoneNumber(String phoneNumber) {
731         this.phoneNumber = phoneNumber;
732     }
733 
734     public String getClaimsReturnNote() {
735         return claimsReturnNote;
736     }
737 
738     public void setClaimsReturnNote(String claimsReturnNote) {
739         this.claimsReturnNote = claimsReturnNote;
740     }
741 
742     public String getProxyPatronId() {
743         return proxyPatronId;
744     }
745 
746     public void setProxyPatronId(String proxyPatronId) {
747         this.proxyPatronId = proxyPatronId;
748     }
749 
750     public String getCirculationLocationId() {
751         return circulationLocationId;
752     }
753 
754     public void setCirculationLocationId(String circulationLocationId) {
755         this.circulationLocationId = circulationLocationId;
756     }
757 
758     public String getMachineId() {
759         return machineId;
760     }
761 
762     public void setMachineId(String machineId) {
763         this.machineId = machineId;
764     }
765 
766     public String getNumberOfRenewals() {
767         if (numberOfRenewals == null || "".equals(numberOfRenewals))
768             numberOfRenewals = "0";
769         return numberOfRenewals;
770     }
771 
772     public void setNumberOfRenewals(String numberOfRenewals) {
773         this.numberOfRenewals = numberOfRenewals;
774     }
775 
776     public String getNumberOfOverdueNoticesSent() {
777         return numberOfOverdueNoticesSent;
778     }
779 
780     public void setNumberOfOverdueNoticesSent(String numberOfOverdueNoticesSent) {
781         this.numberOfOverdueNoticesSent = numberOfOverdueNoticesSent;
782     }
783 
784     public String getOleRequestId() {
785         return oleRequestId;
786     }
787 
788     public void setOleRequestId(String oleRequestId) {
789         this.oleRequestId = oleRequestId;
790     }
791 
792     public String getRepaymentFeePatronBillId() {
793         return repaymentFeePatronBillId;
794     }
795 
796     public void setRepaymentFeePatronBillId(String repaymentFeePatronBillId) {
797         this.repaymentFeePatronBillId = repaymentFeePatronBillId;
798     }
799 
800     public boolean isClaimsReturnedIndicator() {
801         return claimsReturnedIndicator;
802     }
803 
804     public void setClaimsReturnedIndicator(boolean claimsReturnedIndicator) {
805         this.claimsReturnedIndicator = claimsReturnedIndicator;
806     }
807 
808     public Date getCreateDate() {
809         return createDate;
810     }
811 
812     public void setCreateDate(Date createDate) {
813         this.createDate = createDate;
814     }
815 
816     public Date getPastDueDate() {
817         return pastDueDate;
818     }
819 
820     public void setPastDueDate(Date pastDueDate) {
821         this.pastDueDate = pastDueDate;
822     }
823 
824     public Date getOverDueNoticeDate() {
825         return overDueNoticeDate;
826     }
827 
828     public void setOverDueNoticeDate(Date overDueNoticeDate) {
829         this.overDueNoticeDate = overDueNoticeDate;
830     }
831 
832     public String getCirculationPolicyId() {
833         return circulationPolicyId;
834     }
835 
836     public void setCirculationPolicyId(String circulationPolicyId) {
837         this.circulationPolicyId = circulationPolicyId;
838     }
839 
840     public String getNoOfOverdueNoticesSentForBorrower() {
841         return noOfOverdueNoticesSentForBorrower;
842     }
843 
844     public void setNoOfOverdueNoticesSentForBorrower(String noOfOverdueNoticesSentForBorrower) {
845         this.noOfOverdueNoticesSentForBorrower = noOfOverdueNoticesSentForBorrower;
846     }
847 
848     public boolean isCheckNo() {
849         return checkNo;
850     }
851 
852     public void setCheckNo(boolean checkNo) {
853         this.checkNo = checkNo;
854     }
855 
856     private List<OLEDeliverNotice> deliverNotices = new ArrayList<>();
857 
858     /**
859      * Gets the ItemCallNumber attribute.
860      *
861      * @return returns the String.
862      */
863     public String getItemCallNumber() {
864         return itemCallNumber;
865     }
866 
867     /**
868      * Sets the itemCallNumber attribute value.
869      *
870      * @param itemCallNumber
871      */
872     public void setItemCallNumber(String itemCallNumber) {
873         this.itemCallNumber = itemCallNumber;
874     }
875 
876     /**
877      * Gets the instanceUuid attribute.
878      *
879      * @return Returns the instanceUuid
880      */
881     public String getInstanceUuid() {
882         return instanceUuid;
883     }
884 
885     /**
886      * Sets the instanceUuid attribute value.
887      *
888      * @param instanceUuid The instanceUuid to set.
889      */
890     public void setInstanceUuid(String instanceUuid) {
891         this.instanceUuid = instanceUuid;
892     }
893 
894     /**
895      * Gets the oleInstanceItemType attribute.
896      *
897      * @return Returns the oleInstanceItemType
898      */
899     public OleInstanceItemType getOleInstanceItemType() {
900         return oleInstanceItemType;
901     }
902 
903     /**
904      * Sets the oleInstanceItemType attribute value.
905      *
906      * @param oleInstanceItemType The oleInstanceItemType to set.
907      */
908     public void setOleInstanceItemType(OleInstanceItemType oleInstanceItemType) {
909         this.oleInstanceItemType = oleInstanceItemType;
910     }
911 
912     /**
913      * Gets the dueDateEmpty attribute.
914      *
915      * @return Returns the dueDateEmpty
916      */
917     public boolean isDueDateEmpty() {
918         return dueDateEmpty;
919     }
920 
921     /**
922      * Sets the dueDateEmpty attribute value.
923      *
924      * @param dueDateEmpty The dueDateEmpty to set.
925      */
926     public void setDueDateEmpty(boolean dueDateEmpty) {
927         this.dueDateEmpty = dueDateEmpty;
928     }
929 
930     /**
931      * Gets the expirationDate attribute.
932      *
933      * @return Returns the expirationDate
934      */
935     public java.util.Date getExpirationDate() {
936         return expirationDate;
937     }
938 
939     /**
940      * Sets the expirationDate attribute value.
941      *
942      * @param expirationDate The expirationDate to set.
943      */
944     public void setExpirationDate(java.util.Date expirationDate) {
945         this.expirationDate = expirationDate;
946     }
947 
948     /**
949      * Gets the itemTypeName attribute.
950      *
951      * @return Returns the itemTypeName
952      */
953     public String getItemTypeName() {
954         return itemTypeName;
955     }
956 
957     /**
958      * Sets the itemTypeName attribute value.
959      *
960      * @param itemTypeName The itemTypeName to set.
961      */
962     public void setItemTypeName(String itemTypeName) {
963         this.itemTypeName = itemTypeName;
964     }
965 
966     /**
967      * Gets the patronBarcode attribute.
968      *
969      * @return Returns the patronBarcode
970      */
971     public String getPatronBarcode() {
972         return patronBarcode;
973     }
974 
975     /**
976      * Sets the patronBarcode attribute value.
977      *
978      * @param patronBarcode The patronBarcode to set.
979      */
980     public void setPatronBarcode(String patronBarcode) {
981         this.patronBarcode = patronBarcode;
982     }
983 
984     /**
985      * Gets the itemUuid attribute.
986      *
987      * @return Returns the itemUuid
988      */
989     public String getItemUuid() {
990         return itemUuid;
991     }
992 
993     /**
994      * Sets the itemUuid attribute value.
995      *
996      * @param itemUuid The itemUuid to set.
997      */
998     public void setItemUuid(String itemUuid) {
999         this.itemUuid = itemUuid;
1000     }
1001 
1002     /**
1003      * Gets the patronName attribute.
1004      *
1005      * @return Returns the patronName
1006      */
1007     public String getPatronName() {
1008         return patronName;
1009     }
1010 
1011     /**
1012      * Sets the patronName attribute value.
1013      *
1014      * @param patronName The patronName to set.
1015      */
1016     public void setPatronName(String patronName) {
1017         this.patronName = patronName;
1018     }
1019 
1020     /**
1021      * Gets the isValidPatron attribute.
1022      *
1023      * @return Returns the isValidPatron
1024      */
1025     public boolean isValidPatron() {
1026         return isValidPatron;
1027     }
1028 
1029     /**
1030      * Sets the isValidPatron attribute value.
1031      *
1032      * @param validPatron The isValidPatron to set.
1033      */
1034     public void setValidPatron(boolean validPatron) {
1035         isValidPatron = validPatron;
1036     }
1037 
1038     /**
1039      * Gets the borrowerTypeName attribute.
1040      *
1041      * @return Returns the borrowerTypeName
1042      */
1043     public String getBorrowerTypeName() {
1044         return borrowerTypeName;
1045     }
1046 
1047     /**
1048      * Sets the borrowerTypeName attribute value.
1049      *
1050      * @param borrowerTypeName The borrowerTypeName to set.
1051      */
1052     public void setBorrowerTypeName(String borrowerTypeName) {
1053         this.borrowerTypeName = borrowerTypeName;
1054     }
1055 
1056     /**
1057      * Gets the errorMessage attribute.
1058      *
1059      * @return Returns the errorMessage
1060      */
1061     public String getErrorMessage() {
1062         if (null == errorMessage) {
1063             return "";
1064         }
1065         return errorMessage;
1066     }
1067 
1068     /**
1069      * Sets the errorMessage attribute value.
1070      *
1071      * @param errorMessage The errorMessage to set.
1072      */
1073     public void setErrorMessage(String errorMessage) {
1074         if (null != errorMessage) {
1075             StringBuilder stringBuilder = new StringBuilder();
1076             if (null != this.errorMessage && !org.apache.commons.lang.StringUtils.isBlank(this.errorMessage)) {
1077                 stringBuilder.append(this
1078                         .errorMessage).append
1079                         (OLEConstants.BREAK);
1080             }
1081             stringBuilder.append(errorMessage);
1082             this.errorMessage = stringBuilder.toString();
1083         }else{
1084             this.errorMessage = errorMessage;
1085         }
1086     }
1087 
1088     /**
1089      * Gets the oleLocation attribute.
1090      *
1091      * @return Returns the oleLocation
1092      */
1093     public OleLocation getOleLocation() {
1094         return oleLocation;
1095     }
1096 
1097     /**
1098      * Sets the oleLocation attribute value.
1099      *
1100      * @param oleLocation The oleLocation to set.
1101      */
1102     public void setOleLocation(OleLocation oleLocation) {
1103         this.oleLocation = oleLocation;
1104     }
1105 
1106     /**
1107      * Gets the title attribute.
1108      *
1109      * @return Returns the title
1110      */
1111     public String getTitle() {
1112         return title;
1113     }
1114 
1115     /**
1116      * Sets the title attribute value.
1117      *
1118      * @param title The title to set.
1119      */
1120     public void setTitle(String title) {
1121         this.title = title;
1122     }
1123 
1124     /**
1125      * Gets the entity attribute.
1126      *
1127      * @return Returns the entity
1128      */
1129     public EntityBo getEntity() {
1130         if(getPatronId()!=null){
1131             EntityBo entityBo = (EntityBo) KRADServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(EntityBo.class, getPatronId());
1132             return entityBo;
1133         }else{
1134             return entity;
1135         }
1136     }
1137 
1138     /**
1139      * Sets the entity attribute value.
1140      *
1141      * @param entity The entity to set.
1142      */
1143     public void setEntity(EntityBo entity) {
1144         this.entity = entity;
1145     }
1146 
1147     /**
1148      * Gets the oleBorrowerType attribute.
1149      *
1150      * @return Returns the oleBorrowerType
1151      */
1152     public OleBorrowerType getOleBorrowerType() {
1153         return oleBorrowerType;
1154     }
1155 
1156     /**
1157      * Sets the oleBorrowerType attribute value.
1158      *
1159      * @param oleBorrowerType The oleBorrowerType to set.
1160      */
1161     public void setOleBorrowerType(OleBorrowerType oleBorrowerType) {
1162         this.oleBorrowerType = oleBorrowerType;
1163     }
1164 
1165     /**
1166      * Gets the olePatron attribute.
1167      *
1168      * @return Returns the olePatron
1169      */
1170     public OlePatronDocument getOlePatron() {
1171         if (null == olePatron) {
1172             String patronId = getPatronId();
1173             if (StringUtils.isNotEmpty(patronId)) {
1174                 Map<String, String> parameterMap = new HashMap<>();
1175                 parameterMap.put("olePatronId", patronId);
1176                 olePatron = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OlePatronDocument.class, parameterMap);
1177             }
1178         }
1179         return olePatron;
1180     }
1181 
1182     /**
1183      * Sets the olePatron attribute value.
1184      *
1185      * @param olePatron The olePatron to set.
1186      */
1187     public void setOlePatron(OlePatronDocument olePatron) {
1188         this.olePatron = olePatron;
1189     }
1190 
1191     /**
1192      * Gets the oleLoanStatus attribute.
1193      *
1194      * @return Returns the oleLoanStatus
1195      */
1196     public OleLoanStatus getOleLoanStatus() {
1197         return oleLoanStatus;
1198     }
1199 
1200     /**
1201      * Sets the oleLoanStatus attribute value.
1202      *
1203      * @param oleLoanStatus The oleLoanStatus to set.
1204      */
1205     public void setOleLoanStatus(OleLoanStatus oleLoanStatus) {
1206         this.oleLoanStatus = oleLoanStatus;
1207     }
1208 
1209     /**
1210      * Gets the oleLoanTermUnit attribute.
1211      *
1212      * @return Returns the oleLoanTermUnit
1213      */
1214     public OleLoanTermUnit getOleLoanTermUnit() {
1215         return oleLoanTermUnit;
1216     }
1217 
1218     /**
1219      * Sets the oleLoanTermUnit attribute value.
1220      *
1221      * @param oleLoanTermUnit The oleLoanTermUnit to set.
1222      */
1223     public void setOleLoanTermUnit(OleLoanTermUnit oleLoanTermUnit) {
1224         this.oleLoanTermUnit = oleLoanTermUnit;
1225     }
1226 
1227     /**
1228      * Gets the loanId attribute.
1229      *
1230      * @return Returns the loanId
1231      */
1232     public String getLoanId() {
1233         return loanId;
1234     }
1235 
1236     /**
1237      * Sets the loanId attribute value.
1238      *
1239      * @param loanId The loanId to set.
1240      */
1241     public void setLoanId(String loanId) {
1242         this.loanId = loanId;
1243     }
1244 
1245     /**
1246      * Gets the loanStatusId attribute.
1247      *
1248      * @return Returns the loanStatusId
1249      */
1250     public String getLoanStatusId() {
1251         return loanStatusId;
1252     }
1253 
1254     /**
1255      * Sets the loanStatusId attribute value.
1256      *
1257      * @param loanStatusId The loanStatusId to set.
1258      */
1259     public void setLoanStatusId(String loanStatusId) {
1260         this.loanStatusId = loanStatusId;
1261     }
1262 
1263     /**
1264      * Gets the patronId attribute.
1265      *
1266      * @return Returns the patronId
1267      */
1268     public String getPatronId() {
1269         return patronId;
1270     }
1271 
1272     /**
1273      * Sets the patronId attribute value.
1274      *
1275      * @param patronId The patronId to set.
1276      */
1277     public void setPatronId(String patronId) {
1278         this.patronId = patronId;
1279     }
1280 
1281     /**
1282      * Gets the itemId attribute.
1283      *
1284      * @return Returns the itemId
1285      */
1286     public String getItemId() {
1287         return itemId;
1288     }
1289 
1290     /**
1291      * Sets the itemId attribute value.
1292      *
1293      * @param itemId The itemId to set.
1294      */
1295     public void setItemId(String itemId) {
1296         this.itemId = itemId;
1297     }
1298 
1299     /**
1300      * Gets the loanPeriodDate attribute.
1301      *
1302      * @return Returns the loanPeriodDate
1303      */
1304     public Date getLoanPeriodDate() {
1305         return loanPeriodDate;
1306     }
1307 
1308     /**
1309      * Sets the loanPeriodDate attribute value.
1310      *
1311      * @param loanPeriodDate The loanPeriodDate to set.
1312      */
1313     public void setLoanPeriodDate(Date loanPeriodDate) {
1314         this.loanPeriodDate = loanPeriodDate;
1315     }
1316 
1317     /**
1318      * Gets the loanPeriod attribute.
1319      *
1320      * @return Returns the loanPeriod
1321      */
1322     public Integer getLoanPeriod() {
1323         return loanPeriod;
1324     }
1325 
1326     /**
1327      * Sets the loanPeriod attribute value.
1328      *
1329      * @param loanPeriod The loanPeriod to set.
1330      */
1331     public void setLoanPeriod(Integer loanPeriod) {
1332         this.loanPeriod = loanPeriod;
1333     }
1334 
1335     /**
1336      * Gets the loanTermUnitId attribute.
1337      *
1338      * @return Returns the loanTermUnitId
1339      */
1340     public String getLoanTermUnitId() {
1341         return loanTermUnitId;
1342     }
1343 
1344     /**
1345      * Sets the loanTermUnitId attribute value.
1346      *
1347      * @param loanTermUnitId The loanTermUnitId to set.
1348      */
1349     public void setLoanTermUnitId(String loanTermUnitId) {
1350         this.loanTermUnitId = loanTermUnitId;
1351     }
1352 
1353     /**
1354      * Gets the loanDueDate attribute.
1355      *
1356      * @return Returns the loanDueDate
1357      */
1358     public Timestamp getLoanDueDate() {
1359         return loanDueDate;
1360     }
1361 
1362     /**
1363      * Sets the loanDueDate attribute value.
1364      *
1365      * @param loanDueDate The loanDueDate to set.
1366      */
1367     public void setLoanDueDate(Timestamp loanDueDate) {
1368         this.loanDueDate = loanDueDate;
1369     }
1370 
1371     /**
1372      * Gets the loanOperatorId attribute.
1373      *
1374      * @return Returns the loanOperatorId
1375      */
1376     public String getLoanOperatorId() {
1377         return loanOperatorId;
1378     }
1379 
1380     /**
1381      * Sets the loanOperatorId attribute value.
1382      *
1383      * @param loanOperatorId The loanOperatorId to set.
1384      */
1385     public void setLoanOperatorId(String loanOperatorId) {
1386         this.loanOperatorId = loanOperatorId;
1387     }
1388 
1389     /**
1390      * Gets the loanApproverId attribute.
1391      *
1392      * @return Returns the loanApproverId
1393      */
1394     public String getLoanApproverId() {
1395         return loanApproverId;
1396     }
1397 
1398     /**
1399      * Sets the loanApproverId attribute value.
1400      *
1401      * @param loanApproverId The loanApproverId to set.
1402      */
1403     public void setLoanApproverId(String loanApproverId) {
1404         this.loanApproverId = loanApproverId;
1405     }
1406 
1407     /**
1408      * Gets the borrowerTypeId attribute.
1409      *
1410      * @return Returns the borrowerTypeId
1411      */
1412     public String getBorrowerTypeId() {
1413         return borrowerTypeId;
1414     }
1415 
1416     /**
1417      * Sets the borrowerTypeId attribute value.
1418      *
1419      * @param borrowerTypeId The borrowerTypeId to set.
1420      */
1421     public void setBorrowerTypeId(String borrowerTypeId) {
1422         this.borrowerTypeId = borrowerTypeId;
1423     }
1424 
1425     /**
1426      * Gets the itemInstitution attribute.
1427      *
1428      * @return Returns the itemInstitution
1429      */
1430     public String getItemInstitution() {
1431         return itemInstitution;
1432     }
1433 
1434     /**
1435      * Sets the itemInstitution attribute value.
1436      *
1437      * @param itemInstitution The itemInstitution to set.
1438      */
1439     public void setItemInstitution(String itemInstitution) {
1440         this.itemInstitution = itemInstitution;
1441     }
1442 
1443     /**
1444      * Gets the itemCampus attribute.
1445      *
1446      * @return Returns the itemCampus
1447      */
1448     public String getItemCampus() {
1449         return itemCampus;
1450     }
1451 
1452     /**
1453      * Sets the itemCampus attribute value.
1454      *
1455      * @param itemCampus The itemCampus to set.
1456      */
1457     public void setItemCampus(String itemCampus) {
1458         this.itemCampus = itemCampus;
1459     }
1460 
1461     /**
1462      * Gets the itemLibrary attribute.
1463      *
1464      * @return Returns the itemLibrary
1465      */
1466     public String getItemLibrary() {
1467         return itemLibrary;
1468     }
1469 
1470     /**
1471      * Sets the itemLibrary attribute value.
1472      *
1473      * @param itemLibrary The itemLibrary to set.
1474      */
1475     public void setItemLibrary(String itemLibrary) {
1476         this.itemLibrary = itemLibrary;
1477     }
1478 
1479     /**
1480      * Gets the itemCollection attribute.
1481      *
1482      * @return Returns the itemCollection
1483      */
1484     public String getItemCollection() {
1485         return itemCollection;
1486     }
1487 
1488     /**
1489      * Sets the itemCollection attribute value.
1490      *
1491      * @param itemCollection The itemCollection to set.
1492      */
1493     public void setItemCollection(String itemCollection) {
1494         this.itemCollection = itemCollection;
1495     }
1496 
1497     /**
1498      * Gets the itemLocation attribute.
1499      *
1500      * @return Returns the itemLocation
1501      */
1502     public String getItemLocation() {
1503         return itemLocation;
1504     }
1505 
1506     /**
1507      * Sets the itemLocation attribute value.
1508      *
1509      * @param itemLocation The itemLocation to set.
1510      */
1511     public void setItemLocation(String itemLocation) {
1512         this.itemLocation = itemLocation;
1513     }
1514 
1515     /**
1516      * Gets the itemType attribute.
1517      *
1518      * @return Returns the itemType
1519      */
1520     public String getItemType() {
1521         return itemType;
1522     }
1523 
1524     /**
1525      * Sets the itemType attribute value.
1526      *
1527      * @param itemType The itemType to set.
1528      */
1529     public void setItemType(String itemType) {
1530         this.itemType = itemType;
1531     }
1532 
1533 
1534     /**
1535      * Gets the itemLoanStatus attribute.
1536      *
1537      * @return Returns the itemLoanStatus
1538      */
1539     public String getItemLoanStatus() {
1540         return itemLoanStatus;
1541     }
1542 
1543     /**
1544      * Sets the itemLoanStatus attribute value.
1545      *
1546      * @param itemLoanStatus The itemLoanStatus to set.
1547      */
1548     public void setItemLoanStatus(String itemLoanStatus) {
1549         this.itemLoanStatus = itemLoanStatus;
1550     }
1551 
1552     /**
1553      * Gets the oleItem attribute.
1554      *
1555      * @return Returns the oleItem
1556      */
1557     public Item getOleItem() {
1558         return oleItem;
1559     }
1560 
1561     /**
1562      * Sets the oleItem attribute value.
1563      *
1564      * @param oleItem The oleItem to set.
1565      */
1566     public void setOleItem(Item oleItem) {
1567         this.oleItem = oleItem;
1568     }
1569 
1570     /**
1571      * Gets the itemVolumeNumber attribute.
1572      *
1573      * @return Returns the itemVolumeNumber
1574      */
1575     public String getItemVolumeNumber() {
1576         return itemVolumeNumber;
1577     }
1578 
1579     /**
1580      * Sets the itemVolumeNumber attribute value.
1581      *
1582      * @param itemVolumeNumber The oleItem to set.
1583      */
1584     public void setItemVolumeNumber(String itemVolumeNumber) {
1585         this.itemVolumeNumber = itemVolumeNumber;
1586     }
1587 
1588     /**
1589      * Gets the claims return date attribute value.
1590      *
1591      * @return Returns the claims return date
1592      */
1593     public Timestamp getClaimsReturnedDate() {
1594         return claimsReturnedDate;
1595     }
1596 
1597     /**
1598      * Sets the claims return date attribute value.
1599      *
1600      * @param claimsReturnedDate
1601      */
1602     public void setClaimsReturnedDate(Timestamp claimsReturnedDate) {
1603         this.claimsReturnedDate = claimsReturnedDate;
1604     }
1605 
1606     /**
1607      * Gets the loanDueDateTimeToAlter attribute value.
1608      *
1609      * @return Returns the loanDueDateTimeToAlter
1610      */
1611     public String getLoanDueDateTimeToAlter() {
1612         return loanDueDateTimeToAlter;
1613     }
1614 
1615     /**
1616      * Sets the loanDueDateTimeToAlter attribute value.
1617      *
1618      * @param loanDueDateTimeToAlter
1619      */
1620     public void setLoanDueDateTimeToAlter(String loanDueDateTimeToAlter) {
1621         this.loanDueDateTimeToAlter = loanDueDateTimeToAlter;
1622     }
1623 
1624     public boolean isBackGroundCheckOut() {
1625         return isBackGroundCheckOut;
1626     }
1627 
1628     public void setBackGroundCheckOut(boolean backGroundCheckOut) {
1629         isBackGroundCheckOut = backGroundCheckOut;
1630     }
1631 
1632     public String getOverrideErrorMessage() {
1633         return overrideErrorMessage;
1634     }
1635 
1636     public void setOverrideErrorMessage(String overrideErrorMessage) {
1637         this.overrideErrorMessage = overrideErrorMessage;
1638     }
1639 
1640     public HashMap<String, String> getErrorsAndPermission() {
1641         return errorsAndPermission;
1642     }
1643 
1644     public void setErrorsAndPermission(HashMap<String, String> errorsAndPermission) {
1645         this.errorsAndPermission = errorsAndPermission;
1646     }
1647 
1648     public boolean isRenewPermission() {
1649         return renewPermission;
1650     }
1651 
1652     public void setRenewPermission(boolean renewPermission) {
1653         this.renewPermission = renewPermission;
1654     }
1655 
1656     public boolean isReplacementFeeExist() {
1657         return replacementFeeExist;
1658     }
1659 
1660     public void setReplacementFeeExist(boolean replacementFeeExist) {
1661         this.replacementFeeExist = replacementFeeExist;
1662     }
1663 
1664     public boolean isOverdueFineExist() {
1665         return overdueFineExist;
1666     }
1667 
1668     public void setOverdueFineExist(boolean overdueFineExist) {
1669         this.overdueFineExist = overdueFineExist;
1670     }
1671 
1672     public boolean isDifferentPatron() {
1673         return differentPatron;
1674     }
1675 
1676     public void setDifferentPatron(boolean differentPatron) {
1677         this.differentPatron = differentPatron;
1678     }
1679 
1680     public boolean isItemDamagedStatus() {
1681         return itemDamagedStatus;
1682     }
1683 
1684     public void setItemDamagedStatus(boolean itemDamagedStatus) {
1685         this.itemDamagedStatus = itemDamagedStatus;
1686     }
1687 
1688     public boolean isSkipDamagedCheckIn() {
1689         return skipDamagedCheckIn;
1690     }
1691 
1692     public void setSkipDamagedCheckIn(boolean skipDamagedCheckIn) {
1693         this.skipDamagedCheckIn = skipDamagedCheckIn;
1694     }
1695 
1696     public String getMissingPiecesCount() {
1697         return missingPiecesCount;
1698     }
1699 
1700     public void setMissingPiecesCount(String missingPiecesCount) {
1701         this.missingPiecesCount = missingPiecesCount;
1702     }
1703 
1704     public boolean isMissingPieceFlag() {
1705         return missingPieceFlag;
1706     }
1707 
1708     public void setMissingPieceFlag(boolean missingPieceFlag) {
1709         this.missingPieceFlag = missingPieceFlag;
1710     }
1711 
1712     public boolean isBackgroundCheckInMissingPiece() {
1713         return backgroundCheckInMissingPiece;
1714     }
1715 
1716     public void setBackgroundCheckInMissingPiece(boolean backgroundCheckInMissingPiece) {
1717         this.backgroundCheckInMissingPiece = backgroundCheckInMissingPiece;
1718     }
1719 
1720     public boolean isLostPatron() {
1721         return lostPatron;
1722     }
1723 
1724     public void setLostPatron(boolean lostPatron) {
1725         this.lostPatron = lostPatron;
1726     }
1727 
1728     public String getItemDamagedNote() {
1729         return itemDamagedNote;
1730     }
1731 
1732     public void setItemDamagedNote(String itemDamagedNote) {
1733         this.itemDamagedNote = itemDamagedNote;
1734     }
1735 
1736     public String getMissingPieceNote() {
1737         return missingPieceNote;
1738     }
1739 
1740     public void setMissingPieceNote(String missingPieceNote) {
1741         this.missingPieceNote = missingPieceNote;
1742     }
1743 
1744     public boolean isNoOfPiecesEditable() {
1745         return noOfPiecesEditable;
1746     }
1747 
1748     public void setNoOfPiecesEditable(boolean noOfPiecesEditable) {
1749         this.noOfPiecesEditable = noOfPiecesEditable;
1750     }
1751 
1752     public boolean isNoOfMissingPiecesEditable() {
1753         return noOfMissingPiecesEditable;
1754     }
1755 
1756     public void setNoOfMissingPiecesEditable(boolean noOfMissingPiecesEditable) {
1757         this.noOfMissingPiecesEditable = noOfMissingPiecesEditable;
1758     }
1759 
1760     public String getBackUpNoOfPieces() {
1761         return backUpNoOfPieces;
1762     }
1763 
1764     public void setBackUpNoOfPieces(String backUpNoOfPieces) {
1765         this.backUpNoOfPieces = backUpNoOfPieces;
1766     }
1767 
1768     public String getSuccessMessage() {
1769         return successMessage;
1770     }
1771 
1772     public void setSuccessMessage(String successMessage) {
1773         this.successMessage = successMessage;
1774     }
1775 
1776     public boolean isRenewPermissionForRequestedItem() {
1777         return renewPermissionForRequestedItem;
1778     }
1779 
1780     public void setRenewPermissionForRequestedItem(boolean renewPermissionForRequestedItem) {
1781         this.renewPermissionForRequestedItem = renewPermissionForRequestedItem;
1782     }
1783 
1784     public boolean isLoanModified() {
1785         return loanModified;
1786     }
1787 
1788     public void setLoanModified(boolean loanModified) {
1789         this.loanModified = loanModified;
1790     }
1791 
1792     public String getItemFullLocation() {
1793         return itemFullLocation;
1794     }
1795 
1796     public void setItemFullLocation(String itemFullLocation) {
1797         this.itemFullLocation = itemFullLocation;
1798     }
1799 
1800     @Override
1801     public int compareTo(OleLoanDocument oleLoanDocument) {
1802         if(this.itemId!=null && itemId.equals(oleLoanDocument.getItemId())){
1803             return 0;
1804         }
1805         return -1;
1806     }
1807 
1808     @Override
1809     public boolean equals(Object obj) {
1810         if(obj==null){
1811            return super.equals(obj);
1812         } else {
1813              if(obj  instanceof OleLoanDocument){
1814                  OleLoanDocument oleLoanDocument=(OleLoanDocument)obj;
1815                  if(this.itemId!=null && itemId.equals(oleLoanDocument.getItemId())){
1816                      return true;
1817                  } else {
1818                      return super.equals(obj);
1819                  }
1820              } else {
1821                  return super.equals(obj);
1822              }
1823 
1824         }
1825     }
1826 
1827     public String getItemStatusEffectiveDate() {
1828         return itemStatusEffectiveDate;
1829     }
1830 
1831     public void setItemStatusEffectiveDate(String itemStatusEffectiveDate) {
1832         this.itemStatusEffectiveDate = itemStatusEffectiveDate;
1833     }
1834 
1835     public List<OLEDeliverNotice> getDeliverNotices() {
1836         return deliverNotices;
1837     }
1838 
1839     public void setDeliverNotices(List<OLEDeliverNotice> deliverNotices) {
1840         this.deliverNotices = deliverNotices;
1841     }
1842 
1843     public String getNoticeType() {
1844         return noticeType;
1845     }
1846 
1847     public void setNoticeType(String noticeType) {
1848         this.noticeType = noticeType;
1849     }
1850 
1851 
1852     public String getNoticeSendType() {
1853         return noticeSendType;
1854     }
1855 
1856     public void setNoticeSendType(String noticeSendType) {
1857         this.noticeSendType = noticeSendType;
1858     }
1859 
1860     public OLEDeliverNotice getOleDeliverNotice() {
1861         return oleDeliverNotice;
1862     }
1863 
1864     public void setOleDeliverNotice(OLEDeliverNotice oleDeliverNotice) {
1865         this.oleDeliverNotice = oleDeliverNotice;
1866     }
1867 
1868     public String getOleLocationCode() {
1869         return oleLocationCode;
1870     }
1871 
1872     public void setOleLocationCode(String oleLocationCode) {
1873         this.oleLocationCode = oleLocationCode;
1874     }
1875 
1876     public boolean isInvalidBarcodeFlag() {
1877         return invalidBarcodeFlag;
1878     }
1879 
1880     public void setInvalidBarcodeFlag(boolean invalidBarcodeFlag) {
1881         this.invalidBarcodeFlag = invalidBarcodeFlag;
1882     }
1883 
1884     public boolean isFastAddItemIndicator() {
1885         return fastAddItemIndicator;
1886     }
1887 
1888     public void setFastAddItemIndicator(boolean fastAddItemIndicator) {
1889         this.fastAddItemIndicator = fastAddItemIndicator;
1890     }
1891 
1892     public String getHoldingsLocation() {
1893         return holdingsLocation;
1894     }
1895 
1896     public void setHoldingsLocation(String holdingsLocation) {
1897         this.holdingsLocation = holdingsLocation;
1898     }
1899 
1900     public boolean isItemLevelLocationExist() {
1901         return itemLevelLocationExist;
1902     }
1903 
1904     public void setItemLevelLocationExist(boolean itemLevelLocationExist) {
1905         this.itemLevelLocationExist = itemLevelLocationExist;
1906     }
1907     public void loanPeriod(String defaultLoanPeriod, String recallLoanPeriod) {
1908         LoanPeriodUtil loanPeriodUtil = getLoanPeriodUtil();
1909         if(null == oleCirculationDesk){
1910             OleCirculationDesk oleCirculationDesk = getCirculationLocationId() != null ? new CircDeskLocationResolver().getOleCirculationDesk(getCirculationLocationId()) : null;
1911             setOleCirculationDesk(oleCirculationDesk);
1912         }
1913         if (isRequestPatron()) {
1914             if (null == defaultLoanPeriod) {
1915                 setLoanDueDate(null);
1916             }
1917             setLoanDueDate(loanPeriodUtil.calculateDueDate(recallLoanPeriod, getCirculationPolicyId(), oleCirculationDesk
1918                     .getCalendarGroupId()));
1919         } else {
1920             setLoanDueDate(loanPeriodUtil.calculateDueDate(defaultLoanPeriod, getCirculationPolicyId(),
1921                     oleCirculationDesk
1922                             .getCalendarGroupId()));
1923 
1924         }
1925     }
1926 
1927     protected LoanPeriodUtil getLoanPeriodUtil() {
1928         return new LoanPeriodUtil();
1929     }
1930 
1931     public Integer getOverdueFineAmount(OleCirculationPolicyServiceImpl oleCirculationPolicyService) {
1932         Integer overdueFineAmt = 0;
1933         if (null != oleDeliverRequestBo) {
1934             List<FeeType> feeTypeList = oleCirculationPolicyService.getPatronBillPayment(oleDeliverRequestBo.getBorrowerId());
1935             for (FeeType feeType : feeTypeList) {
1936                 Integer fineAmount = feeType.getFeeAmount().subtract(feeType.getPaidAmount()).intValue();
1937                 overdueFineAmt += feeType.getOleFeeType().getFeeTypeName().equalsIgnoreCase(OLEConstants.OVERDUE_FINE) ? fineAmount : 0;
1938             }
1939         }
1940         return overdueFineAmt;
1941     }
1942 
1943     public Integer getReplacementFineAmount(OleCirculationPolicyServiceImpl oleCirculationPolicyService) {
1944         Integer replacementFeeAmt = 0;
1945         if (null != oleDeliverRequestBo) {
1946             List<FeeType> feeTypeList = oleCirculationPolicyService.getPatronBillPayment(oleDeliverRequestBo.getBorrowerId());
1947             for (FeeType feeType : feeTypeList) {
1948                 Integer fineAmount = feeType.getFeeAmount().subtract(feeType.getPaidAmount()).intValue();
1949                 replacementFeeAmt += feeType.getOleFeeType().getFeeTypeName().equalsIgnoreCase(OLEConstants.REPLACEMENT_FEE) ? fineAmount : 0;
1950             }
1951         }
1952         return replacementFeeAmt;
1953     }
1954 
1955     public Integer getServiceFeeAmount(OleCirculationPolicyServiceImpl oleCirculationPolicyService) {
1956         Integer serviceFeeAmt = 0;
1957         if (null != oleDeliverRequestBo) {
1958             List<FeeType> feeTypeList = oleCirculationPolicyService.getPatronBillPayment(oleDeliverRequestBo.getBorrowerId());
1959             for (FeeType feeType : feeTypeList) {
1960                 Integer fineAmount = feeType.getFeeAmount().subtract(feeType.getPaidAmount()).intValue();
1961                 serviceFeeAmt += feeType.getOleFeeType().getFeeTypeName().equalsIgnoreCase(OLEConstants.SERVICE_FEE) ? fineAmount : 0;
1962             }
1963         }
1964         return serviceFeeAmt;
1965     }
1966 
1967     public Integer getAllCharges(OleCirculationPolicyServiceImpl oleCirculationPolicyService) {
1968         Integer allCharges = 0;
1969 
1970         allCharges = getOverdueFineAmount(oleCirculationPolicyService) + getReplacementFineAmount
1971                 (oleCirculationPolicyService);
1972 
1973         return allCharges;
1974     }
1975 
1976     public void addErrorsAndPermission(String errorsAndPermissions) {
1977         getErrorsAndPermission().put("permissionName", errorsAndPermissions);
1978     }
1979 
1980     public Boolean isCheckinLocationSameAsHomeLocation() {
1981         String itemFullPathLocation = getItemFullPathLocation();
1982 
1983         String operatorCircLocations = getOperatorsCirculationLocation();
1984 
1985         if (null != itemFullPathLocation && null != operatorCircLocations) {
1986             StringTokenizer strTokenizer = new StringTokenizer(operatorCircLocations, "#");
1987             while (strTokenizer.hasMoreTokens()) {
1988                 String nextToken = strTokenizer.nextToken();
1989                 if (nextToken.equals(itemFullPathLocation)) {
1990                     return true;
1991                 }
1992             }
1993         }
1994 
1995         return false;
1996 
1997     }
1998 
1999     public boolean isPastAndRenewDueDateSame() throws Exception {
2000         Timestamp pastLoanDueDate = getLoanDueDate();
2001         Date newLoanDueDate = getPastDueDate();
2002         if (pastLoanDueDate != null) {
2003             return (new Date(pastLoanDueDate.getTime()).compareTo(newLoanDueDate) == 0 ? true : false);
2004         } else {
2005             throw new Exception("No Fixed Due Date found for the renewal policy");
2006         }
2007     }
2008 
2009     public boolean IsIndefiniteDueDate() {
2010         return getLoanDueDate() == null ? true : false;
2011     }
2012 
2013 
2014 
2015     public Boolean isItemPickupLocationSameAsOperatorCircLoc() {
2016         OleCirculationDesk olePickUpLocation = null == getOleDeliverRequestBo() ? null : getOleDeliverRequestBo().getOlePickUpLocation();
2017         String operatorCircLocations = getOperatorsCirculationLocation();
2018 
2019         if (null != olePickUpLocation && null != operatorCircLocations) {
2020             StringTokenizer strTokenizer = new StringTokenizer(operatorCircLocations, "#");
2021             while (strTokenizer.hasMoreTokens()) {
2022                 String nextToken = strTokenizer.nextToken();
2023                 if (nextToken.equals(olePickUpLocation)) {
2024                     return true;
2025                 }
2026             }
2027         }
2028 
2029         return false;
2030     }
2031 
2032     public String getRealPatronWithLoan() {
2033         StringBuilder message = new StringBuilder();
2034         if (getItemLoanStatus().equalsIgnoreCase(OLEConstants.ITEM_STATUS_CHECKEDOUT) && !isRenewalItemFlag()) {
2035             Map barMap = new HashMap();
2036             barMap.put("itemId", getItemId());
2037             List<OleLoanDocument> oleLoanDocuments = (List<OleLoanDocument>) KRADServiceLocator.getBusinessObjectService()
2038                     .findMatching(OleLoanDocument.class, barMap);
2039             if (oleLoanDocuments != null && oleLoanDocuments.size() > 0) {
2040                 String url = "<a target=\"_blank\" href=" + OLEConstants.ASSIGN_INQUIRY_PATRON_ID + oleLoanDocuments.get(0).getPatronId() + OLEConstants.ASSIGN_PATRON_INQUIRY + ">" + oleLoanDocuments.get(0).getPatronId() + "</a>";
2041                 message.append(OLEConstants.ITEM_STATUS_LOANED_ANOTHER_PATRON_PERMISSION + "&nbsp;&nbsp;:&nbsp;" + url + OLEConstants.BREAK);
2042             }
2043         }
2044         return message.toString();
2045     }
2046 
2047     private Timestamp calculateLoanDueDate(String loanPeriod) {
2048         Calendar calendar = Calendar.getInstance();
2049         String loanPeriodType[]=null;
2050         Timestamp dueDate = null;
2051         if(loanPeriod != null && loanPeriod.trim().length()>0){
2052             loanPeriodType =  loanPeriod.split("-");
2053             int loanPeriodValue =  Integer.parseInt(loanPeriodType[0].toString());
2054             String loanPeriodTypeValue =  loanPeriodType[1].toString();
2055             if(loanPeriodTypeValue.equalsIgnoreCase("M")){
2056                 calendar.add(Calendar.MINUTE, loanPeriodValue);
2057             } else if(loanPeriodTypeValue.equalsIgnoreCase("H")) {
2058                 calendar.add(Calendar.HOUR, loanPeriodValue);
2059             } else if(loanPeriodTypeValue.equalsIgnoreCase("W")) {
2060                 calendar.add(Calendar.WEEK_OF_MONTH, loanPeriodValue);
2061             } else {
2062                 calendar.add(Calendar.DATE, loanPeriodValue);
2063             }
2064             dueDate =  new Timestamp(calendar.getTime().getTime());
2065         }
2066         return dueDate;
2067     }
2068 
2069     public boolean isDamagedItemIndicator() {
2070         return damagedItemIndicator;
2071     }
2072 
2073     public void setDamagedItemIndicator(boolean damagedItemIndicator) {
2074         this.damagedItemIndicator = damagedItemIndicator;
2075     }
2076 
2077     public Timestamp getDamagedItemDate() {
2078         return damagedItemDate;
2079     }
2080 
2081     public void setDamagedItemDate(Timestamp damagedItemDate) {
2082         this.damagedItemDate = damagedItemDate;
2083     }
2084 
2085     public String getNoOfMissingPiece() {
2086         return noOfMissingPiece;
2087     }
2088 
2089     public void setNoOfMissingPiece(String noOfMissingPiece) {
2090         this.noOfMissingPiece = noOfMissingPiece;
2091     }
2092 
2093     public Timestamp getMissingPieceItemDate() {
2094         return missingPieceItemDate;
2095     }
2096 
2097     public void setMissingPieceItemDate(Timestamp missingPieceItemDate) {
2098         this.missingPieceItemDate = missingPieceItemDate;
2099     }
2100 
2101     @Override
2102     public int hashCode() {
2103         return itemId != null ? itemId.hashCode() : 0;
2104     }
2105 
2106     @Override
2107     public List<Collection<PersistableBusinessObject>> buildListOfDeletionAwareLists() {
2108         List managedLists = super.buildListOfDeletionAwareLists();
2109         managedLists.add(getDeliverNotices());
2110         return managedLists;
2111     }
2112 }
2113