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