[OPEN-ILS-GENERAL] Receipt Template Question

Brent Mills brent at hoodriverlibrary.org
Wed May 4 13:17:28 EDT 2016


Hi Elizabeth,

There's a sum function that you can include in your receipt templates to 
add up the given macro/value for a total.

I don't believe there's a count function, or I haven't seen one for the 
receipt templates, at least.

You might be able to do something like one of these approaches:


For the "checkout" receipt template (line item bit is included within 
the <li> tags you have):

    *Line Item*: <span style="display: none;"
    sum="sum1">%copy_number%</span>

    *Footer*: <div><center>You currently have <span sumout="sum1"
    style="font-weight:bold;"></span> item(s) checked out
    from<br/>%LIBRARY%</center></div>

That would depend on each of the "copy_number" fields being "1", and 
that field isn't a required entry... so it's probably not the best option.

I'd probably do something like:

    *Line Item*: <span style="display: none;" sum="sum1">1</span>

    *Footer*: <div><center>You currently have <span sumout="sum1"
    style="font-weight:bold;"></span> item(s) checked out
    from<br/>%LIBRARY%</center></div>


So a barebones/complete example for line item/footer would be:

    *Line Item:*

    <li>
    <span style="font-weight:bold">%title%</span><br/>
    Author: %author%<br/>
    Barcode: %barcode%<br/>
    Due: %due_date%<br/>
    Item Type: %circ_modifier%<br/><br/>
    <span style="display: none;" sum="sum1">1</span>
    </li>

    *Footer:*

    <div><center>You currently have <span sumout="sum1"
    style="font-weight:bold;"></span> item(s) checked out
    from<br/>%LIBRARY%</center></div>

I'm not sure if there's any harm in hardcoding a "1" value for each line 
item, but that seems to work. I'll let others chime in.

Good luck!

-Brent

On 5/4/16 8:09 AM, Elizabeth Davis wrote:
>
> Hello Everyone,
>
> We had a request from a library that wants to have a total number of 
> checked out items auto-populated on the bottom of their checkout 
> receipts for their Summer Reading Club program.  I’ve got the template 
> printing the list numbers, but can’t seem to get it to total the 
> number of items.
>
> Any suggestions?
>
> Thanks so much,
>
> Elizabeth Davis
>
> Head of Digital Services
>
> Scranton Public Library
>
> 500 Vine Street
>
> Scranton, PA 18509
>
> 570-348-3000 ext. 3050
>
> edavis at albright.org
>

-- 
Brent Mills
Systems Librarian | Sage Library System
email: brent at hoodriverlibrary.org
tickets: sagelib.org/support
phone: 541.610.8384

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-general/attachments/20160504/f62c7d93/attachment.html>


More information about the Open-ils-general mailing list