Lines 1-5
Link Here
|
1 |
[% USE Koha %] |
1 |
[% USE Koha %] |
2 |
[% USE Branches %] |
2 |
[% USE Branches %] |
|
|
3 |
[% USE Price %] |
3 |
[% SET footerjs = 1 %] |
4 |
[% SET footerjs = 1 %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
<title>Koha › Patrons › Collect fine payment for [% patron.firstname %] [% patron.surname %]</title> |
6 |
<title>Koha › Patrons › Collect fine payment for [% patron.firstname %] [% patron.surname %]</title> |
Lines 105-110
Link Here
|
105 |
<input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" /> |
106 |
<input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" /> |
106 |
<input type="hidden" name="title" id="title" value="[% title %]" /> |
107 |
<input type="hidden" name="title" id="title" value="[% title %]" /> |
107 |
<input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" /> |
108 |
<input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" /> |
|
|
109 |
<input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" /> |
110 |
<input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" /> |
108 |
<table> |
111 |
<table> |
109 |
<thead><tr> |
112 |
<thead><tr> |
110 |
<th>Description</th> |
113 |
<th>Description</th> |
Lines 125-136
Link Here
|
125 |
<li> |
128 |
<li> |
126 |
<label for="paid">Writeoff amount: </label> |
129 |
<label for="paid">Writeoff amount: </label> |
127 |
<!-- default to writing off all --> |
130 |
<!-- default to writing off all --> |
128 |
<input name="amountwrittenoff" id="amountwrittenoff" value="[% amountoutstanding %]" /> |
131 |
<input name="amountwrittenoff" id="amountwrittenoff" value="[% amountoutstanding | $Price %]" /> |
129 |
</li> |
132 |
</li> |
130 |
</ol> |
133 |
</ol> |
131 |
</fieldset> |
134 |
</fieldset> |
132 |
<div class="action"><input type="submit" name="confirm_writeoff" id="confirm_writeoff" value="Write off this charge" /> |
135 |
<div class="action"> |
133 |
<a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></div> |
136 |
<input type="submit" value="Write off this charge" /> |
|
|
137 |
<a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a> |
138 |
</div> |
134 |
</form> |
139 |
</form> |
135 |
[% ELSE %] |
140 |
[% ELSE %] |
136 |
|
141 |
|
Lines 175-186
Link Here
|
175 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu_[% KOHA_VERSION %].js"></script> |
180 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu_[% KOHA_VERSION %].js"></script> |
176 |
<script type= "text/javascript"> |
181 |
<script type= "text/javascript"> |
177 |
$(document).ready(function() { |
182 |
$(document).ready(function() { |
178 |
$('#payindivfine, #woindivfine, #payfine').preventDoubleFormSubmit(); |
183 |
$('#payindivfine, #payfine').preventDoubleFormSubmit(); |
179 |
$("#paid").on("change",function(){ |
184 |
$("#paid").on("change",function(){ |
180 |
moneyFormat( this ); |
185 |
moneyFormat( this ); |
181 |
}); |
186 |
}); |
182 |
}); |
187 |
}); |
183 |
|
188 |
|
|
|
189 |
prevent_default = 1; |
190 |
$('#woindivfine').on('submit', function(e){ |
191 |
if ( prevent_default ) { |
192 |
e.preventDefault(); |
193 |
|
194 |
let amount_outstanding = parseFloat( $('#amountoutstanding').attr('value') ); |
195 |
let amount_writeoff = parseFloat( $('#amountwrittenoff').attr('value') ); |
196 |
if ( amount_writeoff > amount_outstanding ) { |
197 |
alert(_("You are attemping to writeoff more than the value of the fee.")); |
198 |
$('#woindivfine').beenSubmitted = false; |
199 |
} else { |
200 |
prevent_default = 0; |
201 |
$('#woindivfine').preventDoubleFormSubmit(); |
202 |
$('#woindivfine').submit(); |
203 |
} |
204 |
} |
205 |
}); |
206 |
|
184 |
function moneyFormat(textObj) { |
207 |
function moneyFormat(textObj) { |
185 |
var newValue = textObj.value; |
208 |
var newValue = textObj.value; |
186 |
var decAmount = ""; |
209 |
var decAmount = ""; |