|
Lines 2-7
Link Here
|
| 2 |
[% USE Koha %] |
2 |
[% USE Koha %] |
| 3 |
[% USE Branches %] |
3 |
[% USE Branches %] |
| 4 |
[% USE AuthorisedValues %] |
4 |
[% USE AuthorisedValues %] |
|
|
5 |
[% USE Price %] |
| 5 |
[% SET footerjs = 1 %] |
6 |
[% SET footerjs = 1 %] |
| 6 |
[% INCLUDE 'doc-head-open.inc' %] |
7 |
[% INCLUDE 'doc-head-open.inc' %] |
| 7 |
<title>Koha › Patrons › Collect fine payment for [% patron.firstname %] [% patron.surname %]</title> |
8 |
<title>Koha › Patrons › Collect fine payment for [% patron.firstname %] [% patron.surname %]</title> |
|
Lines 119-124
Link Here
|
| 119 |
<input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" /> |
120 |
<input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" /> |
| 120 |
<input type="hidden" name="title" id="title" value="[% title %]" /> |
121 |
<input type="hidden" name="title" id="title" value="[% title %]" /> |
| 121 |
<input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" /> |
122 |
<input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" /> |
|
|
123 |
<input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" /> |
| 124 |
<input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" /> |
| 122 |
<table> |
125 |
<table> |
| 123 |
<thead><tr> |
126 |
<thead><tr> |
| 124 |
<th>Description</th> |
127 |
<th>Description</th> |
|
Lines 139-150
Link Here
|
| 139 |
<li> |
142 |
<li> |
| 140 |
<label for="paid">Writeoff amount: </label> |
143 |
<label for="paid">Writeoff amount: </label> |
| 141 |
<!-- default to writing off all --> |
144 |
<!-- default to writing off all --> |
| 142 |
<input name="amountwrittenoff" id="amountwrittenoff" value="[% amountoutstanding %]" /> |
145 |
<input name="amountwrittenoff" id="amountwrittenoff" value="[% amountoutstanding | $Price %]" /> |
| 143 |
</li> |
146 |
</li> |
| 144 |
</ol> |
147 |
</ol> |
| 145 |
</fieldset> |
148 |
</fieldset> |
| 146 |
<div class="action"><input type="submit" name="confirm_writeoff" id="confirm_writeoff" value="Write off this charge" /> |
149 |
<div class="action"> |
| 147 |
<a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></div> |
150 |
<input type="submit" value="Write off this charge" /> |
|
|
151 |
<a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a> |
| 152 |
</div> |
| 148 |
</form> |
153 |
</form> |
| 149 |
[% ELSE %] |
154 |
[% ELSE %] |
| 150 |
|
155 |
|
|
Lines 201-212
Link Here
|
| 201 |
[% Asset.js("js/members-menu.js") %] |
206 |
[% Asset.js("js/members-menu.js") %] |
| 202 |
<script type= "text/javascript"> |
207 |
<script type= "text/javascript"> |
| 203 |
$(document).ready(function() { |
208 |
$(document).ready(function() { |
| 204 |
$('#payindivfine, #woindivfine, #payfine').preventDoubleFormSubmit(); |
209 |
$('#payindivfine, #payfine').preventDoubleFormSubmit(); |
| 205 |
$("#paid").on("change",function(){ |
210 |
$("#paid").on("change",function(){ |
| 206 |
moneyFormat( this ); |
211 |
moneyFormat( this ); |
| 207 |
}); |
212 |
}); |
| 208 |
}); |
213 |
}); |
| 209 |
|
214 |
|
|
|
215 |
prevent_default = 1; |
| 216 |
$('#woindivfine').on('submit', function(e){ |
| 217 |
if ( prevent_default ) { |
| 218 |
e.preventDefault(); |
| 219 |
|
| 220 |
let amount_outstanding = parseFloat( $('#amountoutstanding').attr('value') ); |
| 221 |
let amount_writeoff = parseFloat( $('#amountwrittenoff').attr('value') ); |
| 222 |
if ( amount_writeoff > amount_outstanding ) { |
| 223 |
alert(_("You are attemping to writeoff more than the value of the fee.")); |
| 224 |
$('#woindivfine').beenSubmitted = false; |
| 225 |
} else { |
| 226 |
prevent_default = 0; |
| 227 |
$('#woindivfine').preventDoubleFormSubmit(); |
| 228 |
$('#woindivfine').submit(); |
| 229 |
} |
| 230 |
} |
| 231 |
}); |
| 232 |
|
| 210 |
function moneyFormat(textObj) { |
233 |
function moneyFormat(textObj) { |
| 211 |
var newValue = textObj.value; |
234 |
var newValue = textObj.value; |
| 212 |
var decAmount = ""; |
235 |
var decAmount = ""; |