BEGIN; INSERT INTO config.upgrade_log VALUES ('0457'); UPDATE action_trigger.event_definition SET template = $$[% FILTER collapse %] [%- SET invoice = target -%]

Invoice

No. [% invoice.inv_ident %] [% IF invoice.inv_type %] / Type:[% invoice.inv_type %] [% END %]
[% BLOCK ent_with_address %]
[% ent_label %]: [% ent.name %] ([% ent.code %])
[% IF ent.addresses.0 %] [% SET addr = ent.addresses.0 %] [% addr.street1 %]
[% IF addr.street2 %][% addr.street2 %]
[% END %] [% addr.city %], [% IF addr.county %] [% addr.county %], [% END %] [% IF addr.state %] [% addr.state %] [% END %] [% IF addr.post_code %][% addr.post_code %][% END %]
[% IF addr.country %] [% addr.country %] [% END %] [% END %]

[% IF ent.phone %] Phone: [% ent.phone %]
[% END %] [% IF ent.fax_phone %] Fax: [% ent.fax_phone %]
[% END %] [% IF ent.url %] URL: [% ent.url %]
[% END %] [% IF ent.email %] E-mail: [% ent.email %] [% END %]

[% END %] [% INCLUDE ent_with_address ent = invoice.provider ent_label = "Provider" %] [% INCLUDE ent_with_address ent = invoice.shipper ent_label = "Shipper" %]
Receiver
[% invoice.receiver.name %] ([% invoice.receiver.shortname %])
Received
[% helpers.format_date(invoice.recv_date) %] by [% invoice.recv_method %]
[% IF invoice.note %]
Note
[% invoice.note %]
[% END %]
Amounts spent per fund: [% FOR blob IN user_data %] [% END %]
[% blob.fund.code %] ([% blob.fund.year %]): $[% blob.total %]
[% END %]$$ WHERE id = 22; COMMIT;