Bug 22521: Update UI to use accountlines.status
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / moremember-print.tt
index 44f6a2b..4c722d2 100644 (file)
@@ -1,29 +1,36 @@
 [% USE Koha %]
 [% USE Branches %]
 [% USE KohaDates %]
+[% USE Price %]
+[% USE ItemTypes %]
+[% SET footerjs = 1 %]
+
+[% PROCESS 'accounts.inc' %]
+
 [% INCLUDE 'doc-head-open.inc' %]
-    <title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title>
-    <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="[% interface %]/[% theme %]/css/print.css" />
-    [% INCLUDE 'slip-print.inc' #printThenClose %]
+    <title>Summary for [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</title>
+    [% INCLUDE 'doc-head-close.inc' %]
 </head>
-<body id="pat_moremember-print" class="pat" onload="printThenClose();">
+
+<body id="pat_moremember-print" class="pat">
     <div id="main">
-        <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber %]">Account summary: [% firstname %] [% surname %] ([% cardnumber %])</a></h3>
+        <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% patron.cardnumber | uri %]">Account summary: [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></h3>
 
         <ul>
-            <li>[% address %]<br />[% address2 %]</li>
-            <li>[% city %], [% zipcode %]</li>
-            <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 ) %]
-                <li>[% emailpro %]</li>
+            [% IF Koha.Preference( 'AddressFormat' ) %]
+                [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
+            [% ELSE %]
+                [% INCLUDE 'member-display-address-style-us.inc' %]
             [% END %]
-            <li>Registration date: [% dateenrolled | $KohaDates %]</li>
-            <li>Expiration date: [% dateexpiry | $KohaDates %]</li>
-            <li>Library: [% Branches.GetName( branchcode ) %]</li>
-            <li>Category: [% description %]</li>
+            <li>[% IF ( patron.phone ) %][% patron.phone | html %][% ELSE %](no phone number on file)[% END %]</li>
+            <li>[% IF ( patron.email ) %][% patron.email | html %][% ELSE %](no primary email on file)[% END %]</li>
+            [% IF ( patron.emailpro ) %]
+                <li>[% patron.emailpro | html %]</li>
+            [% END %]
+            <li>Registration date: [% patron.dateenrolled | $KohaDates %]</li>
+            <li>Expiration date: [% patron.dateexpiry | $KohaDates %]</li>
+            <li>Library: [% Branches.GetName( patron.branchcode ) | html %]</li>
+            <li>Category: [% patron.category.description | html %]</li>
         </ul>
 
         [% IF ( issues ) %]
                 [% FOREACH issue IN issues %]
                     [% IF ( issue.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
                         <td>
-                            [% issue.title |html %]
-                            <a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issue.itemnumber %]&amp;biblionumber=[% issue.biblionumber %]&amp;bi=[% issue.biblioitemnumber %]"></a>
+                            [% issue.title | html %]
+                            <a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issue.itemnumber | uri %]&amp;biblionumber=[% issue.biblionumber | uri %]&amp;bi=[% issue.biblioitemnumber | uri %]"></a>
                         </td>
-                        <td>[% issue.author %]</td>
-                        <td>[% issue.itemcallnumber %]</td>
-                        <td>[% issue.itemtype_description %]</td>
-                        <td>[% issue.date_due | $KohaDates as_due_date => 1 %]</td>
-                        <td>[% issue.barcode %]</td>
-                        <td>[% issue.charge %]</td>
-                        <td>[% issue.replacementprice %]</td>
+                        <td>[% issue.author | html %]</td>
+                        <td>[% issue.itemcallnumber | html %]</td>
+                        <td>[% ItemTypes.GetDescription( issue.itype ) | html %]</td>
+                        <td>[% issue.date_due | $KohaDates  as_due_date => 1 %]</td>
+                        <td>[% issue.barcode | html %]</td>
+                        <td>[% issue.charge | $Price %]</td>
+                        <td>[% issue.replacementprice | $Price %]</td>
                         <td>[% IF ( issue.overdue ) %]Overdue![% ELSE %]&nbsp;[% END %]</td>
                     </tr>
                 [% END %]
 
             <tr>
                 <td colspan="6" style="text-align: right; font-weight:bold;">Totals:</td>
-                <td>[% totaldue %]</td>
-                <td>[% totalprice %]</td>
+                <td>[% totaldue | $Price %]</td>
+                <td>[% totalprice | $Price %]</td>
                 <td colspan="3">&nbsp;</td>
             </tr>
         </table>
 
             [% FOREACH reserve IN reserves %]
                 <tr>
-                    <td>[% reserve.title %]</td>
-                    <td>[% reserve.author %]</td>
+                    <td>[% reserve.title | html %]</td>
+                    <td>[% reserve.author | html %]</td>
                     <td>[% reserve.reservedate | $KohaDates %]</td>
                     <td>[% reserve.expirationdate | $KohaDates %]</td>
-                    <td>[% reserve.waiting_at %]</td>
+                    <td>[% reserve.waiting_at | html %]</td>
                 </tr>
             [% END %]
         </table>
     [% END %]
-
-    [% IF ( accounts && ( totaldue != '0.00' ) ) %]
-        <table>
+    [% IF accounts && totaldue != 0 %]
+        <table id="table_account_fines">
             <caption>Account fines and payments</caption>
-            <tr>
-                <th>Description of charges</th>
-                <th>Date</th>
-                <th>Amount</th>
-                <th>Outstanding</th>
-            </tr>
+            <thead>
+              <tr>
+                  <th>Date</th>
+                  <th>Description of charges</th>
+                  <th>Note</th>
+                  <th>Amount</th>
+                  <th>Outstanding</th>
+                </tr>
+            </thead>
 
             [% 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>
+                  <td>[% account.date | $KohaDates %]</td>
+                  <td>
+                      [% PROCESS account_type_description account=account %]
+                      [%- IF account.payment_type %]
+                          , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %]
+                      [% END %]
+                      [%- IF account.description %]
+                          , [% account.description | html %]
+                      [% END %]
+                      &nbsp;
+                      [% IF ( account.itemnumber AND account.accounttype != 'OVERDUE' ) %]
+                          <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&amp;itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a>
+                      [% END %]
+                  </td>
+                  <td>
+                      [% account.note | html_line_break %]
+                  </td>
+                  [% IF ( account.amount < 0 ) %]
+                      <td class="credit" style="text-align: right;">
+                  [% ELSE %]
+                      <td class="debit" style="text-align: right;">
+                  [% END %][% account.amount | $Price %]
+                      </td>
+                  [% IF ( account.amountoutstanding < 0 ) %]
+                      <td class="credit" style="text-align: right;">
+                  [% ELSE %]
+                      <td class="debit" style="text-align: right;">
+                  [% END %]
+                          [% account.amountoutstanding | $Price %]
+                      </td>
                 </tr>
             [% END %]
 
             <tfoot>
                 <tr>
-                    <td colspan="3">Total due</td>
-                    <td colspan="2">[% totaldue %]</td>
+                    <td colspan="4">Total due</td>
+                    <td colspan="2" style="text-align:right;">[% totaldue | $Price %]</td>
                 </tr>
             </tfoot>
         </table>
     [% END %]
 
+[% MACRO jsinclude BLOCK %]
+    [% INCLUDE 'slip-print.inc' #printThenClose %]
+[% END %]
+
 [% INCLUDE 'intranet-bottom.inc' %]