Bug 9462 [Revised] Use DataTables on patron detail page
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / paycollect.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Patrons &rsaquo; Collect fine payment for  [% borrower.firstname %] [% borrower.surname %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type= "text/javascript">
5 //<![CDATA[
6 function moneyFormat(textObj) {
7     var newValue = textObj.value;
8     var decAmount = "";
9     var dolAmount = "";
10     var decFlag   = false;
11     var aChar     = "";
12
13     for(i=0; i < newValue.length; i++) {
14         aChar = newValue.substring(i, i+1);
15         if (aChar >= "0" && aChar <= "9") {
16             if(decFlag) {
17                 decAmount = "" + decAmount + aChar;
18             }
19             else {
20                 dolAmount = "" + dolAmount + aChar;
21             }
22         }
23         if (aChar == ".") {
24             if (decFlag) {
25                 dolAmount = "";
26                 break;
27             }
28             decFlag = true;
29         }
30     }
31
32     if (dolAmount == "") {
33         dolAmount = "0";
34     }
35 // Strip leading 0s
36     if (dolAmount.length > 1) {
37         while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") {
38             dolAmount = dolAmount.substring(1,dolAmount.length);
39         }
40     }
41     if (decAmount.length > 2) {
42         decAmount = decAmount.substring(0,2);
43     }
44 // Pad right side
45     if (decAmount.length == 1) {
46        decAmount = decAmount + "0";
47     }
48     if (decAmount.length == 0) {
49        decAmount = decAmount + "00";
50     }
51
52     textObj.value = dolAmount + "." + decAmount;
53 }
54 //]]>
55 </script>
56 </head>
57 <body id="pat_paycollect" class="pat">
58 [% INCLUDE 'header.inc' %]
59 [% INCLUDE 'patron-search.inc' %]
60 <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; <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Pay fines for [% borrower.firstname %] [% borrower.surname %]</a> &rsaquo; [% IF ( pay_individual ) %]Pay an individual fine[% ELSIF ( writeoff_individual ) %]Write off an individual fine[% ELSE %][% IF ( selected_accts ) %]Pay an amount toward selected fines[% ELSE %]Pay an amount toward all fines[% END %][% END %]</div>
61
62 <div id="doc3" class="yui-t2">
63
64 <div id="bd">
65 <div id="yui-main">
66 <div class="yui-b">
67 [% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %]
68
69
70 <!-- The manual invoice and credit buttons -->
71 <div class="statictabs">
72 <ul>
73     <li>
74     <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a>
75     </li>
76     <li class="active">
77     <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a>
78     </li>
79     <li>
80     <a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a>
81     </li>
82     <li>
83     <a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a>
84     </li>
85 </ul>
86 <div class="tabs-container">
87 [% IF ( error_over ) %]
88     <div id="error_message" class="dialog alert">
89     You must pay a value less than or equal to [% total_due | format('%.2f') %].
90     </div>
91 [% END %]
92
93 [% IF ( pay_individual ) %]
94     <form name="payindivfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl">
95     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
96     <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
97     <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
98     <input type="hidden" name="description" id="description" value="[% description %]" />
99     <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
100     <input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" />
101     <input type="hidden" name="notify_level" id="notify_level" value="[% notify_level %]" />
102     <input type="hidden" name="amount" id="amount" value="[% amount %]" />
103     <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" />
104     <input type="hidden" name="accountno" id="accountno" value="[% accountno %]" />
105     <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" />
106     <input type="hidden" name="title" id="title" value="[% title %]" />
107
108 <fieldset class="rows">
109     <legend>Pay an individual fine</legend>
110     <table>
111     <thead><tr>
112             <th>Description</th>
113             <th>Account type</th>
114             <th>Notify id</th>
115             <th>Level</th>
116             <th>Amount</th>
117             <th>Amount outstanding</th>
118         </tr></thead>
119     <tfoot>
120         <td colspan="5">Total amount payable:</td><td>[% amountoutstanding | format('%.2f') %]</td>
121     </tfoot>
122     <tbody><tr>
123             <td>
124                 [% description %] [% title  %]
125             </td>
126             <td>[% accounttype %]</td>
127             <td>[% notify_id %]</td>
128             <td>[% notify_level %]</td>
129             <td class="debit">[% amount | format('%.2f') %]</td>
130             <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
131         </tr></tbody>
132 </table>
133
134 <ol>
135
136     <li>
137         <label for="paid">Collect from patron: </label>
138             <!-- default to paying all -->
139         <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" onchange="moneyFormat(document.payindivfine.paid)"/>
140     </li>
141 </ol>
142 </fieldset>
143
144     <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
145         <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div>
146     </form>
147 [% ELSIF ( writeoff_individual ) %]
148     <form name="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" >
149     <fieldset class="rows">
150     <legend>Write off an individual fine</legend>
151     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
152     <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
153     <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
154     <input type="hidden" name="description" id="description" value="[% description %]" />
155     <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
156     <input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" />
157     <input type="hidden" name="notify_level" id="notify_level" value="[% notify_level %]" />
158     <input type="hidden" name="amount" id="amount" value="[% amount %]" />
159     <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" />
160     <input type="hidden" name="accountno" id="accountno" value="[% accountno %]" />
161     <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" />
162     <input type="hidden" name="title" id="title" value="[% title %]" />
163     <table>
164     <thead><tr>
165             <th>Description</th>
166             <th>Account type</th>
167             <th>Notify id</th>
168             <th>Level</th>
169             <th>Amount</th>
170             <th>Amount outstanding</th>
171         </tr></thead>
172     <tfoot><td colspan="5">Total amount to be written off:</td><td>[% amountoutstanding | format('%.2f') %]</td></tfoot>
173     <tbody><tr>
174             <td>[% description %] [% title %]</td>
175             <td>[% accounttype %]</td>
176             <td>[% notify_id %]</td>
177             <td>[% notify_level %]</td>
178             <td class="debit">[% amount | format('%.2f') %]</td>
179             <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
180         </tr></tbody>
181     </table>
182     </fieldset>
183     <div class="action"><input type="submit" name="confirm_writeoff" id="confirm_writeoff" value="Write off this charge" />
184         <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div>
185     </form>
186 [% ELSE %]
187
188     <form name="payfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl">
189     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
190     <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts %]" />
191     <input type="hidden" name="total" id="total" value="[% total %]" />
192
193     <fieldset class="rows">
194     [% IF ( selected_accts ) %]<legend>Pay an amount toward selected fines</legend>[% ELSE %]<legend>Pay an amount toward all fines</legend>[% END %]
195     <ol>
196         <li>
197             <span class="label">Total amount outstanding: </span>
198             <span class="debit">[% total | format('%.2f') %]</span>
199         </li>
200     <li>
201         <label for="paid">Collect from patron: </label>
202         <!-- default to paying all -->
203         <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="moneyFormat(document.payfine.paid)"/>
204     </li>
205     </ol>
206     </fieldset>
207     <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
208         <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div>
209     </form>
210 [% END %]
211 </div></div>
212 </div>
213 </div>
214
215 <div class="yui-b">
216 [% INCLUDE 'circ-menu.tt' %]
217 </div>
218 </div>
219 [% INCLUDE 'intranet-bottom.inc' %]
220