Bug 6413 Added ability to add a note when paying or writing off a fine
[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="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
5 <script type= "text/javascript">
6 //<![CDATA[
7     $(document).ready(function(){
8  $('#pay-fines-form').preventDoubleFormSubmit();
9         $("#woall").click(function(event){
10             var answer = confirm(_("Are you sure you want to write off [% total | format('%.2f') %] in outstanding fines? This cannot be undone!"));
11                 if (!answer){
12                     event.preventDefault();
13                 }
14         });
15         $('#CheckAll').click(function(){ $("#finest").checkCheckboxes(); return false;});
16         $('#CheckNone').click(function(){ $("#finest").unCheckCheckboxes(); return false;});
17     });
18 //]]>
19 </script>
20 </head>
21 <body id="pat_pay" class="pat">
22 [% INCLUDE 'header.inc' %]
23 [% INCLUDE 'patron-search.inc' %]
24
25 <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>
26
27 <div id="doc3" class="yui-t2">
28    
29    <div id="bd">
30         <div id="yui-main">
31         <div class="yui-b">
32 [% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %]
33
34 <!-- The manual invoice and credit buttons -->
35 <div class="statictabs">
36 <ul>
37         <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a></li>
38     <li class="active"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a></li>
39         <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a></li>
40         <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a></li>
41 </ul>
42 <div class="tabs-container">
43
44 [% IF ( accounts ) %]
45     <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
46         <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
47 <p><span class="checkall"><a id="CheckAll" href="#">Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></p>
48 <table id="finest">
49 <thead>
50 <tr>
51     <th>&nbsp;</th>
52     <th>Fines &amp; charges</th>
53         <th>Description</th>
54     <th>Payment Note</th>
55     <th>Account type</th>
56         <th>Notify id</th>
57         <th>Level</th>
58         <th>Amount</th>
59     <th>Amount outstanding</th>
60 </tr>
61 </thead>
62 <tfoot>
63 <tr>
64     <td class="total" colspan="7">Total Due:</td>
65     <td>[% total | format('%.2f') %]</td>
66 </tr>
67 </tfoot>
68 <tbody>
69 [% FOREACH account_grp IN accounts %]
70     [% FOREACH line IN account_grp.accountlines %]
71 <tr>
72     <td>
73     [% IF ( line.amountoutstanding > 0 ) %]
74         <input type="checkbox" checked="checked" name="incl_par_[% line.accountno %]" />
75     [% END %]
76     </td>
77     <td>
78     [% IF ( line.amountoutstanding > 0 ) %]
79         <input type="submit" name="pay_indiv_[% line.accountno %]" value="Pay" />
80         <input type="submit" name="wo_indiv_[% line.accountno %]" value="Write off" />
81     [% END %]
82     <input type="hidden" name="itemnumber[% line.accountno %]" value="[% line.itemnumber %]" />
83     <input type="hidden" name="description[% line.accountno %]" value="[% line.description %]" />
84     <input type="hidden" name="accounttype[% line.accountno %]" value="[% line.accounttype %]" />
85     <input type="hidden" name="amount[% line.accountno %]" value="[% line.amount %]" />
86     <input type="hidden" name="accountlines_id[% line.accountno %]" value="[% line.accountlines_id %]" />
87     <input type="hidden" name="amountoutstanding[% line.accountno %]" value="[% line.amountoutstanding %]" />
88     <input type="hidden" name="borrowernumber[% line.accountno %]" value="[% line.borrowernumber %]" />
89     <input type="hidden" name="accountno[% line.accountno %]" value="[% line.accountno %]" />
90     <input type="hidden" name="notify_id[% line.accountno %]" value="[% line.notify_id %]" />
91     <input type="hidden" name="notify_level[% line.accountno %]" value="[% line.notify_level %]" />
92     <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" />
93     </td>
94     <td>[% line.description %] ([% line.title |html_entity %])</td>
95     <td><input type="text" name="payment_note_[% line.accountno %]"></input></td>
96     <td>[% line.accounttype %]</td>
97     <td>[% line.notify_id %]</td>
98     <td>[% line.notify_level %]</td>
99     <td class="debit">[% line.amount | format('%.2f') %]</td>
100     <td class="debit">[% line.amountoutstanding | format('%.2f') %]</td>
101 </tr>
102 [% END %]
103 [% IF ( account_grp.total ) %]
104 <tr>
105
106     <td class="total" colspan="7">Sub total:</td>
107     <td>[% account_grp.total | format('%.2f') %]</td>
108 </tr>
109 [% END %]
110 [% END %]
111 </tbody>
112 </table>
113 <fieldset class="action">
114 <input type="submit" name="paycollect"  value="Pay amount" class="submit" />
115 <input type="submit" name="woall"  id="woall" value="Write off all" class="submit" />
116 <input type="submit" name="payselected"  value="Pay selected" class="submit" />
117 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
118 </fieldset>
119 </form>
120 [% ELSE %]
121     <p>[% borrower.firstname %] [% borrower.surname %] has no outstanding fines.</p>
122 [% END %]
123 </div></div>
124
125 </div>
126 </div>
127
128 <div class="yui-b">
129 [% INCLUDE 'circ-menu.tt' %]
130 </div>
131 </div>
132 [% INCLUDE 'intranet-bottom.inc' %]