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