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