3 INSERT INTO config.upgrade_log (version) VALUES ('0094');
5 INSERT INTO action_trigger.hook (key, core_type, description, passive)
7 'format.selfcheck.checkout',
9 'Formats circ objects for self-checkout receipt',
13 INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, group_field, granularity, template )
18 'Self-Checkout Receipt',
19 'format.selfcheck.checkout',
26 [%- SET user = target.0.usr -%]
27 [%- SET lib = target.0.circ_lib -%]
28 [%- SET lib_addr = target.0.circ_lib.billing_address -%]
29 [%- SET hours = lib.hours_of_operation -%]
31 <style> li { padding: 8px; margin 5px; }</style>
32 <div>[% date.format %]</div>
33 <div>[% lib.name %]</div>
34 <div>[% lib_addr.street1 %] [% lib_addr.street2 %]</div>
35 <div>[% lib_addr.city %], [% lib_addr.state %] [% lb_addr.post_code %]</div>
36 <div>[% lib.phone %]</div>
39 [% user.family_name %], [% user.first_given_name %]
41 [% FOR circ IN target %]
43 SET idx = loop.count - 1;
44 SET user_data = EventProcessor.findEvent( event.$idx ).environment.user_data
47 <div>[% helpers.get_copy_bib_basics(circ.target_copy.id).title %]</div>
48 <div>Barcode: [% circ.target_copy.barcode %]</div>
49 [% IF user_data.renewal_failure %]
50 <div style='color:red;'>Renewal Failed</div>
52 <div>Due Date: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %]</div>
60 [%- BLOCK format_time; date.format(time _ ' 1/1/1000', format='%I:%M %p'); END -%]
63 [% PROCESS format_time time = hours.dow_0_open %]
64 [% PROCESS format_time time = hours.dow_0_close %]
68 [% PROCESS format_time time = hours.dow_1_open %]
69 [% PROCESS format_time time = hours.dow_1_close %]
73 [% PROCESS format_time time = hours.dow_2_open %]
74 [% PROCESS format_time time = hours.dow_2_close %]
78 [% PROCESS format_time time = hours.dow_3_open %]
79 [% PROCESS format_time time = hours.dow_3_close %]
83 [% PROCESS format_time time = hours.dow_4_open %]
84 [% PROCESS format_time time = hours.dow_4_close %]
88 [% PROCESS format_time time = hours.dow_5_open %]
89 [% PROCESS format_time time = hours.dow_5_close %]
93 [% PROCESS format_time time = hours.dow_6_open %]
94 [% PROCESS format_time time = hours.dow_6_close %]
102 INSERT INTO action_trigger.environment ( event_def, path) VALUES
103 ( 10, 'target_copy'),
104 ( 10, 'circ_lib.billing_address'),
105 ( 10, 'circ_lib.hours_of_operation'),