3 INSERT INTO config.upgrade_log (version) VALUES ('0289'); -- phasefx
5 INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES (
6 'money.format.payment_receipt.email',
9 'money.format.payment_receipt.email',
10 'An email has been requested for a payment receipt.',
17 'money.format.payment_receipt.print',
20 'money.format.payment_receipt.print',
21 'A payment receipt needs to be formatted for printing.',
29 INSERT INTO action_trigger.event_definition (
44 'money.payment_receipt.email',
45 'money.format.payment_receipt.email',
52 [%- SET user = target.0.xact.usr -%]
53 To: [%- params.recipient_email || user.email %]
54 From: [%- params.sender_email || default_sender %]
55 Subject: Payment Receipt
57 [% FOR mp IN target %]
58 Payment ID: [% mp.id %]
59 Paid [% mp.amount %] via [% SWITCH mp.payment_type %]
60 [% CASE "cash_payment" %]cash
61 [% CASE "check_payment" %]check
62 [% CASE "credit_card_payment" %]credit card
63 [% CASE "credit_payment" %]credit
64 [% CASE "forgive_payment" %]forgiveness
65 [% CASE "goods_payment" %]goods
66 [% CASE "work_payment" %]work
67 [% END %] on [% mp.payment_ts %] for
68 [% IF mp.xact.circulation %]
69 [% helpers.get_copy_bib_basics(mp.xact.circulation.target_copy).title %]
80 'money.payment_receipt.print',
81 'money.format.payment_receipt.print',
88 [%- SET user = target.0.xact.usr -%]
90 <style> li { padding: 8px; margin 5px; }</style>
91 <div>[% date.format %]</div>
95 [% FOR mp IN target %]
97 Payment ID: [% mp.id %]
98 Paid [% mp.amount %] via [% SWITCH mp.payment_type %]
99 [% CASE "cash_payment" %]cash
100 [% CASE "check_payment" %]check
101 [% CASE "credit_card_payment" %]credit card
102 [% CASE "credit_payment" %]credit
103 [% CASE "forgive_payment" %]forgiveness
104 [% CASE "goods_payment" %]goods
105 [% CASE "work_payment" %]work
106 [% END %] on [% mp.payment_ts %] for
107 [% IF mp.xact.circulation %]
108 [% helpers.get_copy_bib_basics(mp.xact.circulation.target_copy).title %]
120 INSERT INTO action_trigger.environment (
123 ) VALUES -- for fleshing mp objects
126 ,( 29, 'xact.grocery' )
127 ,( 29, 'xact.circulation' )
128 ,( 29, 'xact.summary' )
131 ,( 30, 'xact.grocery' )
132 ,( 30, 'xact.circulation' )
133 ,( 30, 'xact.summary' )
136 -- DELETE FROM action_trigger.environment WHERE event_def IN (29,30); DELETE FROM action_trigger.event where event_def IN (29,30); DELETE FROM action_trigger.event_definition WHERE id IN (29,30); DELETE FROM action_trigger.hook WHERE key IN ('money.format.payment_receipt.email','money.format.payment_receipt.print'); DELETE FROM config.upgrade_log WHERE version = '0289'; -- from testing, this sql will remove these events, etc.