HomeAdministrationEditing Receipt TemplatesSnippets of useful code for your receipts

5.4. Snippets of useful code for your receipts

Sorting: You can sort lists or tables using orderBy  

sample code for sorting holds lists by copy location and call #: <li ng-repeat="hold_data in holds | orderBy: ['hold._copy_location_position', 'copy.location.name', 'volume.prefix_sortkey', 'volume.label_sortkey', 'volume.suffix_sortkey']">


"You saved": you can insert the total saved by patrons using the item's price.

First, you will need to add the item price code into the line item for each checkout (you should already have the text before the |, so insert the rest).

<li ng-repeat="checkout in circulations" | ng-init="transactions.subtotal=transactions.subtotal -- checkout.copy.price" >

Then, add the sum at the bottom: 

<hr/><div>Cost to buy these books: {{transactions.subtotal | currency}}</span><br/> The value of your public library -- Priceless! <BR> <Br>

This page was: Helpful | Not Helpful