Bug 12138 - Use placeholders in translatable Javascript strings
[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!").format( "[% total | format('%.2f') %]" );
20             var answer = confirm(msg);
21                 if (!answer){
22                     event.preventDefault();
23                 }
24         });
25         $('#CheckAll').click(function(){
26             $("#finest").checkCheckboxes();
27             enableCheckboxActions();
28             return false;
29         });
30         $('#CheckNone').click(function(){
31             $("#finest").unCheckCheckboxes();
32             enableCheckboxActions();
33             return false;
34         });
35         $(".cb").change(function(){
36             enableCheckboxActions();
37         });
38         enableCheckboxActions();
39     });
40 //]]>
41 </script>
42 </head>
43 <body id="pat_pay" class="pat">
44 [% INCLUDE 'header.inc' %]
45 [% INCLUDE 'patron-search.inc' %]
46
47 <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>
48
49 <div id="doc3" class="yui-t2">
50    
51    <div id="bd">
52         <div id="yui-main">
53         <div class="yui-b">
54 [% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %]
55
56 <!-- The manual invoice and credit buttons -->
57 <div class="statictabs">
58 <ul>
59         <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a></li>
60     <li class="active"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a></li>
61         <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a></li>
62         <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a></li>
63 </ul>
64 <div class="tabs-container">
65
66 [% IF ( accounts ) %]
67     <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
68         <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
69 <p><span class="checkall"><a id="CheckAll" href="#">Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></p>
70 <table id="finest">
71 <thead>
72 <tr>
73     <th>&nbsp;</th>
74     <th>Fines &amp; charges</th>
75     <th>Description</th>
76     <th>Payment note</th>
77     <th>Account type</th>
78     <th>Notify id</th>
79     <th>Level</th>
80     <th>Amount</th>
81     <th>Amount outstanding</th>
82 </tr>
83 </thead>
84 <tfoot>
85 <tr>
86     <td class="total" colspan="8">Total due:</td>
87     <td>[% total | format('%.2f') %]</td>
88 </tr>
89 </tfoot>
90 <tbody>
91 [% FOREACH account_grp IN accounts %]
92     [% FOREACH line IN account_grp.accountlines %]
93 <tr>
94     <td>
95     [% IF ( line.amountoutstanding > 0 ) %]
96         <input class="cb" type="checkbox" checked="checked" name="incl_par_[% line.accountno %]" />
97     [% END %]
98     </td>
99     <td>
100     [% IF ( line.amountoutstanding > 0 ) %]
101         <input type="submit" name="pay_indiv_[% line.accountno %]" value="Pay" />
102         [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="wo_indiv_[% line.accountno %]" value="Write off" />[% END %]
103     [% END %]
104     <input type="hidden" name="itemnumber[% line.accountno %]" value="[% line.itemnumber %]" />
105     <input type="hidden" name="description[% line.accountno %]" value="[% line.description %]" />
106     <input type="hidden" name="accounttype[% line.accountno %]" value="[% line.accounttype %]" />
107     <input type="hidden" name="amount[% line.accountno %]" value="[% line.amount %]" />
108     <input type="hidden" name="accountlines_id[% line.accountno %]" value="[% line.accountlines_id %]" />
109     <input type="hidden" name="amountoutstanding[% line.accountno %]" value="[% line.amountoutstanding %]" />
110     <input type="hidden" name="borrowernumber[% line.accountno %]" value="[% line.borrowernumber %]" />
111     <input type="hidden" name="accountno[% line.accountno %]" value="[% line.accountno %]" />
112     <input type="hidden" name="notify_id[% line.accountno %]" value="[% line.notify_id %]" />
113     <input type="hidden" name="notify_level[% line.accountno %]" value="[% line.notify_level %]" />
114     <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" />
115     </td>
116     <td>
117         [% SWITCH line.accounttype %]
118           [% CASE 'Pay' %]Payment,thanks
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 %][% line.accounttype %]
126         [%- END -%]
127         [%- IF line.description %], [% line.description %][% END %]
128         [% IF line.title %]([% line.title |html_entity %])[% END %]
129     </td>
130     <td><input type="text" name="payment_note_[% line.accountno %]" /></td>
131     <td>[% line.accounttype %]</td>
132     <td>[% line.notify_id %]</td>
133     <td>[% line.notify_level %]</td>
134     <td class="debit">[% line.amount | format('%.2f') %]</td>
135     <td class="debit">[% line.amountoutstanding | format('%.2f') %]</td>
136 </tr>
137 [% END %]
138 [% IF ( account_grp.total ) %]
139 <tr>
140
141     <td class="total" colspan="8">Sub total:</td>
142     <td>[% account_grp.total | format('%.2f') %]</td>
143 </tr>
144 [% END %]
145 [% END %]
146 </tbody>
147 </table>
148 <fieldset class="action">
149 <input type="submit" id="paycollect" name="paycollect"  value="Pay amount" class="submit" />
150 [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall"  id="woall" value="Write off all" class="submit" />[% END %]
151 <input type="submit" id="payselected" name="payselected"  value="Pay selected" class="submit" />
152 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
153 </fieldset>
154 </form>
155 [% ELSE %]
156     <p>[% borrower.firstname %] [% borrower.surname %] has no outstanding fines.</p>
157 [% END %]
158 </div></div>
159
160 </div>
161 </div>
162
163 <div class="yui-b">
164 [% INCLUDE 'circ-menu.tt' %]
165 </div>
166 </div>
167 [% INCLUDE 'intranet-bottom.inc' %]