|
Lines 54-65
Link Here
|
| 54 |
</li> |
54 |
</li> |
| 55 |
</ul> |
55 |
</ul> |
| 56 |
<div class="tabs-container"> |
56 |
<div class="tabs-container"> |
| 57 |
[% IF ( error_over ) %] |
57 |
[% IF (error_negative) %] |
| 58 |
<div id="error_message" class="dialog alert"> |
58 |
<div id="error_message" class="dialog alert"> |
| 59 |
You must pay a value less than or equal to [% total_due | format('%.2f') %]. |
59 |
The amount paid can't be negative. |
| 60 |
</div> |
60 |
</div> |
| 61 |
[% END %] |
61 |
[% END %] |
| 62 |
|
62 |
|
|
|
63 |
[% IF (error_collected_less) %] |
| 64 |
<div id="error_message" class="dialog alert"> |
| 65 |
The amount collected can't be lower than the amount paid. |
| 66 |
</div> |
| 67 |
[% END %] |
| 68 |
|
| 69 |
[% UNLESS (writeoff_individual) %] |
| 70 |
<form name="payform" id="payform" action="/cgi-bin/koha/members/paycollect.pl" method="post"> |
| 71 |
[% END %] |
| 72 |
|
| 63 |
[% IF ( pay_individual ) %] |
73 |
[% IF ( pay_individual ) %] |
| 64 |
<form name="payindivfine" id="payindivfine" method="post" action="/cgi-bin/koha/members/paycollect.pl"> |
74 |
<form name="payindivfine" id="payindivfine" method="post" action="/cgi-bin/koha/members/paycollect.pl"> |
| 65 |
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" /> |
75 |
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" /> |
|
Lines 84-108
Link Here
|
| 84 |
<th>Amount outstanding</th> |
94 |
<th>Amount outstanding</th> |
| 85 |
</tr></thead> |
95 |
</tr></thead> |
| 86 |
<tfoot> |
96 |
<tfoot> |
| 87 |
<td colspan="3">Total amount payable:</td><td>[% amountoutstanding | format('%.2f') %]</td> |
97 |
<td colspan="3">Total amount payable:</td><td>[% amountoutstanding | $Price %]</td> |
| 88 |
</tfoot> |
98 |
</tfoot> |
| 89 |
<tbody><tr> |
99 |
<tbody><tr> |
| 90 |
<td> |
100 |
<td> |
| 91 |
[% individual_description | html %] |
101 |
[% individual_description | html %] |
| 92 |
</td> |
102 |
</td> |
| 93 |
<td>[% accounttype | html %]</td> |
103 |
<td>[% accounttype | html %]</td> |
| 94 |
<td class="debit">[% amount | format('%.2f') %]</td> |
104 |
<td class="debit">[% amount | $Price %]</td> |
| 95 |
<td class="debit">[% amountoutstanding | format('%.2f') %]</td> |
105 |
<td class="debit">[% amountoutstanding | $Price %]</td> |
| 96 |
</tr></tbody> |
106 |
</tr></tbody> |
| 97 |
</table> |
107 |
</table> |
| 98 |
|
108 |
|
| 99 |
<ol> |
109 |
<ol> |
| 100 |
|
110 |
[% IF FineChange %] |
|
|
111 |
<li> |
| 112 |
<label for="paid">Amount paid:</label> |
| 113 |
<input name="paid" id="paid" value="[% amountoutstanding | $Price %]"/> |
| 114 |
</li> |
| 101 |
<li> |
115 |
<li> |
| 102 |
<label for="paid">Collect from patron: </label> |
116 |
<label for="collected">Collect from patron:</label> |
| 103 |
<!-- default to paying all --> |
117 |
<input name="collected" id="collected" value="[% amountoutstanding | $Price %]"/> |
| 104 |
<input name="paid" id="paid" value="[% amountoutstanding | html %]" /> |
|
|
| 105 |
</li> |
118 |
</li> |
|
|
119 |
<li> |
| 120 |
<label>Change to give back:</label> |
| 121 |
<input id="change" value="0.00" disabled/> |
| 122 |
</li> |
| 123 |
[% ELSE %] |
| 124 |
<li> |
| 125 |
<label for="paid">Collect from patron:</label> |
| 126 |
<input name="paid" id="collected" value="[% amountoutstanding | $Price %]"/> |
| 127 |
</li> |
| 128 |
[% END %] |
| 106 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
129 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
| 107 |
[% IF payment_types %] |
130 |
[% IF payment_types %] |
| 108 |
<li> |
131 |
<li> |
|
Lines 144-155
Link Here
|
| 144 |
<th>Amount</th> |
167 |
<th>Amount</th> |
| 145 |
<th>Amount outstanding</th> |
168 |
<th>Amount outstanding</th> |
| 146 |
</tr></thead> |
169 |
</tr></thead> |
| 147 |
<tfoot><td colspan="3">Total amount outstanding:</td><td>[% amountoutstanding | format('%.2f') %]</td></tfoot> |
170 |
<tfoot><td colspan="3">Total amount outstanding:</td><td>[% amountoutstanding | $Price %]</td></tfoot> |
| 148 |
<tbody><tr> |
171 |
<tbody><tr> |
| 149 |
<td>[% description | html %] [% title | html %]</td> |
172 |
<td>[% description | html %] [% title | html %]</td> |
| 150 |
<td>[% accounttype | html %]</td> |
173 |
<td>[% accounttype | html %]</td> |
| 151 |
<td class="debit">[% amount | format('%.2f') %]</td> |
174 |
<td class="debit">[% amount | $Price %]</td> |
| 152 |
<td class="debit">[% amountoutstanding | format('%.2f') %]</td> |
175 |
<td class="debit">[% amountoutstanding | $Price %]</td> |
| 153 |
</tr></tbody> |
176 |
</tr></tbody> |
| 154 |
</table> |
177 |
</table> |
| 155 |
|
178 |
|
|
Lines 189-196
Link Here
|
| 189 |
<ol> |
212 |
<ol> |
| 190 |
<li> |
213 |
<li> |
| 191 |
<span class="label">Total amount outstanding: </span> |
214 |
<span class="label">Total amount outstanding: </span> |
| 192 |
<span class="debit">[% total | format('%.2f') %]</span> |
215 |
<span class="debit">[% total | $Price %]</span> |
| 193 |
</li> |
216 |
</li> |
|
|
217 |
[% IF FineChange %] |
| 218 |
<li> |
| 219 |
<label for="paid">Amount paid :</label> |
| 220 |
<input name="paid" id="paid" value="[% total | $Price %]"/> |
| 221 |
</li> |
| 222 |
<li> |
| 223 |
[% IF type == 'writeoff' %] |
| 224 |
<label for="collected">Writeoff amount: </label> |
| 225 |
[% ELSE %] |
| 226 |
<label for="collected">Collect from patron: </label> |
| 227 |
[% END %] |
| 228 |
<!-- default to paying all --> |
| 229 |
<input name="collected" id="collected" value="[% total | $Price %]"/> |
| 230 |
</li> |
| 231 |
<li> |
| 232 |
<label>Change to give back:</label> |
| 233 |
<input id="change" value="0.00" disabled/> |
| 234 |
</li> |
| 235 |
[% ELSE %] |
| 194 |
<li> |
236 |
<li> |
| 195 |
[% IF type == 'writeoff' %] |
237 |
[% IF type == 'writeoff' %] |
| 196 |
<label for="paid">Writeoff amount: </label> |
238 |
<label for="paid">Writeoff amount: </label> |
|
Lines 198-205
Link Here
|
| 198 |
<label for="paid">Collect from patron: </label> |
240 |
<label for="paid">Collect from patron: </label> |
| 199 |
[% END %] |
241 |
[% END %] |
| 200 |
<!-- default to paying all --> |
242 |
<!-- default to paying all --> |
| 201 |
<input name="paid" id="paid" value="[% total | format('%.2f') %]" /> |
243 |
<input name="paid" id="paid" value="[% total | $Price %]"/> |
| 202 |
</li> |
244 |
</li> |
|
|
245 |
[% END %] |
| 203 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
246 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
| 204 |
[% IF payment_types %] |
247 |
[% IF payment_types %] |
| 205 |
<li> |
248 |
<li> |
|
Lines 238-246
Link Here
|
| 238 |
[% Asset.js("js/members-menu.js") | $raw %] |
281 |
[% Asset.js("js/members-menu.js") | $raw %] |
| 239 |
<script type= "text/javascript"> |
282 |
<script type= "text/javascript"> |
| 240 |
$(document).ready(function() { |
283 |
$(document).ready(function() { |
| 241 |
$('#payindivfine, #payfine').preventDoubleFormSubmit(); |
284 |
$('#payindivfine, #payfine, #payform').preventDoubleFormSubmit(); |
| 242 |
$("#paid").on("change",function(){ |
285 |
$("#paid").on("change",function(){ |
| 243 |
moneyFormat( this ); |
286 |
moneyFormat( this ); |
|
|
287 |
updateChangeInput(); |
| 288 |
}); |
| 289 |
$("#collected").on("change",function(){ |
| 290 |
moneyFormat( this ); |
| 291 |
updateChangeInput(); |
| 244 |
}); |
292 |
}); |
| 245 |
}); |
293 |
}); |
| 246 |
|
294 |
|
|
Lines 310-315
Link Here
|
| 310 |
|
358 |
|
| 311 |
textObj.value = dolAmount + "." + decAmount; |
359 |
textObj.value = dolAmount + "." + decAmount; |
| 312 |
} |
360 |
} |
|
|
361 |
|
| 362 |
function updateChangeInput() { |
| 363 |
var change = $('#change')[0]; |
| 364 |
change.value = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100; |
| 365 |
|
| 366 |
if (change.value < 0) { |
| 367 |
change.value = change.defaultValue; |
| 368 |
} else { |
| 369 |
moneyFormat(change); |
| 370 |
} |
| 371 |
} |
| 313 |
</script> |
372 |
</script> |
| 314 |
[% END %] |
373 |
[% END %] |
| 315 |
|
374 |
|