BEGIN; SELECT evergreen.upgrade_deps_block_check('0973', :eg_version); -- tmccanna/gmcharlt UPDATE action_trigger.event_definition SET template = $$ [%- USE date -%] [%- SET user = target -%]
[% date.format %]

Fines for:
[% user.family_name %], [% user.first_given_name %]
    [% FOR xact IN user.open_billable_transactions_summary %] [% IF xact.balance_owed > 0 %]
  1. Details: [% IF xact.xact_type == 'circulation' %] [%- helpers.get_copy_bib_basics(xact.circulation.target_copy).title -%] [% ELSE %] [%- xact.last_billing_type -%] [% END %]
    Total Billed: [% xact.total_owed %]
    Total Paid: [% xact.total_paid %]
    Balance Owed : [% xact.balance_owed %]
  2. [% END %] [% END %]
$$ WHERE id=13 AND template = $$ [%- USE date -%] [%- SET user = target -%]
[% date.format %]

[% user.family_name %], [% user.first_given_name %]
    [% FOR xact IN user.open_billable_transactions_summary %]
  1. Details: [% IF xact.xact_type == 'circulation' %] [%- helpers.get_copy_bib_basics(xact.circulation.target_copy).title -%] [% ELSE %] [%- xact.last_billing_type -%] [% END %]
    Total Billed: [% xact.total_owed %]
    Total Paid: [% xact.total_paid %]
    Balance Owed : [% xact.balance_owed %]
  2. [% END %]
$$ ; COMMIT;