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