Koha How-To

Show Library Cost Savings on your Koha Receipt

Want to show your patrons what they saved by using your library? This handy tutorial will walk you through the steps.

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).

Now, add this to your <checkedout> block on your slip:

[code language=”html” wraplines=”true” toolbar=”true”]
<span class="price" style="display: none;"><<items.price>></span>
[/code]

items.replacementprice could also be used instead of items.price

Next, add this somewhere on the slip:

[code language=”html” wraplines=”true” toolbar=”true”]
Cost of buying these items:<br/>
$<span id="price"></span><br/>
Cost of using the library:<br/>
Priceless!<br/>
[/code]

Lastly, add this to the bottom of your slip:

[code language=”javascript” wraplines=”true” toolbar=”true”]
<script type="text/javascript">
var x = document.getElementsByClassName("price");
var i;
var total = 0;
for (i = 0; i < x.length; i++) {
var cost = parseFloat( x[i].innerHTML );
if ( ! isNaN( cost ) ) {
total += cost;
}
}
document.getElementById("price").innerHTML = total.toFixed(2);
</script>
[/code]

The result in Koha will be something like this:

Slip w/ Cost

Read more by Kyle Hall

Tags circulation tutorial