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