Bug 20629: Rename reverse_col to actions_col
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / boraccount.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% USE ColumnsSettings %]
7 [% USE AuthorisedValues %]
8 [% USE Price %]
9 [% USE Branches %]
10 [% SET footerjs = 1 %]
11 [% INCLUDE 'doc-head-open.inc' %]
12 <title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 [% Asset.css("css/datatables.css") | $raw %]
15 </head>
16
17 <body id="pat_borraccount" class="pat">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'patron-search.inc' %]
20
21 <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>
22
23 <div id="doc3" class="yui-t2">
24
25    <div id="bd">
26         <div id="yui-main">
27         <div class="yui-b">
28 [% INCLUDE 'members-toolbar.inc' %]
29 <form action="/cgi-bin/koha/members/boraccount.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
30
31 <!-- The manual invoice and credit buttons -->
32 <div class="statictabs">
33 <ul>
34     <li class="active"><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]">Account</a></li>
35     <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Pay fines</a></li>
36     <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Create manual invoice</a></li>
37     <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Create manual credit</a></li>
38 </ul>
39 <div class="tabs-container">
40 <!-- The table with the account items -->
41 <table id="table_account_fines">
42     <thead>
43       <tr>
44           <th class="title-string">Date</th>
45           <th>Description of charges</th>
46           <th>Home library</th>
47           <th>Note</th>
48           <th>Amount</th>
49           <th>Outstanding</th>
50           [% IF ( actions_col ) %]
51               <th>Actions</th>
52           [% ELSE %]
53               <th>&nbsp;</th>
54           [% END %]
55         </tr>
56     </thead>
57
58         <!-- FIXME: Shouldn't hardcode dollar signs, since Euro or Pound might be needed -->
59   [% FOREACH account IN accounts %]
60
61    <tr>
62    <td><span title="[% account.date | html %]">[% account.date |$KohaDates %]</span></td>
63       <td>
64         [% INCLUDE 'accounttype.inc' accountline => account %]
65         [%- IF account.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %][% END %]
66         [%- IF account.description %], [% account.description | html %][% END %]
67         &nbsp;[% IF ( account.itemnumber ) %]<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>
68       <td>[% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %]</td>
69       <td>[% account.note | html_line_break %]</td>
70       [% IF account.amount <= 0 %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td>
71       [% IF account.amountoutstanding <= 0 %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding | $Price %]</td>
72       <td class="actions">
73         [% IF ( account.is_credit ) %]
74           <a target="_blank" href="printfeercpt.pl?action=print&amp;accountlines_id=[% account.accountlines_id | html %]&amp;borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print</a>
75         [% ELSE %]
76           <a target="_blank" href="printinvoice.pl?action=print&amp;accountlines_id=[% account.accountlines_id | html %]&amp;borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print</a>
77         [% END %]
78         <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a>
79         [% IF ( actions_col) %]
80           [% IF account.is_credit %]
81               <a href="boraccount.pl?action=void&amp;accountlines_id=[% account.accountlines_id | uri %]&amp;borrowernumber=[% account.borrowernumber | uri %]" class="btn btn-default btn-xs void"><i class="fa fa-ban"></i> Void</a>
82           [% ELSE %]
83             &nbsp;
84           [% END %]
85         [% END %]
86       </td>
87     </tr>
88
89   [% END %]
90 <tfoot>
91   <tr>
92     <td colspan="5">Total due</td>
93     [% IF ( totalcredit ) %]
94         <td class="credit" style="text-align: right;">[% total | $Price %]</td>
95     [% ELSE %]
96        <td class="debit"style="text-align: right;">[% total | $Price %]</td>
97     [% END %]
98     <td></td>
99   </tr>
100   </tfoot>
101 </table>
102 </div></div>
103
104 </div>
105 </div>
106
107 <div class="yui-b">
108 [% INCLUDE 'circ-menu.inc' %]
109 </div>
110 </div>
111
112 [% MACRO jsinclude BLOCK %]
113     [% INCLUDE 'datatables.inc' %]
114     [% INCLUDE 'columns_settings.inc' %]
115     [% INCLUDE 'str/members-menu.inc' %]
116     [% Asset.js("js/members-menu.js") | $raw %]
117     <script type="text/javascript">
118         $(document).ready(function() {
119             var txtActivefilter = _("Filter paid transactions");
120             var txtInactivefilter = _("Show all transactions");
121             var columns_settings = [% ColumnsSettings.GetColumns('members', 'fines', 'account-fines', 'json') | $raw %];
122             var table_account_fines = KohaTable("table_account_fines", {
123                 "sPaginationType": "four_button",
124                 'aaSorting': [[0, 'desc']],
125                 "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
126                 "aoColumnDefs": [
127                     { "sType": "title-string", "aTargets" : [ "title-string" ] },
128                     { "bSortable": false, "bSearchable": false, "aTargets": [-1] }
129                 ]
130             }, columns_settings);
131             $("#filter_c").html('<p><a href="#" id="filter_transacs"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>');
132             $('#filter_transacs').click(function(e) {
133                 e.preventDefault();
134                 if ($(this).hasClass('filtered')) {
135                     var filteredValue = '';
136                     $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter);
137                 } else { //Not filtered. Let's do it!
138                     var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408
139                     $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter);
140                 }
141                 table_account_fines.fnFilter(filteredValue, 5, true, false);
142                 $(this).toggleClass('filtered');
143             });
144
145             $(".void").on("click",function(e){
146                 if( confirm( _("Are you sure you want to void this credit?") ) ) {
147                     return true;
148                 } else {
149                     e.preventDefault();
150                 }
151             });
152         });
153     </script>
154 [% END %]
155
156 [% INCLUDE 'intranet-bottom.inc' %]