Skip to content

Instantly share code, notes, and snippets.

@remocrevo
Created August 22, 2017 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remocrevo/c6349a5ac35510905c6b581ff8de1e1a to your computer and use it in GitHub Desktop.
Save remocrevo/c6349a5ac35510905c6b581ff8de1e1a to your computer and use it in GitHub Desktop.
circ : workstations : receipts : Receipt Templates

Print Templates

Most of the receipts that print from the Evergreen staff client software are managed via the Print Template Editor (Administration → Workstation → Print Templates) and can be customized on an individual workstation basis. Typically, library systems will set up the receipts the way they want them to print out on one workstation at a branch, then export the settings as a file and import that file to each of the other workstations at that branch. Some library systems choose to set up different types of workstations (Circulation versus Technical Services, for example) differently depending on the type of work that needs to be done.

If Hatch is installed receipts can be forced to use a specific printer settings (Administration → Workstation → Printer Settings).

Note

There are a few receipts, such as the Evergreen self-checkout receipts, that are controlled through Notification Action Triggers rather than through Print Templates. Changes to the notification action triggers are set on a PINES-wide basis and restricted to PINES staff. Any requests for changes will need to be reviewed for suitability for all PINES libraries.

Types of Print Templates

  • Bills, Current: Listing of current bills on an account.

  • Bills, Historic: Listing of bills that have had payments made on them. This used on the Bill History Transaction screen.

  • Bills, Payment: Patron payment receipt.

  • Checkin: List of items that have been entered in to the check-in screen.

  • Checkout: List of items currently checked out by a patron during the transaction.

  • Hold Transit Slip: This is printed when a hold goes in-transit to another library.

  • Hold Shelf Slip: This prints when a hold is fulfilled.

  • Holds for Bib Record: Prints a list of holds on a Title record.

  • Holds for Patron: Prints a list of holds on a patron record.

  • Hold Pull List: Prints the Holds Pull List.

  • Hold Shelf List: Prints a list of hold that are waiting to be picked up.

  • In-House Use List: Prints a list of items imputed into In-house use.

  • Item Status: Prints a list of items imputed into Item Status.

  • Items Out: Prints the list of items a patron has checked out.

  • Patron Address: Prints the current patrons address.

  • Patron Note: Prints a note on a patron’s record.

  • Renew: List of items that have been renewed using the Renew Item Screen.

  • Transit List: Prints the list of items in-transit from the Transit List.

  • Transit Slip: This is printed when an items goes in-transit to another location.

Customizing Print Templates

Warning

Clearing your browser’s cache/temporary files will clear any print template customizations that you make. Be sure to export a copy of your customizations as a backup so that you can import it as needed.

General Workflow

  1. In Evergreen, go to Administration → Workstation → Print Templates.

  2. Select the Template Name of the receipt you wish to customize.

  3. If you are using Hatch, you can choose different printers for different types of receipts with the Force Content field. If not, leave that field blank.

  4. Make changes in the Template field.

  5. Click Save Locally.

circ workstations print templates

Content / Data

The various pieces of data that can be printed on a receipt are limited, and vary by receipt type.

Formatting

The print templates follow W3C HTML standards (see http://w3schools.com/html/default.asp) and can make use of CSS and Angular JS to a certain extent.

Print templates use variables for various pieces of information coming from the Evergreen database. These variables deal with everything from the library name to the due date of an item. Information from the database is entered in the templates with curly brackets. Different types of print templates have access to different pieces of information. Example: {{checkout.title}}

Some print templates have sections that are repeated for each item in a list. For example, the portion of the Checkout print template below repeats every item that is checked out in HTML list format by means of the 'ng-repeat' in the li tag.

<ol>
<li ng-repeat="checkout in circulations">
<b>{{checkout.title}}</b><br/>
Barcode: {{checkout.copy.barcode}}<br/>
Due: {{checkout.circ.due_date | date:"short"}}<br/>
</li>
</ol>

Text Formatting

Goal

Original

Code

Result

Bold (HTML)

hello

<b>hello</b>

hello

Bold (CSS)

hello

<span style="font-weight:bold;">hello</span>

hello

Capitalize

circulation

<span style="text-transform:capitalize;">circulation</span>

Circulation

Currency

1

{{1 | currency}}

$1.00

Date Formatting

If you do not format dates, they will appear in a system format which isn’t easily readable.

Code

Result

{{today}}

2017-08-01T14:18:51.445Z

{{today | date:'short'}}

8/1/17 10:18 AM

{{today | date:'M/d/yyyy'}}

8/1/2017

Currency Formatting

Add | currency after any dollar amount that you wish to display as currency.

Code

Result

{{xact.summary.balance_owed | currency}}

$2.50

Conditional Formatting

You can use Angular JS to only print a line if the data matches. For example:

<div ng-if="hold.email_notify == 't'">Notify by email: {{patron.email}}</div>

This will only print the ``Notify by email:'' line if email notification is enabled for that hold.

Substrings

To print just a substring of a variable, you can use a limitTo function: {{variable | limitTo:limit}} where limit is the number of characters you want.

Original

Code

Result

The Sisterhood of the Traveling Pants

{{checkout.title | limitTo:10}}

The Sisterhood of th

123456789

{{patron.card.barcode | limitTo:-5}}

56789

Images

You can use HTML and CSS to add an image to your print template if you have the image uploaded onto a publicly available web server. For example:

<img src="https://pines.georgialibraries.org/dokuwiki/lib/exe/fetch.php?media=logo.png" style="width:150px;padding:5px;">

Sort Order

You can sort the items in an ng-repeat block using orderBy. For example, the following will sort a list of holds by the shelving location first, then by the call number:

<tr ng-repeat="hold_data in holds | orderBy : ['copy.location.name','volume.label']">

Export / Import Customized Templates

To set up all workstations in a branch in the same way, set up one workstation’s receipt templates completely, then use the ``Export Customized Templates'' to save an external file that you can then Import into other workstations.

Reset Print Templates to Default

The web client doesn’t have a built-in option to reset the print templates to default, but they should reset if you clear your entire browser cache. You could also un-zip the file below and import the file it contains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment