Bug 16235: Making borrower account actions buttons
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / boraccount.tt
blob4bcfc2fb53780596e0a159ab62dc3f16e5a9675a
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
7 [% INCLUDE 'datatables.inc' %]
8 <script type="text/javascript">
9 $(document).ready(function() {
10     var txtActivefilter = _("Filter paid transactions");
11     var txtInactivefilter = _("Show all transactions");
12     var table_account_fines = $("#table_account_fines").dataTable($.extend(true, {}, dataTablesDefaults, {
13         "sPaginationType": "four_button",
14         'aaSorting': [[0, 'desc']],
15         "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
16         "aoColumnDefs": [
17             { "sType": "title-string", "aTargets" : [ "title-string" ] },
18             { "bSortable": false, "bSearchable": false, "aTargets": [-1] }
19         ]
20     }));
21     $("#filter_c").html('<p><a href="#" id="filter_transacs">'+txtActivefilter+'</a>');
22     $('#filter_transacs').click(function(e) {
23         e.preventDefault();
24         if ($(this).hasClass('filtered')) {
25             var filteredValue = '';
26             $(this).text(txtActivefilter);
27         } else { //Not filtered. Let's do it!
28             var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408
29             $(this).text(txtInactivefilter);
30         }
31         table_account_fines.fnFilter(filteredValue, 4, true, false);
32         $(this).toggleClass('filtered');
33     });
34 });
35 </script>
36 </head>
37 <body id="pat_borraccount" class="pat">
38 [% INCLUDE 'header.inc' %]
39 [% INCLUDE 'patron-search.inc' %]
41 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</div>
43 <div id="doc3" class="yui-t2">
44    
45    <div id="bd">
46         <div id="yui-main">
47         <div class="yui-b">
48 [% INCLUDE 'members-toolbar.inc' %]
49 <form action="/cgi-bin/koha/members/boraccount.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form>
51 <!-- The manual invoice and credit buttons -->
52 <div class="statictabs">
53 <ul>
54     <li class="active"><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Account</a></li>
55         <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li>
56         <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li>
57         <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li>
58 </ul>
59 <div class="tabs-container">
60 <!-- The table with the account items -->
61 <table id="table_account_fines">
62     <thead>
63       <tr>
64           <th class="title-string">Date</th>
65           <th>Description of charges</th>
66           <th>Note</th>
67           <th>Amount</th>
68           <th>Outstanding</th>
69           [% IF ( reverse_col ) %]
70               <th>Actions</th>
71           [% ELSE %]
72               <th>&nbsp;</th>
73           [% END %]
74         </tr>
75     </thead>
77         <!-- FIXME: Shouldn't hardcode dollar signs, since Euro or Pound might be needed -->
78   [% FOREACH account IN accounts %]
80    <tr>
81    <td><span title="[% account.date %]">[% account.date |$KohaDates %]</span></td>
82       <td>
83         [% SWITCH account.accounttype %]
84           [% CASE 'Pay' %]Payment, thanks
85           [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
86           [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
87           [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
88           [% CASE 'N' %]New card
89           [% CASE 'F' %]Fine
90           [% CASE 'A' %]Account management fee
91           [% CASE 'M' %]Sundry
92           [% CASE 'L' %]Lost item
93           [% CASE 'W' %]Writeoff
94           [% CASE 'FU' %]Accruing fine
95           [% CASE 'Rent' %]Rental fee
96           [% CASE 'FOR' %]Forgiven
97           [% CASE 'LR' %]Lost item fee refund
98           [% CASE 'PAY' %]Payment
99           [% CASE 'WO' %]Writeoff
100           [% CASE 'C' %]Credit
101           [% CASE 'CR' %]Credit
102           [% CASE %][% account.accounttype %]
103         [%- END -%]
104         [%- IF account.description %], [% account.description %][% END %]
105         &nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">[% account.title |html %]</a>[% END %]</td>
106       <td>[% account.note | html_line_break %]</td>
107       [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount %]</td>
108       [% IF ( account.amountoutstandingcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding %]</td>
109       <td class="actions">
110         [% IF ( account.payment ) %]
111           <a target="_blank" href="printfeercpt.pl?action=print&amp;accountlines_id=[% account.accountlines_id %]&amp;borrowernumber=[% account.borrowernumber %]" class="btn btn-mini"><i class="fa fa-print"></i> Print</a>
112         [% ELSE %]
113           <a target="_blank" href="printinvoice.pl?action=print&amp;accountlines_id=[% account.accountlines_id %]&amp;borrowernumber=[% account.borrowernumber %]" class="btn btn-mini"><i class="fa fa-print"></i> Print</a>
114         [% END %]
115         [% IF ( reverse_col) %]
116           [% IF ( account.payment ) %]
117             <a href="boraccount.pl?action=reverse&amp;accountlines_id=[% account.accountlines_id %]&amp;borrowernumber=[% account.borrowernumber %]" class="btn btn-mini"><i class="fa fa-undo"></i> Reverse</a>
118           [% ELSE %]
119             &nbsp;
120           [% END %]
121         [% END %]
122       </td>
123     </tr>
125   [% END %]
126 <tfoot>
127   <tr>
128     <td colspan="4">Total due</td>
129     [% IF ( totalcredit ) %]
130         <td class="credit" style="text-align: right;">[% total %]</td>
131     [% ELSE %]
132        <td class="debit"style="text-align: right;">[% total %]</td>
133     [% END %]
134     <td></td>
135   </tr>
136   </tfoot>
137 </table>
138 </div></div>
140 </div>
141 </div>
143 <div class="yui-b">
144 [% INCLUDE 'circ-menu.inc' %]
145 </div>
146 </div>
147 [% INCLUDE 'intranet-bottom.inc' %]