3 INSERT INTO config.upgrade_log (version) VALUES ('0262');
5 UPDATE action_trigger.event_definition SET template =
7 [%# start JEDI document -%]
8 [%- BLOCK big_block -%]
10 "po_number":[% target.id %],
11 "date":"[% date.format(date.now, '%Y%m%d') %]",
13 {"id":"[% target.ordering_agency.mailing_address.san %]",
14 "reference":{"API":"[% target.ordering_agency.mailing_address.san %]"}}
17 "[% target.provider.san %]", // [% target.provider.name %] ([% target.provider.id %])
18 {"id-qualifier":"91", "reference":{"IA":"[% target.provider.id %]"}, "id":"[% target.provider.san %]"}
20 "currency":"[% target.provider.currency_type %]",
22 [% FOR li IN target.lineitems %]
25 {"id-qualifier":"SA","id":"[% li.id %]"},
26 {"id-qualifier":"IB","id":"[% helpers.get_li_attr('isbn', li.attributes) %]"}
28 "price":[% li.estimated_unit_price || '0.00' %],
30 {"BTI":"[% helpers.get_li_attr('title', '', li.attributes) %]"},
31 {"BPU":"[% helpers.get_li_attr('publisher', '', li.attributes) %]"},
32 {"BPD":"[% helpers.get_li_attr('pubdate', '', li.attributes) %]"},
33 {"BPH":"[% helpers.get_li_attr('pagination','', li.attributes) %]"}
35 "quantity":[% li.lineitem_details.size %]
36 [%-# TODO: lineitem details (later) -%]
37 }[% UNLESS loop.last %],[% END -%]
40 "line_items":[% target.lineitems.size %]
43 [% tempo = PROCESS big_block; helpers.escape_json(tempo) %]