From 87b57d992b3656bd2bfa1b79d5c7940a55527c4d Mon Sep 17 00:00:00 2001 From: NSSuresh11 Date: Mon, 12 Jul 2021 18:32:40 +0530 Subject: [PATCH] OLE-9452 : Add Patron Barcode to Hold Slip --- .../org/kuali/ole/deliver/printSlip/OlePrintSlip.java | 8 ++++++++ .../util/printSlip/OnHoldRecieptPrintSlipUtil.java | 4 +++- .../util/printSlip/OnHoldRegularPrintSlipUtil.java | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ole-app/olefs/src/main/java/org/kuali/ole/deliver/printSlip/OlePrintSlip.java b/ole-app/olefs/src/main/java/org/kuali/ole/deliver/printSlip/OlePrintSlip.java index 57e7ff7878..f53e155d3c 100644 --- a/ole-app/olefs/src/main/java/org/kuali/ole/deliver/printSlip/OlePrintSlip.java +++ b/ole-app/olefs/src/main/java/org/kuali/ole/deliver/printSlip/OlePrintSlip.java @@ -784,6 +784,8 @@ public void createHoldSlipPdf(List oleLoanDocumentList, HttpSer EntityNameBo nameBo = oleRequestPatronDocument != null ? oleRequestPatronDocument.getEntity().getNames().get(0) : null; String patronName = nameBo != null ? nameBo.getLastName() + "," + nameBo.getFirstName() : null; Date expirationDate = oleRequestPatronDocument != null ? oleRequestPatronDocument.getExpirationDate() : null; + String patronBarcode = oleRequestPatronDocument.getOlePatronEntityViewBo().getPatronBarcode(); + String itemCallNumber = null; String copyNumber = null; String volumeNumber = null; @@ -810,6 +812,8 @@ public void createHoldSlipPdf(List oleLoanDocumentList, HttpSer pdfTable.addCell(getPdfPCellAligned("Hold Slip", Font.BOLD, -18)); pdfTable.addCell(getEmptyCell()); pdfTable.addCell(getPdfPCellAligned(patronName, Font.NORMAL, -18)); + pdfTable.addCell(getPdfPCellAligned(patronBarcode, Font.NORMAL, -18)); + if (oleCirculationDesk != null) { int noDays = Integer.parseInt(oleCirculationDesk.getOnHoldDays()); Calendar calendar = Calendar.getInstance(); @@ -858,6 +862,10 @@ public void createHoldSlipPdf(List oleLoanDocumentList, HttpSer pdfTable.addCell(getPdfPCellInLeft(":")); pdfTable.addCell(getPdfPCellInJustified(patronName)); + pdfTable.addCell(getPdfPCellInJustified("Patron Barcode")); + pdfTable.addCell(getPdfPCellInLeft(":")); + pdfTable.addCell(getPdfPCellInJustified(patronBarcode)); + pdfTable.addCell(getPdfPCellInJustified("Expiration Date")); pdfTable.addCell(getPdfPCellInLeft(":")); pdfTable.addCell(getPdfPCellInJustified(expirationDate != null ? dateFormat.format(expirationDate).toString() : null)); diff --git a/ole-app/olefs/src/main/java/org/kuali/ole/deliver/util/printSlip/OnHoldRecieptPrintSlipUtil.java b/ole-app/olefs/src/main/java/org/kuali/ole/deliver/util/printSlip/OnHoldRecieptPrintSlipUtil.java index cfef074f42..356d56e367 100644 --- a/ole-app/olefs/src/main/java/org/kuali/ole/deliver/util/printSlip/OnHoldRecieptPrintSlipUtil.java +++ b/ole-app/olefs/src/main/java/org/kuali/ole/deliver/util/printSlip/OnHoldRecieptPrintSlipUtil.java @@ -37,8 +37,10 @@ protected void populateBody(PdfPTable pdfTable) { OleCirculationDesk oleCirculationDesk = null != getOleItemRecordForCirc() ? getOleItemRecordForCirc().getCheckinLocation() : null; OleDeliverRequestBo oleDeliverRequestBo = getOleItemRecordForCirc().getOleDeliverRequestBo(); String patronName = oleDeliverRequestBo != null ? oleDeliverRequestBo.getOlePatron().getPatronName() : null; + String patronBarcode = oleDeliverRequestBo != null ? oleDeliverRequestBo.getOlePatron().getBarcode() : null; try { pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(patronName)); + pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(patronBarcode)); if(null != oleDeliverRequestBo && oleDeliverRequestBo.getHoldExpirationDate() != null) { Date date = oleDeliverRequestBo.getHoldExpirationDate(); if (date != null) { @@ -61,4 +63,4 @@ protected void populateBody(PdfPTable pdfTable) { LOG.error("Exception while creating pdf for printing slip", e); } } -} \ No newline at end of file +} diff --git a/ole-app/olefs/src/main/java/org/kuali/ole/deliver/util/printSlip/OnHoldRegularPrintSlipUtil.java b/ole-app/olefs/src/main/java/org/kuali/ole/deliver/util/printSlip/OnHoldRegularPrintSlipUtil.java index 48fedc87eb..e4284762fe 100644 --- a/ole-app/olefs/src/main/java/org/kuali/ole/deliver/util/printSlip/OnHoldRegularPrintSlipUtil.java +++ b/ole-app/olefs/src/main/java/org/kuali/ole/deliver/util/printSlip/OnHoldRegularPrintSlipUtil.java @@ -26,11 +26,17 @@ protected void populateHeader(Paragraph paraGraph) { protected void populateBody(PdfPTable pdfTable) { OleDeliverRequestBo oleDeliverRequestBo = getOleItemRecordForCirc().getOleDeliverRequestBo(); String patronName = oleDeliverRequestBo != null ? oleDeliverRequestBo.getOlePatron().getPatronName() : null; + String patronBarcode = oleDeliverRequestBo != null ? oleDeliverRequestBo.getOlePatron().getBarcode() : null; + Object expirationDate = oleDeliverRequestBo != null ? oleDeliverRequestBo.getHoldExpirationDate() : null; pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Patron Name")); pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":")); pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(patronName)); + pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Patron Barcode")); + pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":")); + pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(patronBarcode)); + pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Expiration Date")); pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":")); pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(expirationDate != null ? getDateFormat().format(expirationDate).toString() : null));