Bug 7969 - select all / unselect all on fines page
[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="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
5 <script type= "text/javascript">
6 //<![CDATA[
7     $(document).ready(function(){
8         $("#woall").click(function(event){
9             var answer = confirm(_("Are you sure you want to write off [% total | format('%.2f') %] in outstanding fines? This cannot be undone!"));
10                 if (!answer){
11                     event.preventDefault();
12                 }
13         });
14         $('#CheckAll').click(function(){ $("#finest").checkCheckboxes(); return false;});
15         $('#CheckNone').click(function(){ $("#finest").unCheckCheckboxes(); return false;});
16     });
17 //]]>
18 </script>
19 </head>
20 <body id="pat_pay" 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; Pay fines for [% borrower.firstname %] [% borrower.surname %]</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' borrowernumber=borrower.borrowernumber %]
32
33 <!-- The manual invoice and credit buttons -->
34 <div class="statictabs">
35 <ul>
36         <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a></li>
37     <li class="active"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a></li>
38         <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a></li>
39         <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a></li>
40 </ul>
41 <div class="tabs-container">
42
43 [% IF ( accounts ) %]
44     <form action="/cgi-bin/koha/members/pay.pl" method="post">
45         <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
46 <p><span class="checkall"><a id="CheckAll" href="#">Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></p>
47 <table id="finest">
48 <thead>
49 <tr>
50     <th>&nbsp;</th>
51     <th>Fines &amp; charges</th>
52         <th>Description</th>
53     <th>Account type</th>
54         <th>Notify id</th>
55         <th>Level</th>
56         <th>Amount</th>
57     <th>Amount outstanding</th>
58 </tr>
59 </thead>
60 <tfoot>
61 <tr>
62     <td class="total" colspan="7">Total Due:</td>
63     <td>[% total | format('%.2f') %]</td>
64 </tr>
65 </tfoot>
66 <tbody>
67 [% FOREACH account_grp IN accounts %]
68     [% FOREACH line IN account_grp.accountlines %]
69 <tr>
70     <td>
71     [% IF ( line.amountoutstanding > 0 ) %]
72         <input type="checkbox" checked="checked" name="incl_par_[% line.accountno %]" />
73     [% END %]
74     </td>
75     <td>
76     [% IF ( line.amountoutstanding > 0 ) %]
77         <input type="submit" name="pay_indiv_[% line.accountno %]" value="Pay" />
78         <input type="submit" name="wo_indiv_[% line.accountno %]" value="Write off" />
79     [% END %]
80     <input type="hidden" name="itemnumber[% line.accountno %]" value="[% line.itemnumber %]" />
81     <input type="hidden" name="description[% line.accountno %]" value="[% line.description %]" />
82     <input type="hidden" name="accounttype[% line.accountno %]" value="[% line.accounttype %]" />
83     <input type="hidden" name="amount[% line.accountno %]" value="[% line.amount %]" />
84     <input type="hidden" name="accountlines_id[% line.accountno %]" value="[% line.accountlines_id %]" />
85     <input type="hidden" name="amountoutstanding[% line.accountno %]" value="[% line.amountoutstanding %]" />
86     <input type="hidden" name="borrowernumber[% line.accountno %]" value="[% line.borrowernumber %]" />
87     <input type="hidden" name="accountno[% line.accountno %]" value="[% line.accountno %]" />
88     <input type="hidden" name="notify_id[% line.accountno %]" value="[% line.notify_id %]" />
89     <input type="hidden" name="notify_level[% line.accountno %]" value="[% line.notify_level %]" />
90     <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" />
91     </td>
92     <td>[% line.description %] ([% line.title |html_entity %])</td>
93     <td>[% line.accounttype %]</td>
94     <td>[% line.notify_id %]</td>
95     <td>[% line.notify_level %]</td>
96     <td class="debit">[% line.amount | format('%.2f') %]</td>
97     <td class="debit">[% line.amountoutstanding | format('%.2f') %]</td>
98 </tr>
99 [% END %]
100 [% IF ( account_grp.total ) %]
101 <tr>
102
103     <td class="total" colspan="7">Sub total:</td>
104     <td>[% account_grp.total | format('%.2f') %]</td>
105 </tr>
106 [% END %]
107 [% END %]
108 </tbody>
109 </table>
110 <fieldset class="action">
111 <input type="submit" name="paycollect"  value="Pay amount" class="submit" />
112 <input type="submit" name="woall"  id="woall" value="Write off all" class="submit" />
113 <input type="submit" name="payselected"  value="Pay selected" class="submit" />
114 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
115 </fieldset>
116 </form>
117 [% ELSE %]
118     <p>[% borrower.firstname %] [% borrower.surname %] has no outstanding fines.</p>
119 [% END %]
120 </div></div>
121
122 </div>
123 </div>
124
125 <div class="yui-b">
126 [% INCLUDE 'circ-menu.tt' %]
127 </div>
128 </div>
129 [% INCLUDE 'intranet-bottom.inc' %]