5 description => "Add ACCOUNTS_SUMMARY slip notice",
8 my ($dbh, $out) = @$args{qw(dbh out)};
10 my $slip_content = <<~'END_CONTENT';
15 [% PROCESS 'accounts.inc' %]
17 [% IF ( Koha.Preference('LibraryName') ) %]
19 <th colspan='4' class='centerednames'>
20 <h1>[% Koha.Preference('LibraryName') | html %]</h1>
26 <th colspan='4' class='centerednames'>
27 <h2>[% Branches.GetName( borrower.branchcode ) | html %]</h2>
32 <th colspan='4' class='centerednames'>
33 <h3>Outstanding accounts</h3>
38 <th colspan='4' class='centerednames'>
42 [% IF borrower.account.outstanding_debits.total_outstanding %]
49 [% FOREACH debit IN borrower.account.outstanding_debits %]
51 <td>[% debit.date | $KohaDates %]</td>
53 [% PROCESS account_type_description account=debit %]
54 [%- IF debit.description %], [% debit.description | html %][% END %]
56 <td class='debit'>[% debit.amount | $Price %]</td>
57 <td class='debit'>[% debit.amountoutstanding | $Price %]</td>
62 <td colspan='4'>There are no outstanding debts on your account</td>
67 <th colspan='4' class='centerednames'>
71 [% IF borrower.account.outstanding_credits.total_outstanding %]
78 [% FOREACH credit IN borrower.account.outstanding_credits %]
80 <td>[% credit.date | $KohaDates %]</td>
82 [% PROCESS account_type_description account=credit %]
83 [%- IF credit.description %], [% credit.description | html %][% END %]
85 <td class='credit'>[% credit.amount *-1 | $Price %]</td>
86 <td class='credit'>[% credit.amountoutstanding *-1 | $Price %]</td>
91 <td colspan='4'>There are no outstanding credits on your account</td>
98 [% IF borrower.account.balance < 0 %]
99 Total credit as of [% today | $KohaDates %]:
101 Total outstanding dues as of [% today | $KohaDates %]:
104 [% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% borrower.account.balance * -1 | $Price %]</td>
105 [% ELSE %]<td class='debit'>[% borrower.account.balance | $Price %]</td>[% END %]
112 INSERT IGNORE INTO letter ( module, code, branchcode, name, is_html, title, content, message_transport_type, lang)
113 VALUES ( 'members', 'ACCOUNTS_SUMMARY', '', 'Account balance slip', 1, 'Account summary for [% borrower.firstname %] [% borrower.surname %]', "$slip_content", 'print', 'default' )
116 say $out "Added new letter 'ACCOUNTS_SUMMARY' (print)";