4 -- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
6 -- insert then update for easier iterative development tweaks
7 INSERT INTO config.print_template
8 (name, label, owner, active, locale, content_type, template)
9 VALUES ('items_out', 'Patron Items Out', 1, TRUE, 'en-US', 'text/html', '');
11 UPDATE config.print_template SET template = $TEMPLATE$
14 circulations = template_data.circulations;
17 <div>Welcome to [% staff_org.name %]</div>
18 <div>You have the following items:</div>
21 [% FOR checkout IN circulations %]
23 <div>[% checkout.title %]</div>
25 [% IF checkout.copy %]Barcode: [% checkout.copy.barcode %][% END %]
26 Due: [% date.format(helpers.format_date(checkout.dueDate, staff_org_timezone), '%x %r') %]
32 <div>[% staff_org.name %] [% date.format(date.now, '%x %r') %]</div>
33 <div>You were helped by [% staff.first_given_name %]</div>
36 $TEMPLATE$ WHERE name = 'items_out';
38 UPDATE config.print_template SET active = TRUE WHERE name = 'patron_address';
40 -- insert then update for easier iterative development tweaks
41 INSERT INTO config.print_template
42 (name, label, owner, active, locale, content_type, template)
43 VALUES ('bills_current', 'Bills, Current', 1, TRUE, 'en-US', 'text/html', '');
46 UPDATE config.print_template SET template = $TEMPLATE$
49 USE money = format('$%.2f');
50 SET xacts = template_data.xacts;
53 <style>td { padding: 1px 3px 1px 3px; }</style>
54 <div>Welcome to [% staff_org.name %]</div>
55 <div>You have the following bills:</div>
58 [% FOR xact IN xacts %]
63 <td>[% xact.id %]</td>
67 <td>[% date.format(helpers.format_date(
68 xact.xact_start, staff_org_timezone), '%x %r') %]
72 <td>Last Billing:</td>
73 <td>[% xact.last_billing_type %]</td>
76 <td>Total Billed:</td>
77 <td>[% money(xact.total_owed) %]</td>
80 <td>Last Payment:</td>
82 [% xact.last_payment_type %]
83 [% IF xact.last_payment_ts %]
86 xact.last_payment_ts, staff_org_timezone), '%x %r') %]
92 <td>[% money(xact.total_paid) %]</td>
96 <td>[% money(xact.balance_owed) %]</td>
103 <div>[% staff_org.name %] [% date.format(date.now, '%x %r') %]</div>
104 <div>You were helped by [% staff.first_given_name %]</div>
107 $TEMPLATE$ WHERE name = 'bills_current';
110 INSERT INTO config.print_template
111 (name, label, owner, active, locale, content_type, template)
112 VALUES ('bills_payment', 'Bills, Payment', 1, TRUE, 'en-US', 'text/html', '');
114 UPDATE config.print_template SET template = $TEMPLATE$
117 USE money = format('$%.2f');
118 SET payments = template_data.payments;
119 SET previous_balance = template_data.previous_balance;
120 SET new_balance = template_data.new_balance;
121 SET payment_type = template_data.payment_type;
122 SET payment_total = template_data.payment_total;
123 SET payment_applied = template_data.payment_applied;
124 SET amount_voided = template_data.amount_voided;
125 SET change_given = template_data.change_given;
126 SET payment_note = template_data.payment_note;
127 SET copy_barcode = template_data.copy_barcode;
128 SET title = template_data.title;
131 <style>td { padding: 1px 3px 1px 3px; }</style>
132 <div>Welcome to [% staff_org.name %]</div>
133 <div>A receipt of your transaction:</div>
136 <table style="width:100%">
138 <td>Original Balance:</td>
139 <td align="right">[% money(previous_balance) %]</td>
142 <td>Payment Method:</td>
144 [% SWITCH payment_type %]
145 [% CASE "cash_payment" %]Cash
146 [% CASE "check_payment" %]Check
147 [% CASE "credit_card_payment" %]Credit Card
148 [% CASE "debit_card_payment" %]Debit Card
149 [% CASE "credit_payment" %]Patron Credit
150 [% CASE "work_payment" %]Work
151 [% CASE "forgive_payment" %]Forgive
152 [% CASE "goods_payment" %]Goods
157 <td>Payment Received:</td>
158 <td align="right">[% money(payment_total) %]</td>
161 <td>Payment Applied:</td>
162 <td align="right">[% money(payment_applied) %]</td>
165 <td>Billings Voided:</td>
166 <td align="right">[% money(amount_voided) %]</td>
169 <td>Change Given:</td>
170 <td align="right">[% money(change_given) %]</td>
173 <td>New Balance:</td>
174 <td align="right">[% money(new_balance) %]</td>
177 <p>Note: [% payment_note %]</p>
181 [% FOR payment IN payments %]
182 <table style="width:100%">
184 <td>Bill # [% payment.xact.id %]</td>
185 <td>[% payment.xact.summary.last_billing_type %]</td>
186 <td>Received: [% money(payment.amount) %]</td>
188 [% IF payment.copy_barcode %]
190 <td colspan="5">[% payment.copy_barcode %] [% payment.title %]</td>
200 <div>[% staff_org.name %] [% date.format(date.now, '%x %r') %]</div>
201 <div>You were helped by [% staff.first_given_name %]</div>
203 $TEMPLATE$ WHERE name = 'bills_payment';
206 INSERT INTO config.print_template
207 (name, label, owner, active, locale, content_type, template)
208 VALUES ('patron_data', 'Patron Data', 1, TRUE, 'en-US', 'text/html', '');
210 UPDATE config.print_template SET template = $TEMPLATE$
213 USE money = format('$%.2f');
214 SET patron = template_data.patron;
217 <tr><td>Barcode:</td><td>[% patron.card.barcode %]</td></tr>
218 <tr><td>Patron's Username:</td><td>[% patron.usrname %]</td></tr>
219 <tr><td>Prefix/Title:</td><td>[% patron.prefix %]</td></tr>
220 <tr><td>First Name:</td><td>[% patron.first_given_name %]</td></tr>
221 <tr><td>Middle Name:</td><td>[% patron.second_given_name %]</td></tr>
222 <tr><td>Last Name:</td><td>[% patron.family_name %]</td></tr>
223 <tr><td>Suffix:</td><td>[% patron.suffix %]</td></tr>
224 <tr><td>Holds Alias:</td><td>[% patron.alias %]</td></tr>
225 <tr><td>Date of Birth:</td><td>[% patron.dob %]</td></tr>
226 <tr><td>Juvenile:</td><td>[% patron.juvenile %]</td></tr>
227 <tr><td>Primary Identification Type:</td><td>[% patron.ident_type.name %]</td></tr>
228 <tr><td>Primary Identification:</td><td>[% patron.ident_value %]</td></tr>
229 <tr><td>Secondary Identification Type:</td><td>[% patron.ident_type2.name %]</td></tr>
230 <tr><td>Secondary Identification:</td><td>[% patron.ident_value2 %]</td></tr>
231 <tr><td>Email Address:</td><td>[% patron.email %]</td></tr>
232 <tr><td>Daytime Phone:</td><td>[% patron.day_phone %]</td></tr>
233 <tr><td>Evening Phone:</td><td>[% patron.evening_phone %]</td></tr>
234 <tr><td>Other Phone:</td><td>[% patron.other_phone %]</td></tr>
235 <tr><td>Home Library:</td><td>[% patron.home_ou.name %]</td></tr>
236 <tr><td>Main (Profile) Permission Group:</td><td>[% patron.profile.name %]</td></tr>
237 <tr><td>Privilege Expiration Date:</td><td>[% patron.expire_date %]</td></tr>
238 <tr><td>Internet Access Level:</td><td>[% patron.net_access_level.name %]</td></tr>
239 <tr><td>Active:</td><td>[% patron.active %]</td></tr>
240 <tr><td>Barred:</td><td>[% patron.barred %]</td></tr>
241 <tr><td>Is Group Lead Account:</td><td>[% patron.master_account %]</td></tr>
242 <tr><td>Claims-Returned Count:</td><td>[% patron.claims_returned_count %]</td></tr>
243 <tr><td>Claims-Never-Checked-Out Count:</td><td>[% patron.claims_never_checked_out_count %]</td></tr>
244 <tr><td>Alert Message:</td><td>[% patron.alert_message %]</td></tr>
246 [% FOR addr IN patron.addresses %]
247 <tr><td colspan="2">----------</td></tr>
248 <tr><td>Type:</td><td>[% addr.address_type %]</td></tr>
249 <tr><td>Street (1):</td><td>[% addr.street1 %]</td></tr>
250 <tr><td>Street (2):</td><td>[% addr.street2 %]</td></tr>
251 <tr><td>City:</td><td>[% addr.city %]</td></tr>
252 <tr><td>County:</td><td>[% addr.county %]</td></tr>
253 <tr><td>State:</td><td>[% addr.state %]</td></tr>
254 <tr><td>Postal Code:</td><td>[% addr.post_code %]</td></tr>
255 <tr><td>Country:</td><td>[% addr.country %]</td></tr>
256 <tr><td>Valid Address?:</td><td>[% addr.valid %]</td></tr>
257 <tr><td>Within City Limits?:</td><td>[% addr.within_city_limits %]</td></tr>
260 [% FOR entry IN patron.stat_cat_entries %]
261 <tr><td>-----------</td></tr>
262 <tr><td>[% entry.stat_cat.name %]</td><td>[% entry.stat_cat_entry %]</td></tr>
267 $TEMPLATE$ WHERE name = 'patron_data';
270 INSERT INTO config.print_template
271 (name, label, owner, active, locale, content_type, template)
272 VALUES ('hold_shelf_slip', 'Hold Shelf Slip', 1, TRUE, 'en-US', 'text/html', '');
275 UPDATE config.print_template SET template = $TEMPLATE$
278 USE money = format('$%.2f');
279 SET copy = template_data.checkin.copy;
280 SET hold = template_data.checkin.hold;
281 SET volume = template_data.checkin.volume;
282 SET hold = template_data.checkin.hold;
283 SET record = template_data.checkin.record;
284 SET patron = template_data.checkin.patron;
288 [% IF hold.behind_desk == 't' %]
289 This item needs to be routed to the <strong>Private Holds Shelf</strong>.
291 This item needs to be routed to the <strong>Public Holds Shelf</strong>.
296 <div>Barcode: [% copy.barcode %]</div>
297 <div>Title: [% checkin.title %]</div>
298 <div>Call Number: [% volume.prefix.label %] [% volume.label %] [% volume.suffix.label %]</div>
302 <div>Hold for patron: [% patron.family_name %],
303 [% patron.first_given_name %] [% patron.second_given_name %]</div>
304 <div>Barcode: [% patron.card.barcode %]</div>
306 [% IF hold.phone_notify %]
307 <div>Notify by phone: [% hold.phone_notify %]</div>
309 [% IF hold.sms_notify %]
310 <div>Notify by text: [% hold.sms_notify %]</div>
312 [% IF hold.email_notify %]
313 <div>Notify by email: [% patron.email %]</div>
316 [% FOR note IN hold.notes %]
318 [% IF note.slip == 't' %]
319 <li><strong>[% note.title %]</strong> - [% note.body %]</li>
325 <div>Request Date: [%
326 date.format(helpers.format_date(hold.request_time, staff_org_timezone), '%x %r') %]</div>
327 <div>Slip Date: [% date.format(date.now, '%x %r') %]</div>
328 <div>Printed by [% staff.first_given_name %] at [% staff_org.shortname %]</div>
332 $TEMPLATE$ WHERE name = 'hold_shelf_slip';
335 INSERT INTO config.print_template
336 (name, label, owner, active, locale, content_type, template)
337 VALUES ('transit_slip', 'Transit Slip', 1, TRUE, 'en-US', 'text/html', '');
340 UPDATE config.print_template SET template = $TEMPLATE$
343 USE money = format('$%.2f');
344 SET checkin = template_data.checkin;
345 SET copy = checkin.copy;
346 SET destOrg = checkin.destOrg;
347 SET destAddress = checkin.destAddress;
348 SET destCourierCode = checkin.destCourierCode;
351 <div>This item needs to be routed to <b>[% destOrg.shortname %]</b></div>
352 <div>[% destOrg.name %]</div>
353 [% IF destCourierCode %]Courier Code: [% destCourierCode %][% END %]
356 <div>[% destAddress.street1 %]</div>
357 <div>[% destAddress.street2 %]</div>
358 <div>[% destAddress.city %],
359 [% destAddress.state %]
360 [% destAddress.post_code %]</div>
362 <div>We do not have a holds address for this library.</div>
366 <div>Barcode: [% copy.barcode %]</div>
367 <div>Title: [% checkin.title %]</div>
368 <div>Author: [% checkin.author %]</div>
371 <div>Slip Date: [% date.format(date.now, '%x %r') %]</div>
372 <div>Printed by [% staff.first_given_name %] at [% staff_org.shortname %]</div>
375 $TEMPLATE$ WHERE name = 'transit_slip';
378 INSERT INTO config.print_template
379 (name, label, owner, active, locale, content_type, template)
380 VALUES ('hold_transit_slip', 'Hold Transit Slip', 1, TRUE, 'en-US', 'text/html', '');
382 UPDATE config.print_template SET template = $TEMPLATE$
385 USE money = format('$%.2f');
386 SET checkin = template_data.checkin;
387 SET copy = checkin.copy;
388 SET hold = checkin.hold;
389 SET patron = checkin.patron;
390 SET destOrg = checkin.destOrg;
391 SET destAddress = checkin.destAddress;
392 SET destCourierCode = checkin.destCourierCode;
395 <div>This item needs to be routed to <b>[% destOrg.shortname %]</b></div>
396 <div>[% destOrg.name %]</div>
397 [% IF destCourierCode %]Courier Code: [% destCourierCode %][% END %]
400 <div>[% destAddress.street1 %]</div>
401 <div>[% destAddress.street2 %]</div>
402 <div>[% destAddress.city %],
403 [% destAddress.state %]
404 [% destAddress.post_code %]</div>
406 <div>We do not have a holds address for this library.</div>
410 <div>Barcode: [% copy.barcode %]</div>
411 <div>Title: [% checkin.title %]</div>
412 <div>Author: [% checkin.author %]</div>
415 <div>Hold for patron [% patron.card.barcode %]</div>
418 <div>Request Date: [%
419 date.format(helpers.format_date(hold.request_time, staff_org_timezone), '%x %r') %]
421 <div>Slip Date: [% date.format(date.now, '%x %r') %]</div>
422 <div>Printed by [% staff.first_given_name %] at [% staff_org.shortname %]</div>
425 $TEMPLATE$ WHERE name = 'transit_slip';
427 INSERT INTO config.print_template
428 (name, label, owner, active, locale, content_type, template)
429 VALUES ('checkin', 'Checkin', 1, TRUE, 'en-US', 'text/html', '');
431 UPDATE config.print_template SET template = $TEMPLATE$
434 USE money = format('$%.2f');
435 SET checkins = template_data.checkins;
439 <div>Welcome to [% staff_org.name %]</div>
440 <div>You checked in the following items:</div>
443 [% FOR checkin IN checkins %]
445 <div>[% checkin.title %]</div>
446 <span>Barcode: </span>
447 <span>[% checkin.copy.barcode %]</span>
448 <span>Call Number: </span>
450 [% IF checkin.volume %]
451 [% volume.prefix.label %] [% volume.label %] [% volume.suffix.label %]
460 <div>Slip Date: [% date.format(date.now, '%x %r') %]</div>
461 <div>Printed by [% staff.first_given_name %] at [% staff_org.shortname %]</div>
464 $TEMPLATE$ WHERE name = 'checkin';
467 INSERT INTO config.print_template
468 (name, label, owner, active, locale, content_type, template)
469 VALUES ('holds_for_patron', 'Holds For Patron', 1, TRUE, 'en-US', 'text/html', '');
472 UPDATE config.print_template SET template = $TEMPLATE$
475 USE money = format('$%.2f');
476 SET holds = template_data;
480 <div>Welcome to [% staff_org.name %]</div>
481 <div>You have the following items on hold:</div>
484 [% FOR hold IN holds %]
486 <div>[% hold.title %]</div>
491 <div>Slip Date: [% date.format(date.now, '%x %r') %]</div>
492 <div>Printed by [% staff.first_given_name %] at [% staff_org.shortname %]</div>
495 $TEMPLATE$ WHERE name = 'holds_for_patron';
498 INSERT INTO config.print_template
499 (name, label, owner, active, locale, content_type, template)
500 VALUES ('bills_historical', 'Bills, Historical', 1, TRUE, 'en-US', 'text/html', '');
503 UPDATE config.print_template SET template = $TEMPLATE$
506 USE money = format('$%.2f');
507 SET xacts = template_data.xacts;
510 <style>td { padding: 1px 3px 1px 3px; }</style>
511 <div>Welcome to [% staff_org.name %]</div>
512 <div>You have the following bills:</div>
515 [% FOR xact IN xacts %]
520 <td>[% xact.id %]</td>
524 <td>[% date.format(helpers.format_date(
525 xact.xact_start, staff_org_timezone), '%x %r') %]
529 <td>Last Billing:</td>
530 <td>[% xact.last_billing_type %]</td>
533 <td>Total Billed:</td>
534 <td>[% money(xact.total_owed) %]</td>
537 <td>Last Payment:</td>
539 [% xact.last_payment_type %]
540 [% IF xact.last_payment_ts %]
543 xact.last_payment_ts, staff_org_timezone), '%x %r') %]
549 <td>[% money(xact.total_paid) %]</td>
553 <td>[% money(xact.balance_owed) %]</td>
560 <div>[% staff_org.name %] [% date.format(date.now, '%x %r') %]</div>
561 <div>You were helped by [% staff.first_given_name %]</div>
564 $TEMPLATE$ WHERE name = 'bills_historical';
566 INSERT INTO config.print_template
567 (name, label, owner, active, locale, content_type, template)
568 VALUES ('checkout', 'Checkout', 1, TRUE, 'en-US', 'text/html', '');
570 UPDATE config.print_template SET template = $TEMPLATE$
573 USE money = format('$%.2f');
574 SET checkouts = template_data.checkouts;
578 <div>Welcome to [% staff_org.name %]</div>
579 <div>You checked out the following items:</div>
582 [% FOR checkout IN checkouts %]
584 <div>[% checkout.title %]</div>
585 <span>Barcode: </span>
586 <span>[% checkout.copy.barcode %]</span>
587 <span>Call Number: </span>
589 [% IF checkout.volume %]
590 [% volume.prefix.label %] [% volume.label %] [% volume.suffix.label %]
599 <div>Slip Date: [% date.format(date.now, '%x %r') %]</div>
600 <div>Printed by [% staff.first_given_name %] at [% staff_org.shortname %]</div>
603 $TEMPLATE$ WHERE name = 'checkout';
605 INSERT INTO config.print_template
606 (name, label, owner, active, locale, content_type, template)
607 VALUES ('renew', 'renew', 1, TRUE, 'en-US', 'text/html', '');
609 UPDATE config.print_template SET template = $TEMPLATE$
612 USE money = format('$%.2f');
613 SET renewals = template_data.renewals;
617 <div>Welcome to [% staff_org.name %]</div>
618 <div>You renewed the following items:</div>
621 [% FOR renewal IN renewals %]
623 <div>[% renewal.title %]</div>
624 <span>Barcode: </span>
625 <span>[% renewal.copy.barcode %]</span>
626 <span>Call Number: </span>
628 [% IF renewal.volume %]
629 [% volume.prefix.label %] [% volume.label %] [% volume.suffix.label %]
638 <div>Slip Date: [% date.format(date.now, '%x %r') %]</div>
639 <div>Printed by [% staff.first_given_name %] at [% staff_org.shortname %]</div>
642 $TEMPLATE$ WHERE name = 'renew';