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