Bug 21454: Remove html filter for Price filtered variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / pay.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE AuthorisedValues %]
5 [% USE Branches %]
6 [% USE Price %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha &rsaquo; Patrons &rsaquo; Pay Fines for  [% patron.firstname | html %] [% patron.surname | html %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 </head>
12
13 <body id="pat_pay" 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; Pay fines for [% patron.firstname | html %] [% patron.surname | html %]</div>
18
19 <div id="doc3" class="yui-t2">
20    
21    <div id="bd">
22         <div id="yui-main">
23         <div class="yui-b">
24 [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
25
26 <!-- The manual invoice and credit buttons -->
27 <div class="statictabs">
28 <ul>
29     <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Account</a></li>
30     <li class="active"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]" >Pay fines</a></li>
31     <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber | html %]" >Create manual invoice</a></li>
32     <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber | html %]" >Create manual credit</a></li>
33 </ul>
34 <div class="tabs-container">
35
36 [% IF ( accounts ) %]
37     <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
38     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
39 <p><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></p>
40 <table id="finest">
41 <thead>
42 <tr>
43     <th>&nbsp;</th>
44     <th>Fines &amp; charges</th>
45     <th>Description</th>
46     <th>Payment note</th>
47     <th>Account type</th>
48     <th>Amount</th>
49     <th>Amount outstanding</th>
50 </tr>
51 </thead>
52 <tfoot>
53 <tr>
54     <td class="total" colspan="6">Total due:</td>
55     <td style="text-align: right;">[% total | $Price %]</td>
56 </tr>
57 </tfoot>
58 <tbody>
59 [% FOREACH line IN accounts %]
60 <tr>
61     <td>
62     [% IF ( line.amountoutstanding > 0 ) %]
63         <input class="cb" type="checkbox" checked="checked" name="incl_par_[% line.accountlines_id | html %]" />
64     [% END %]
65     </td>
66     <td>
67     [% IF ( line.amountoutstanding > 0 ) %]
68         <input type="submit" name="pay_indiv_[% line.accountlines_id | html %]" value="Pay" />
69         [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="wo_indiv_[% line.accountlines_id | html %]" value="Write off" />[% END %]
70     [% END %]
71     <input type="hidden" name="itemnumber[% line.accountlines_id | html %]" value="[% line.itemnumber | html %]" />
72     <input type="hidden" name="description[% line.accountlines_id | html %]" value="[% line.description | html %]" />
73     <input type="hidden" name="accounttype[% line.accountlines_id | html %]" value="[% line.accounttype | html %]" />
74     <input type="hidden" name="amount[% line.accountlines_id | html %]" value="[% line.amount | html %]" />
75     <input type="hidden" name="accountlines_id[% line.accountlines_id | html %]" value="[% line.accountlines_id | html %]" />
76     <input type="hidden" name="amountoutstanding[% line.accountlines_id | html %]" value="[% line.amountoutstanding | html %]" />
77     <input type="hidden" name="borrowernumber[% line.accountlines_id | html %]" value="[% line.borrowernumber | html %]" />
78     </td>
79     <td>
80         [% SWITCH line.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 'HE' %]Hold waiting too long
93           [% CASE 'Rent' %]Rental fee
94           [% CASE 'FOR' %]Forgiven
95           [% CASE 'LR' %]Lost item fee refund
96           [% CASE 'PF' %]Processing fee
97           [% CASE 'PAY' %]Payment
98           [% CASE 'WO' %]Writeoff
99           [% CASE 'C' %]Credit
100           [% CASE 'CR' %]Credit
101           [% CASE %][% line.accounttype | html %]
102         [%- END -%]
103         [%- IF line.description %], [% line.description | html %][% END %]
104         [% IF line.title %]([% line.title | html %])[% END %]
105     </td>
106     <td><input type="text" name="payment_note_[% line.accountlines_id | html %]" /></td>
107     <td>[% line.accounttype | html %]</td>
108     <td class="debit" style="text-align: right;">[% line.amount | $Price %]</td>
109     <td class="debit" style="text-align: right;">[% line.amountoutstanding | $Price %]</td>
110 </tr>
111 [% END %]
112 [% IF ( account_grp.total ) %]
113 <tr>
114
115     <td class="total" colspan="8" style="text-align: right;">Sub total:</td>
116     <td style="text-align: right;">[% account_grp.total | $Price %]</td>
117 </tr>
118 [% END %]
119 </tbody>
120 </table>
121 <fieldset class="action">
122 <input type="submit" id="paycollect" name="paycollect"  value="Pay amount" class="submit" />
123 [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall"  id="woall" value="Write off all" class="submit" />[% END %]
124 <input type="submit" id="payselected" name="payselected"  value="Pay selected" class="submit" />
125 <input type="submit" id="writeoff-selected" name="writeoff_selected"  value="Write off selected" class="submit" />
126 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
127 </fieldset>
128 </form>
129 [% ELSE %]
130     <p>[% patron.firstname | html %] [% patron.surname | html %] has no outstanding fines.</p>
131 [% END %]
132 </div></div>
133
134 </div>
135 </div>
136 <div class="yui-b">
137 [% INCLUDE 'circ-menu.inc' %]
138 </div>
139 </div>
140
141 [% MACRO jsinclude BLOCK %]
142     [% INCLUDE 'str/members-menu.inc' %]
143     [% Asset.js("js/members-menu.js") | $raw %]
144     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
145     <script type= "text/javascript">
146         function enableCheckboxActions(){
147             // Enable/disable controls if checkboxes are checked
148             var checkedBoxes = $("input.cb:checked");
149             if ($(checkedBoxes).size()) {
150               $("#payselected").prop("disabled",false);
151             } else {
152               $("#payselected").prop("disabled",true);
153             }
154         }
155         $(document).ready(function(){
156         $('#pay-fines-form').preventDoubleFormSubmit();
157             $("#woall").click(function(event){
158                 var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | $Price %]" );
159                 var answer = confirm(msg);
160                     if (!answer){
161                         event.preventDefault();
162                     }
163             });
164             $('#CheckAll').click(function(){
165                 $("#finest").checkCheckboxes();
166                 enableCheckboxActions();
167                 return false;
168             });
169             $('#CheckNone').click(function(){
170                 $("#finest").unCheckCheckboxes();
171                 enableCheckboxActions();
172                 return false;
173             });
174             $(".cb").change(function(){
175                 enableCheckboxActions();
176             });
177             enableCheckboxActions();
178         });
179
180     </script>
181 [% END %]
182
183 [% INCLUDE 'intranet-bottom.inc' %]