From d68de75a65f805d7d68758b269648a639a7b093e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 28 Jun 2017 14:15:19 -0400 Subject: [PATCH] JBAS-1728 SCKO Fines receipt xacts with >0 balance Only list open transactions with non-zero balances, specifically those with positive balances. Signed-off-by: Bill Erickson --- .../sql/schema/deploy/selfcheck-email-receipts.sql | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/KCLS/sql/schema/deploy/selfcheck-email-receipts.sql b/KCLS/sql/schema/deploy/selfcheck-email-receipts.sql index 58965b6e19..930480416e 100644 --- a/KCLS/sql/schema/deploy/selfcheck-email-receipts.sql +++ b/KCLS/sql/schema/deploy/selfcheck-email-receipts.sql @@ -72,6 +72,37 @@ INSERT INTO action_trigger.environment (event_def, path) VALUES END IF; END $$; + +UPDATE action_trigger.event_definition SET template = +$T$ +[%- USE date -%] +[%- SET user = target -%] +
+ +
[% date.format(date.now, '%m/%d/%Y') %]
+
+ [% user.first_given_name %] +
    + [% FOR xact IN user.open_billable_transactions_summary %] + [% NEXT 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 %] +
+
+$T$ +WHERE hook = 'format.selfcheck.fines'; + COMMIT; -- 2.11.0