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