Bug 19489: Detailed Description of charges in Patron accounting
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / printinvoice.tt
index a712e83..27fc620 100644 (file)
@@ -1,63 +1,85 @@
+[% USE raw %]
+[% USE Asset %]
+[% USE Koha %]
+[% USE Branches %]
+[% USE KohaDates %]
+[% USE Price %]
+[% SET footerjs = 1 %]
+
+[% PROCESS 'accounts.inc' %]
+
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Print Receipt for [% cardnumber %]</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/printreceiptinvoice.css" />
-<script language="javascript">
-    function printThenClose() {
-        window.print();
-        window.close();
-    }
-</script>
+<title>Print receipt for [% patron.cardnumber | html %]</title>
+[% INCLUDE 'doc-head-close.inc' %]
+[% Asset.css("css/printreceiptinvoice.css") | $raw %]
 </head>
-<body onload="printThenClose();">
+
+<body id="printinvoice" class="pat">
 
 <div id="receipt">
 <!-- The table with the account items -->
 <table>
 [% IF ( LibraryName ) %]
   <tr>
-       <th colspan=3 class="centerednames">
-               <h3>[% LibraryName %]</h3>
+    <th colspan="8" class="centerednames">
+        <h3>[% LibraryName | html %]</h3>
        </th>
   </tr>
 [% END %]
   <tr>
-       <th colspan=3 class="centerednames">
-               <h2><u>INVOICE</u></h2>
-       </th>
+    <th colspan="8" class="centerednames">
+        <h2><u>INVOICE</u></h2>
+    </th>
   </tr>
   <tr>
-       <th colspan=3 class="centerednames">
-               [% IF ( branchname ) %]<h2>[% branchname %]</h2>[% END %]
+    <th colspan="8" class="centerednames">
+        <h2>[% Branches.GetName( patron.branchcode ) | html %]</h2>
        </th>
   </tr>
   <tr>
-       <th colspan=3 >
-               Bill To: [% firstname %] [% surname %] <br />
-               Card Number: [% cardnumber %]<br />
+    <th colspan="8" >
+        Bill to: [% patron.firstname | html %] [% patron.surname | html %] <br />
+        Card number: [% patron.cardnumber | html %]<br />
        </th>
   </tr>
   <tr>
        <th>Date</th>
     <th>Description of charges</th>
+    <th>Barcode</th>
+    <th>Due date</th>
+    <th>Return date</th>
+    <th>Note</th>
     <th style="text-align:right;">Amount</th>
+    <th style="text-align:right;">Amount outstanding</th>
  </tr>
 
   [% FOREACH account IN accounts %]
 <tr class="highlight">
-      <td>[% account.date %]</td>
-      <td>[% account.description %]</td>
-      [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td>
+      <td>[% account.date | $KohaDates%]</td>
+       <td>
+        [% PROCESS account_type_description account=account %]
+        [%- IF account.description %], [% account.description | html %][% END %]
+      </td>
+      <td>[% account.item.barcode | html %]</td>
+      <td>[% account.issue.date_due | $KohaDates as_due_date => 1 %]</td>
+      <td>[% account.issue.returndate | $KohaDates with_hours => 1 %]</td>
+      <td>[% account.note | html %]</td>
+      [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td>
+      [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td>
     </tr>
 
   [% END %]
 <tfoot>
   <tr>
-    <td colspan="2">Total outstanding dues as on date: </td>
-    [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total %]</td>
+    <td colspan="7">Total outstanding dues as on date: </td>
+    [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td>
   </tr>
   </tfoot>
 </table>
 </div>
+
+[% MACRO jsinclude BLOCK %]
+    [% INCLUDE 'slip-print.inc' #printThenClose %]
+[% END %]
+
 [% INCLUDE 'intranet-bottom.inc' %]