1 --Upgrade Script for 2.9.2 to 2.9.3
2 \set eg_version '''2.9.3'''
4 INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.9.3', :eg_version);
6 SELECT evergreen.upgrade_deps_block_check('0959', :eg_version);
8 CREATE OR REPLACE VIEW money.transaction_billing_summary AS
14 FROM money.materialized_billable_xact_summary;
17 SELECT evergreen.upgrade_deps_block_check('0971', :eg_version);
19 CREATE OR REPLACE FUNCTION evergreen.protect_reserved_rows_from_delete() RETURNS trigger AS $protect_reserved$
21 IF OLD.id < TG_ARGV[0]::INT THEN
22 RAISE EXCEPTION 'Cannot delete row with reserved ID %', OLD.id;
30 SELECT evergreen.upgrade_deps_block_check('0972', :eg_version); -- jstompro/gmcharlt
32 -- LP#1550495 - Add Baker&Taylor EDI Quantity Cancel Code
33 -- Insert EDI Cancel Reason 85 (1200 + 85 = 1285) if it doesn't already exist
34 INSERT INTO acq.cancel_reason
35 (org_unit, keep_debits, id, label, description)
38 oils_i18n_gettext(1285, 'Canceled: By Vendor', 'acqcr', 'label'),
39 oils_i18n_gettext(1285, 'Line item canceled by vendor', 'acqcr', 'description')
41 SELECT 1 FROM acq.cancel_reason where id=(85+1200)
46 SELECT evergreen.upgrade_deps_block_check('0973', :eg_version); -- tmccanna/gmcharlt
48 UPDATE action_trigger.event_definition SET template =
51 [%- SET user = target -%]
53 <style> li { padding: 8px; margin 5px; }</style>
54 <div>[% date.format %]</div>
57 [% user.family_name %], [% user.first_given_name %]
59 [% FOR xact IN user.open_billable_transactions_summary %]
60 [% IF xact.balance_owed > 0 %]
63 [% IF xact.xact_type == 'circulation' %]
64 [%- helpers.get_copy_bib_basics(xact.circulation.target_copy).title -%]
66 [%- xact.last_billing_type -%]
69 <div>Total Billed: [% xact.total_owed %]</div>
70 <div>Total Paid: [% xact.total_paid %]</div>
71 <div>Balance Owed : [% xact.balance_owed %]</div>
81 [%- SET user = target -%]
83 <style> li { padding: 8px; margin 5px; }</style>
84 <div>[% date.format %]</div>
87 [% user.family_name %], [% user.first_given_name %]
89 [% FOR xact IN user.open_billable_transactions_summary %]
92 [% IF xact.xact_type == 'circulation' %]
93 [%- helpers.get_copy_bib_basics(xact.circulation.target_copy).title -%]
95 [%- xact.last_billing_type -%]
98 <div>Total Billed: [% xact.total_owed %]</div>
99 <div>Total Paid: [% xact.total_paid %]</div>
100 <div>Balance Owed : [% xact.balance_owed %]</div>
109 SELECT evergreen.upgrade_deps_block_check('0974', :eg_version); -- tmccanna/gmcharlt
111 UPDATE action_trigger.event_definition SET template =
114 [%- SET user = target.0.usr -%]
116 <style> li { padding: 8px; margin 5px; }</style>
117 <div>[% date.format %]</div>
120 [% user.family_name %], [% user.first_given_name %]
123 [% FOR hold IN target %]
125 SET idx = loop.count - 1;
126 SET udata = user_data.$idx;
129 <div>Title: [% udata.item_title %]</div>
130 <div>Author: [% udata.item_author %]</div>
131 <div>Pickup Location: [% udata.pickup_lib %]</b></div>
133 [%- IF udata.ready -%]
136 #[% udata.queue_position %] of
137 [% udata.potential_copies %] copies.
149 [%- SET user = target.0.usr -%]
151 <style> li { padding: 8px; margin 5px; }</style>
152 <div>[% date.format %]</div>
155 [% user.family_name %], [% user.first_given_name %]
157 [% FOR hold IN target %]
159 SET idx = loop.count - 1;
160 SET udata = user_data.$idx
163 <div>Title: [% hold.bib_rec.bib_record.simple_record.title %]</div>
164 <div>Author: [% hold.bib_rec.bib_record.simple_record.author %]</div>
165 <div>Pickup Location: [% hold.pickup_lib.name %]</div>
167 [%- IF udata.ready -%]
170 #[% udata.queue_position %] of [% udata.potential_copies %] copies.