3 INSERT INTO config.upgrade_log (version) VALUES ('0246');
5 UPDATE action_trigger.event_definition SET id=23, template =
7 [%# start JEDI document -%]
8 [%- BLOCK big_block -%]
10 "recipient":"[% target.provider.san %]",
11 "sender":"[% target.ordering_agency.mailing_address.san %]",
14 "po_number":[% target.id %],
15 "date":"[% date.format(date.now, '%Y%m%d') %]",
17 [%- IF target.provider.edi_default.vendcode -%]
18 "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]",
21 "id":"[% target.ordering_agency.mailing_address.san %]"
25 [%- # target.provider.name (target.provider.id) -%]
26 "[% target.provider.san %]",
27 {"id-qualifier": 92, "id":"[% target.provider.id %]"}
29 "currency":"[% target.provider.currency_type %]",
31 [% FOR li IN target.lineitems %]
34 {"id-qualifier":"SA","id":"[% li.id %]"},
35 {"id-qualifier":"IB","id":"[% helpers.get_li_attr('isbn', li.attributes) %]"}
37 "price":[% helpers.get_li_attr('estimated_price', '', li.attributes) %],
39 {"BTI":"[% helpers.get_li_attr('title', '', li.attributes) %]"},
40 {"BPU":"[% helpers.get_li_attr('publisher', '', li.attributes) %]"},
41 {"BPD":"[% helpers.get_li_attr('pubdate', '', li.attributes) %]"},
42 {"BPH":"[% helpers.get_li_attr('pagination','', li.attributes) %]"}
44 "quantity":[% li.lineitem_details.size %]
45 [%-# TODO: lineitem details (later) -%]
46 }[% UNLESS loop.last %],[% END %]
49 "line_items":[% target.lineitems.size %]
50 }] [% # close ORDERS array %]
51 }] [% # close body array %]
54 [% tempo = PROCESS big_block; helpers.escape_json(tempo) %]
56 WHERE name='PO JEDI' or id=23; -- bring updated DB in line w/ baseline DB
57 -- nobody but devs will have the old 100+ id, and only atz put it in use
58 INSERT INTO action_trigger.environment (event_def, path) VALUES
59 (23, 'provider.edi_default');
61 -- Hope they haven't changed the name...