]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0973.data.selfcheck_fines_printing.sql
LP#1248734: (follow-up) add new indexes to schema update script
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0973.data.selfcheck_fines_printing.sql
1 BEGIN;
2
3 SELECT evergreen.upgrade_deps_block_check('0973', :eg_version); -- tmccanna/gmcharlt
4
5 UPDATE action_trigger.event_definition SET template = 
6 $$
7 [%- USE date -%]
8 [%- SET user = target -%]
9 <div>
10     <style> li { padding: 8px; margin 5px; }</style>
11     <div>[% date.format %]</div>
12     <br/>   
13         Fines for:<br/>
14     [% user.family_name %], [% user.first_given_name %]
15     <ol>
16     [% FOR xact IN user.open_billable_transactions_summary %]
17         [% IF xact.balance_owed > 0 %]
18             <li>
19                 <div>Details: 
20                     [% IF xact.xact_type == 'circulation' %]
21                         [%- helpers.get_copy_bib_basics(xact.circulation.target_copy).title -%]
22                     [% ELSE %]
23                         [%- xact.last_billing_type -%]
24                     [% END %]
25                 </div>
26                 <div>Total Billed: [% xact.total_owed %]</div>
27                 <div>Total Paid: [% xact.total_paid %]</div>
28                 <div>Balance Owed : [% xact.balance_owed %]</div>
29             </li>
30         [% END %]
31     [% END %]
32     </ol>
33 </div>
34 $$ WHERE id=13
35 AND template = 
36 $$
37 [%- USE date -%]
38 [%- SET user = target -%]
39 <div>
40     <style> li { padding: 8px; margin 5px; }</style>
41     <div>[% date.format %]</div>
42     <br/>
43
44     [% user.family_name %], [% user.first_given_name %]
45     <ol>
46     [% FOR xact IN user.open_billable_transactions_summary %]
47         <li>
48             <div>Details: 
49                 [% IF xact.xact_type == 'circulation' %]
50                     [%- helpers.get_copy_bib_basics(xact.circulation.target_copy).title -%]
51                 [% ELSE %]
52                     [%- xact.last_billing_type -%]
53                 [% END %]
54             </div>
55             <div>Total Billed: [% xact.total_owed %]</div>
56             <div>Total Paid: [% xact.total_paid %]</div>
57             <div>Balance Owed : [% xact.balance_owed %]</div>
58         </li>
59     [% END %]
60     </ol>
61 </div>
62 $$
63 ;
64
65 COMMIT;