Koha How-To

Add a Cost Savings to the Patron's Slip!

Editing Your Notice/s

First, you want to log in to your Koha staff client and go to Tools > Notices & Slips.

Next, you’ll want to find your ISSUESLIP or ISSUEQSLIP (or both). Although these receipts are generally printed with a receipt printer, you will want to edit the EMAIL portion of the notice, not the PRINT.

Add this bit to the top of the text box:

[% USE Price %]
[% USE ItemTypes %]

This section is for what is currently in your slip. Let this section alone.

An example of what that could look like:

<h3><<branches.branchname>></h3>
Checked out to <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
(<<borrowers.cardnumber>>) <br />

<<today>><br />

<h4>Checked Out Today</h4>
<checkedout>
<p>
<<biblio.title>> <br />
Barcode: <<items.barcode>><br />
Date due: <<issues.date_due>><br />
</p>

</checkedout>

Then add this bit:

[% USE Price %]
[% totalValue = 0 %]

[% totalValue = 0 %]
[% FOREACH checkout IN checkouts %]
[% IF checkout.item.price == '' || checkout.item.price == '0.00' %]
[% FOREACH itemtype IN ItemTypes.Get() %]
[% IF checkout.item.itype == itemtype.itemtype %]
[% totalValue = totalValue + itemtype.defaultreplacecost %]
[% END %]
[% END %]
[% ELSE %]
[% totalValue = totalValue + checkout.item.price %]
[% END %]
[% END %]

<div>
By using the library today you have saved: <strong>$[% totalValue | $Price %]</strong>
</div>

Lifetime Savings

If you want to add the patron's lifetime savings, add this to the slip after the

</div>

[% FOREACH old_checkout IN borrower.old_checkouts %]
[% IF old_checkout.item.price == '' || old_checkout.item.price == '0.00' %]
[% FOREACH itemtype IN ItemTypes.Get() %]
[% IF old_checkout.item.itype == itemtype.itemtype %]
[% totalValue = totalValue + itemtype.defaultreplacecost %]
[% END %]
[% END %]
[% ELSE %]
[% totalValue = totalValue + old_checkout.item.price %]
[% END %]
[% END %]

<div>
By using the library your all time savings is: <strong>$[% totalValue | $Price%]</strong>
</div>

Replacement Price vs Purchase Price

This code uses the replacement price found in the item. If you prefer to use the purchase price, change the item.replacementprice to item.price.

This code will also defaults to itemtype.replacementprice when price is NULL or 0.00.

Example of Entire Issue Slip

Here is a link to a document that provides an entire issue slip code if you would prefer to just copy this and input it into Koha. This includes the lifetime savings at the bottom.

OPAC Option

Another option is to show the patrons their cost savings on the OPAC! To find out more about this feature, see this blog post:

Monday Minutes: Patron Savings on the OPAC

Additional Resources


But wait, want to know more about customizing your notices and slips for the library, check out these other resources:

New Director: Notices and Slips

Monday Minutes: Translating Notices

Koha 22.11: Notices & Slips

Monday Minutes: New Notices in Koha