Skip to content

Commit

Permalink
OLE-9452 : Add Patron Barcode to Hold Slip
Browse files Browse the repository at this point in the history
  • Loading branch information
NSSuresh111975 committed Jul 12, 2021
1 parent c887052 commit 87b57d9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ public void createHoldSlipPdf(List<OleLoanDocument> 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;
Expand All @@ -810,6 +812,8 @@ public void createHoldSlipPdf(List<OleLoanDocument> 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();
Expand Down Expand Up @@ -858,6 +862,10 @@ public void createHoldSlipPdf(List<OleLoanDocument> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -61,4 +63,4 @@ protected void populateBody(PdfPTable pdfTable) {
LOG.error("Exception while creating pdf for printing slip", e);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 87b57d9

Please sign in to comment.