Bug 10904: Limit patron update request management by branch
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / pay.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Patrons &rsaquo; Pay Fines for  [% borrower.firstname %] [% borrower.surname %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6 <script type= "text/javascript">
7 //<![CDATA[
8 function enableCheckboxActions(){
9     // Enable/disable controls if checkboxes are checked
10     var checkedBoxes = $("input.cb:checked");
11     if ($(checkedBoxes).size()) {
12       $("#payselected").prop("disabled",false);
13     } else {
14       $("#payselected").prop("disabled",true);
15     }
16 }
17     $(document).ready(function(){
18  $('#pay-fines-form').preventDoubleFormSubmit();
19         $("#woall").click(function(event){
20             var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% 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.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     <input type="hidden" name="notify_id[% line.accountlines_id %]" value="[% line.notify_id %]" />
113     <input type="hidden" name="notify_level[% line.accountlines_id %]" value="[% line.notify_level %]" />
114     <input type="hidden" name="totals[% line.accountlines_id %]" value="[% line.totals %]" />
115     </td>
116     <td>
117         [% SWITCH line.accounttype %]
118           [% CASE 'Pay' %]Payment, thanks
119           [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
120           [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
121           [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
122           [% CASE 'N' %]New card
123           [% CASE 'F' %]Fine
124           [% CASE 'A' %]Account management fee
125           [% CASE 'M' %]Sundry
126           [% CASE 'L' %]Lost item
127           [% CASE 'W' %]Writeoff
128           [% CASE 'FU' %]Accruing fine
129           [% CASE 'Rent' %]Rental fee
130           [% CASE 'FOR' %]Forgiven
131           [% CASE 'LR' %]Lost item fee refund
132           [% CASE 'PAY' %]Payment
133           [% CASE 'WO' %]Writeoff
134           [% CASE 'C' %]Credit
135           [% CASE 'CR' %]Credit
136           [% CASE %][% line.accounttype %]
137         [%- END -%]
138         [%- IF line.description %], [% line.description %][% END %]
139         [% IF line.title %]([% line.title %])[% END %]
140     </td>
141     <td><input type="text" name="payment_note_[% line.accountlines_id %]" /></td>
142     <td>[% line.accounttype %]</td>
143     <td>[% line.notify_id %]</td>
144     <td>[% line.notify_level %]</td>
145     <td class="debit">[% line.amount | format('%.2f') %]</td>
146     <td class="debit">[% line.amountoutstanding | format('%.2f') %]</td>
147 </tr>
148 [% END %]
149 [% IF ( account_grp.total ) %]
150 <tr>
151
152     <td class="total" colspan="8">Sub total:</td>
153     <td>[% account_grp.total | format('%.2f') %]</td>
154 </tr>
155 [% END %]
156 [% END %]
157 </tbody>
158 </table>
159 <fieldset class="action">
160 <input type="submit" id="paycollect" name="paycollect"  value="Pay amount" class="submit" />
161 [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall"  id="woall" value="Write off all" class="submit" />[% END %]
162 <input type="submit" id="payselected" name="payselected"  value="Pay selected" class="submit" />
163 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
164 </fieldset>
165 </form>
166 [% ELSE %]
167     <p>[% borrower.firstname %] [% borrower.surname %] has no outstanding fines.</p>
168 [% END %]
169 </div></div>
170
171 </div>
172 </div>
173 <div class="yui-b">
174 [% INCLUDE 'circ-menu.inc' %]
175 </div>
176 </div>
177 [% INCLUDE 'intranet-bottom.inc' %]