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