-- Evergreen DB patch 0642.data.acq-worksheet-hold-count.sql BEGIN; -- check whether patch can be applied SELECT evergreen.upgrade_deps_block_check('0642', :eg_version); UPDATE action_trigger.event_definition SET template = $$ [%- USE date -%] [%- SET li = target; -%]
Title: [% helpers.get_li_attr("title", "", li.attributes) %]
Author: [% helpers.get_li_attr("author", "", li.attributes) %]
Item Count: [% li.lineitem_details.size %]
Lineitem ID: [% li.id %]
Open Holds: [% helpers.bre_open_hold_count(li.eg_bib_id) %]
[% IF li.distribution_formulas.size > 0 %] [% SET forms = [] %] [% FOREACH form IN li.distribution_formulas; forms.push(form.formula.name); END %]
Distribution Formulas: [% forms.join(',') %]
[% END %] [% IF li.lineitem_notes.size > 0 %] Lineitem Notes: [% END %]

[% FOREACH detail IN li.lineitem_details.sort('owning_lib') %] [% IF detail.eg_copy_id; SET copy = detail.eg_copy_id; SET cn_label = copy.call_number.label; ELSE; SET copy = detail; SET cn_label = detail.cn_label; END %] [% END %]
Branch Barcode Call Number Fund Shelving Location Recd. Notes
[% detail.owning_lib.shortname %] [% IF copy.barcode %][% detail.barcode %][% END %] [% IF cn_label %][% cn_label %][% END %] [% IF detail.fund %][% detail.fund.code %] ([% detail.fund.year %])[% END %] [% copy.location.name %] [% IF detail.recv_time %][% detail.recv_time %][% END %] [% detail.note %]
$$ WHERE id = 14; COMMIT;