Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt
Jonathan Druart 0ab22e1c7c Bug 18789: Send Koha::Patron object to the templates
In order to simplify and make uniform the code, the controller scripts send
a Koha::Patron object to the templates instead of all attributes of a patron.

That will make the code much more easier to maintain and will be less
error-prone.

The variable "patron" sent to the templates is supposed to represent the
patron the librarian is editing the detail.

In the members module and some scripts of the circulation module, the
patron's detail are sent one by one to the template. That leads to
frustration from developpers (making sure everything is passed from all
scripts) and to regression (we got tone of bugs in the last year because
of this way to do).
With this patch set it will be easy access patron's detail, passing only
1 variable from the controllers.

Test plan:
Play with the patron and circulation module and make sur the detail of
the patron you are editing/seeing info are correctly displayed.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00

84 lines
2.3 KiB
Text

[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Print receipt for [% patron.cardnumber %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/printreceiptinvoice_[% KOHA_VERSION %].css" />
[% INCLUDE 'blocking_errors.inc' %]
</head>
<body id="pat_printfeercpt" class="pat">
<div id="receipt">
<!-- The table with the account items -->
<table>
[% IF ( LibraryName ) %]
<tr>
<th colspan=4 class="centerednames">
<h3>[% LibraryName %]</h3>
</th>
</tr>
[% END %]
<tr>
<th colspan=4 class="centerednames">
<h2><u>Fee receipt</u></h2>
</th>
</tr>
<tr>
<th colspan=4 class="centerednames">
<h2>[% Branches.GetName( patron.branchcode ) %]</h2>
</th>
</tr>
<tr>
<th colspan=4 >
Received with thanks from [% patron.firstname %] [% patron.surname %] <br />
Card number : [% patron.cardnumber %]<br />
</th>
</tr>
<tr>
<th>Date</th>
<th>Description of charges</th>
<th>Note</th>
<th>Amount</th>
</tr>
[% FOREACH account IN accounts %]
<tr class="highlight">
<td>[% account.date | $KohaDates %]</td>
<td>
[% SWITCH account.accounttype %]
[% CASE 'Pay' %]Payment, thanks
[% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
[% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
[% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
[% CASE 'N' %]New Card
[% CASE 'F' %]Fine
[% CASE 'A' %]Account management fee
[% CASE 'M' %]Sundry
[% CASE 'L' %]Lost Item
[% CASE 'W' %]Writeoff
[% CASE %][% account.accounttype %]
[%- END -%]
[%- IF account.description %], [% account.description %][% END %]
</td>
<td>[% account.note %]</td>
[% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td>
</tr>
[% END %]
<tfoot>
<tr>
<td colspan="3">Total outstanding dues as on date : </td>
[% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total %]</td>
</tr>
</tfoot>
</table>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'slip-print.inc' #printThenClose %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]