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:

<span class="price" style="display: none;"><<items.price>></span>

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

Next, add this somewhere on the slip:

Cost of buying these items:<br/>
$<span id="price"></span><br/>
Cost of using the library:<br/>
Priceless!<br/>

Lastly, add this to the bottom of your slip:

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

The result in Koha will be something like this:

Slip w/ Cost

Leave a comment

Your email address will not be published. Required fields are marked *

Are you human? * Time limit is exhausted. Please reload CAPTCHA.