]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0108.data.selfcheck-itemsout-receipt-template.sql
LP#1117808: Stamping upgrade scripts for extend use of merge profiles
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0108.data.selfcheck-itemsout-receipt-template.sql
1 BEGIN;
2
3 INSERT INTO config.upgrade_log (version) VALUES ('0108');
4
5 INSERT INTO action_trigger.hook (key, core_type, description, passive) 
6     VALUES (
7         'format.selfcheck.items_out',
8         'circ',
9         'Formats items out for self-checkout receipt',
10         TRUE
11     );
12
13 INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, group_field, granularity, template )
14     VALUES (
15         11,
16         TRUE,
17         1,
18         'Self-Checkout Items Out Receipt',
19         'format.selfcheck.items_out',
20         'NOOP_True',
21         'ProcessTemplate',
22         'usr',
23         'print-on-demand',
24 $$
25 [%- USE date -%]
26 [%- SET user = target.0.usr -%]
27 <div>
28     <style> li { padding: 8px; margin 5px; }</style>
29     <div>[% date.format %]</div>
30     <br/>
31
32     [% user.family_name %], [% user.first_given_name %]
33     <ol>
34     [% FOR circ IN target %]
35         <li>
36             <div>[% helpers.get_copy_bib_basics(circ.target_copy.id).title %]</div>
37             <div>Barcode: [% circ.target_copy.barcode %]</div>
38             <div>Due Date: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %]</div>
39         </li>
40     [% END %]
41     </ol>
42 </div>
43 $$
44 );
45
46
47 INSERT INTO action_trigger.environment ( event_def, path) VALUES
48     ( 11, 'target_copy'),
49     ( 11, 'circ_lib.billing_address'),
50     ( 11, 'circ_lib.hours_of_operation'),
51     ( 11, 'usr');
52
53 COMMIT;