3 SELECT evergreen.upgrade_deps_block_check('1333', :eg_version);
5 INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
7 'eg.grid.acq.lineitem.history', 'gui', 'object',
9 'eg.grid.acq.lineitem.history',
10 'Grid Config: Acq Lineitem History',
14 'eg.grid.acq.po.history', 'gui', 'object',
16 'eg.grid.acq.po.history',
17 'Grid Config: Acq PO History',
21 'eg.grid.acq.po.edi_messages', 'gui', 'object',
23 'eg.grid.acq.po.edi_messages',
24 'Grid Config: Acq PO EDI Messages',
28 'acq.lineitem.page_size', 'gui', 'integer',
30 'acq.lineitem.page_size',
31 'ACQ Lineitem List Page Size',
35 'ui.staff.angular_acq_search.enabled', 'gui', 'bool',
37 'ui.staff.angular_acq_search.enabled',
38 'Enable Experimental ACQ Selection/Purchase Search Interface Links',
43 INSERT INTO config.print_template
44 (id, name, label, owner, active, locale, template)
46 5, 'lineitem_worksheet', 'Lineitem Worksheet', 1, TRUE, 'en-US',
49 USE money=format('%.2f');
51 SET li = template_data.lineitem;
54 FOREACH attr IN li.attributes;
55 IF attr.attr_type == 'lineitem_marc_attr_definition';
56 IF attr.attr_name == 'title';
57 title = attr.attr_value;
58 ELSIF attr.attr_name == 'author';
59 author = attr.attr_value;
66 <div class="summary" style='font-size:110%; font-weight:bold;'>
67 <div>Title: [% title.substr(0, 80) %][% IF title.length > 80 %]...[% END %]</div>
68 <div>Author: [% author %]</div>
69 <div>Item Count: [% li.lineitem_details.size %]</div>
70 <div>Lineitem ID: [% li.id %]</div>
71 <div>PO # : [% li.purchase_order %]</div>
72 <div>Est. Price: [% money(li.estimated_unit_price) %]</div>
73 <div>Open Holds: [% template_data.hold_count %]</div>
74 [% IF li.cancel_reason.label %]
75 <div>[% li.cancel_reason.label %]</div>
78 [% IF li.distribution_formulas.size > 0 %]
80 [% FOREACH form IN li.distribution_formulas; forms.push(form.formula.name); END %]
81 <div>Distribution Formulas: [% forms.join(',') %]</div>
84 [% IF li.lineitem_notes.size > 0 %]
87 [%- FOR note IN li.lineitem_notes -%]
89 [% IF note.alert_text %]
90 [% note.alert_text.code -%]
110 <th>Shelving Location</th>
113 <th>Delayed / Canceled</th>
117 <!-- set detail.owning_lib from fm object to org name -->
118 [% FOREACH detail IN li.lineitem_details %]
119 [% detail.owning_lib = detail.owning_lib.shortname %]
122 [% FOREACH detail IN li.lineitem_details.sort('owning_lib') %]
124 IF detail.eg_copy_id;
125 SET copy = detail.eg_copy_id;
126 SET cn_label = copy.call_number.label;
129 SET cn_label = detail.cn_label;
133 <!-- acq.lineitem_detail.id = [%- detail.id -%] -->
134 <td style='padding:5px;'>[% detail.owning_lib %]</td>
135 <td style='padding:5px;'>[% IF copy.barcode %]<span class="barcode" >[% detail.barcode %]</span>[% END %]</td>
136 <td style='padding:5px;'>[% IF cn_label %]<span class="cn_label" >[% cn_label %]</span>[% END %]</td>
137 <td style='padding:5px;'>[% IF detail.fund %]<span class="fund">[% detail.fund.code %] ([% detail.fund.year %])</span>[% END %]</td>
138 <td style='padding:5px;'>[% copy.location.name %]</td>
139 <td style='padding:5px;'>[% IF detail.recv_time %]<span class="recv_time">[% date.format(helpers.format_date(detail.recv_time, staff_org_timezone), '%x %r', locale) %]</span>[% END %]</td>
140 <td style='padding:5px;'>[% detail.note %]</td>
141 <td style='padding:5px;'>[% detail.cancel_reason.label %]</td>
150 INSERT INTO config.print_template
151 (id, name, label, owner, active, locale, template)
152 VALUES (6, 'purchase_order', 'Purchase Order', 1, TRUE, 'en-US',
158 USE money=format('%.2f');
159 SET po = template_data.po;
161 # find a lineitem attribute by name and optional type
163 FOR attr IN li.attributes;
164 IF attr.attr_name == attr_name;
165 IF !attr_type OR attr_type == attr.attr_type;
173 BLOCK get_li_order_attr_value;
174 FOR attr IN li.attributes;
175 IF attr.order_ident == 't';
183 <table style="width:100%">
188 <th>ISBN / Item # / Charge Type</th>
200 FOR li IN po.lineitems;
204 idval = PROCESS get_li_attr attr_name = 'vendor_num';
207 idval = PROCESS get_li_order_attr_value;
214 <td>[% PROCESS get_li_attr attr_name = 'title' %]</td>
215 <td>[% PROCESS get_li_attr attr_name = 'author' %]</td>
218 [% PROCESS get_li_attr attr_name = 'publisher' %],
219 [% PROCESS get_li_attr attr_name = 'pubdate' %]
221 <div>Edition: [% PROCESS get_li_attr attr_name = 'edition' %]</div>
224 SET count = li.lineitem_details.size;
225 SET price = li.estimated_unit_price;
226 SET itotal = (price * count);
229 <td>[% money(price) %]</td>
230 <td>[% money(litotal) %]</td>