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