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 %]
[% FOR entry IN invoice.entries %]
-
[% IF entry.lineitem %]
Title: [% helpers.get_li_attr(
"title", "", entry.lineitem.attributes
) %]
Author: [% helpers.get_li_attr(
"author", "", entry.lineitem.attributes
) %]
[% END %]
[% IF entry.purchase_order %]
(PO: [% entry.purchase_order.name %])
[% END %]
Invoice item count: [% entry.inv_item_count %]
[% IF entry.phys_item_count %]
/ Physical item count: [% entry.phys_item_count %]
[% END %]
[% IF entry.cost_billed %]
Cost billed: [% entry.cost_billed %]
[% IF entry.billed_per_item %](per item)[% END %]
[% END %]
[% IF entry.actual_cost %]
Actual cost: [% entry.actual_cost %]
[% END %]
[% IF entry.amount_paid %]
Amount paid: [% entry.amount_paid %]
[% END %]
[% IF entry.note %]Note: [% entry.note %][% END %]
[% END %]
[% FOR item IN invoice.items %]
-
[% IF item.inv_item_type %]
Item Type: [% item.inv_item_type %]
[% END %]
[% IF item.title %]Title/Description:
[% item.title %]
[% END %]
[% IF item.author %]Author: [% item.author %]
[% END %]
[% IF item.purchase_order %]PO: [% item.purchase_order %]
[% END %]
[% IF item.note %]Note: [% item.note %]
[% END %]
[% IF item.cost_billed %]
Cost billed: [% item.cost_billed %]
[% END %]
[% IF item.actual_cost %]
Actual cost: [% item.actual_cost %]
[% END %]
[% IF item.amount_paid %]
Amount paid: [% item.amount_paid %]
[% END %]
[% END %]
Amounts spent per fund:
[% FOR blob IN user_data %]
[% blob.fund.code %] ([% blob.fund.year %]): |
$[% blob.total %] |
[% END %]
[% END %]$$ WHERE id = 22;
COMMIT;