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