February 28, 2012

Receipt Editing in Evergreen 3

This post is the last of a series.

There is, of course, at least one more consumer of receipts in a library setting: library staff. If items are pulled from the shelf to fill a hold they'll have receipts printed, the same if an item can fill a hold when it's checked in. Many libraries will only hold an item for a limited time before returning it to the shelf or letting another person have it, so you might want to write an expiration date on it. Also, if you have any  holds volume to speak of, the items on the hold need to be kept in some kind of order or no one can find anything - so that's more writing, highlighting, or circling names on receipts.

If only it were possible to simplify and automate this stuff.

Route item to Holds Shelf:
The Title of The Item
Barcode: 31234000000032
Request date: 2012-01-15

B
Expires:
2/29

Hold for Boyer, Jason
Barcode: 21234000000041
Notify by phone: 555-876-5309

Item checked by Jason

YRLIB 2012-02-22 13:42

Oh, right.

Only 3 more CSS trigger classes are needed for this. Here are the rest of the classes defined in my custom_format.js, and below you can get a copy to add to, remove from, etc., along with templates if you're interested.


mod-DateAdd-N(-d|w)
If there's a date in the tag, N days (by default) or weeks are added to it. If the tag is empty, N days or weeks are just added to the current date.

TemplateBecomes
<span class="mod-DateAdd-7">2012-02-22 11:32 AM</span>2012-02-29


xf-SubStr-N1(-N2)
Maybe you don't want the full text of item or patron information. A substring of the tag's contents are taken starting from N1 (begins at 0), going either to the end of the string, or N2 characters long.

TemplateBecomes
<span class="xf-SubStr-3-4">BigTextTime</span>Text


xf-DateToMonthDate
This takes a date and returns a month/date format. If there isn't a date in the tag, it uses today. It's not currently zero padded, if you care about that.

TemplateBecomes
<span class="xf-DateToMonthDate">2012-03-07</span>3/7


Having seen all of those transform classes, it might be nice to be able to actually use them. A generic copy of my custom_format.js is available that you can download and customize. The receipt templates are also available. A reminder: you need to save after changing each template. If you think you'll make changes to multiple templates and then only click Save Locally at the end, you're just going to get upset. I have been upset before; learn from that.