Bug 17100: Do not display payments if patron has nothing to pay
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / moremember-print.tt
index 3c2fe04..93b59d4 100644 (file)
@@ -1,11 +1,13 @@
 [% USE Koha %]
 [% USE Branches %]
 [% USE KohaDates %]
+[% USE Price %]
 [% INCLUDE 'doc-head-open.inc' %]
     <title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title>
+    [% INCLUDE 'doc-head-close.inc' %]
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
-    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/print.css" />
+    <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/print.css" />
     [% INCLUDE 'slip-print.inc' #printThenClose %]
 </head>
 <body id="pat_moremember-print" class="pat" onload="printThenClose();">
         <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber %]">Account summary: [% firstname %] [% surname %] ([% cardnumber %])</a></h3>
 
         <ul>
-            <li>[% address %]<br />[% address2 %]</li>
-            <li>[% city %], [% zipcode %]</li>
+            [% IF Koha.Preference( 'AddressFormat' ) %]
+                [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
+            [% ELSE %]
+                [% INCLUDE 'member-display-address-style-us.inc' %]
+            [% END %]
             <li>[% IF ( phone ) %][% phone %][% ELSE %](no phone number on file)[% END %]</li>
             <li>[% IF ( email ) %][% email %][% ELSE %](no primary email on file)[% END %]</li>
             [% IF ( emailpro ) %]
         </table>
     [% END %]
 
-        [% IF ( reserves ) %]
-            <table>
-                <caption>Pending holds</caption>
+    [% IF ( reserves ) %]
+        <table>
+            <caption>Pending holds</caption>
+            <tr>
+                <th>Title</th>
+                <th>Author</th>
+                <th>Placed on</th>
+                <th>Expires on</th>
+                <th>Pick up location</th>
+            </tr>
+
+            [% FOREACH reserve IN reserves %]
                 <tr>
-                    <th>Title</th>
-                    <th>Author</th>
-                    <th>Placed on</th>
-                    <th>Expires on</th>
-                    <th>Pick up location</th>
+                    <td>[% reserve.title %]</td>
+                    <td>[% reserve.author %]</td>
+                    <td>[% reserve.reservedate | $KohaDates %]</td>
+                    <td>[% reserve.expirationdate | $KohaDates %]</td>
+                    <td>[% reserve.waiting_at %]</td>
                 </tr>
-
-                [% FOREACH reserve IN reserves %]
-                    <tr>
-                        <td>[% reserve.title %]</td>
-                        <td>[% reserve.author %]</td>
-                        <td>[% reserve.reservedate | $KohaDates %]</td>
-                        <td>[% reserve.expirationdate | $KohaDates %]</td>
-                        <td>[% reserve.waiting_at %]</td>
-                    </tr>
-                [% END %]
-    </table>
+            [% END %]
+        </table>
     [% END %]
-
-    [% IF ( accounts && ( totaldue != '0.00' ) ) %]
+    [% IF accounts && ( totaldue < 0 || totaldue > 0 ) %]
         <table>
             <caption>Account fines and payments</caption>
             <tr>
             </tr>
 
             [% FOREACH account IN accounts %]
-                [% NEXT IF account.amountoutstanding == '0.00' %]
-                <tr>
-                    <td>
-                        [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">[% END %]
-                        [% account.description %]&nbsp;[% IF ( account.printtitle ) %] [% account.title |html %][% END %]
-                        [% IF ( account.itemnumber ) %]</a>[% END %]
-                    </td>
-                    <td>[% account.date | $KohaDates %]</td>
-                    <td>[% account.amount %]</td>
-                    <td>[% account.amountoutstanding %]</td>
-                </tr>
+                [% IF ( account.amountoutstanding < 0 ) || ( account.amountoutstanding > 0 ) %]
+                    <tr>
+                        <td>
+                            [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">[% END %]
+                            [% account.description %]&nbsp;[% IF ( account.printtitle ) %] [% account.title |html %][% END %]
+                            [% IF ( account.itemnumber ) %]</a>[% END %]
+                        </td>
+                        <td>[% account.date | $KohaDates %]</td>
+                        <td style="text-align:right;">[% account.amount | $Price %]</td>
+                        <td style="text-align:right;">[% account.amountoutstanding | $Price %]</td>
+                    </tr>
+                [% END %]
             [% END %]
 
             <tfoot>
                 <tr>
                     <td colspan="3">Total due</td>
-                    <td colspan="2">[% totaldue %]</td>
+                    <td colspan="2" style="text-align:right;">[% totaldue | $Price %]</td>
                 </tr>
             </tfoot>
         </table>