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