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