|
Lines 99-107
Link Here
|
| 99 |
<ol> |
99 |
<ol> |
| 100 |
|
100 |
|
| 101 |
<li> |
101 |
<li> |
| 102 |
<label for="paid">Collect from patron: </label> |
102 |
<label for="paid">Amount paid: </label> |
| 103 |
<!-- default to paying all --> |
103 |
<input name="paid" id="paid" value="[% amountoutstanding | $Price %]"/> |
| 104 |
<input name="paid" id="paid" value="[% amountoutstanding | html %]" type="text" /> |
104 |
</li> |
|
|
105 |
<li> |
| 106 |
<label for="collected">Collect from patron: </label> |
| 107 |
<input id="collected" value="[% amountoutstanding | $Price %]"/> |
| 108 |
</li> |
| 109 |
<li> |
| 110 |
<label>Change to give: </label> |
| 111 |
<span id="change">0.00</span> |
| 105 |
</li> |
112 |
</li> |
| 106 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
113 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
| 107 |
[% IF payment_types %] |
114 |
[% IF payment_types %] |
|
Lines 192-204
Link Here
|
| 192 |
<span class="debit">[% total | format('%.2f') %]</span> |
199 |
<span class="debit">[% total | format('%.2f') %]</span> |
| 193 |
</li> |
200 |
</li> |
| 194 |
<li> |
201 |
<li> |
|
|
202 |
<label for="paid">Amount paid :</label> |
| 203 |
<input name="paid" id="paid" value="[% total | $Price %]"/> |
| 204 |
</li> |
| 205 |
<li> |
| 195 |
[% IF type == 'writeoff' %] |
206 |
[% IF type == 'writeoff' %] |
| 196 |
<label for="paid">Writeoff amount: </label> |
207 |
<label for="collected">Writeoff amount: </label> |
| 197 |
[% ELSE %] |
208 |
[% ELSE %] |
| 198 |
<label for="paid">Collect from patron: </label> |
209 |
<label for="collected">Collect from patron: </label> |
| 199 |
[% END %] |
210 |
[% END %] |
| 200 |
<!-- default to paying all --> |
211 |
<input id="collected" value="[% total | $Price %]"/> |
| 201 |
<input name="paid" id="paid" value="[% total | format('%.2f') %]" type="text" /> |
212 |
</li> |
|
|
213 |
<li> |
| 214 |
<label>Change to give: </label> |
| 215 |
<span id="change">0.00</span> |
| 202 |
</li> |
216 |
</li> |
| 203 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
217 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
| 204 |
[% IF payment_types %] |
218 |
[% IF payment_types %] |
|
Lines 233-246
Link Here
|
| 233 |
</div> |
247 |
</div> |
| 234 |
</div> |
248 |
</div> |
| 235 |
|
249 |
|
|
|
250 |
<!-- Modal --> |
| 251 |
<a class="hidden" href="#confirm_change_form" data-toggle="modal"></a> |
| 252 |
<div id="confirm_change_form" class="modal" tabindex="-1" role="dialog" aria-hidden="true"> |
| 253 |
<div class="modal-dialog"> |
| 254 |
<div class="modal-content"> |
| 255 |
<div class="modal-header"> |
| 256 |
<h3>Amount collected higher than paid</h3> |
| 257 |
</div> |
| 258 |
<div class="modal-body"> |
| 259 |
<p>The amount collected from the patron is higher than the amount paid.</p> |
| 260 |
<p>The change to give is <b><span id="modal_change">0.00</span></b>.</p> |
| 261 |
<p>Do you still confirm the payment?</p> |
| 262 |
</div> |
| 263 |
<div class="modal-footer"> |
| 264 |
<button class="btn btn-default approve" id="modal_submit" type="button"><i class="fa fa-check"></i> Yes</button> |
| 265 |
<button class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> No</button> |
| 266 |
</div> |
| 267 |
</div> |
| 268 |
</div> |
| 269 |
</div> |
| 270 |
|
| 236 |
[% MACRO jsinclude BLOCK %] |
271 |
[% MACRO jsinclude BLOCK %] |
| 237 |
[% INCLUDE 'str/members-menu.inc' %] |
272 |
[% INCLUDE 'str/members-menu.inc' %] |
| 238 |
[% Asset.js("js/members-menu.js") | $raw %] |
273 |
[% Asset.js("js/members-menu.js") | $raw %] |
| 239 |
<script type= "text/javascript"> |
274 |
<script type= "text/javascript"> |
| 240 |
$(document).ready(function() { |
275 |
$(document).ready(function() { |
|
|
276 |
var forms = $('#payindivfine, #payfine'); |
| 277 |
var change = $('#change')[0]; |
| 278 |
|
| 241 |
$('#payindivfine, #payfine').preventDoubleFormSubmit(); |
279 |
$('#payindivfine, #payfine').preventDoubleFormSubmit(); |
| 242 |
$("#paid").on("change",function(){ |
280 |
$("#paid, #collected").on("change",function() { |
| 243 |
moneyFormat( this ); |
281 |
moneyFormat( this ); |
|
|
282 |
if (change != undefined) { |
| 283 |
updateChangeValues(); |
| 284 |
} |
| 285 |
}); |
| 286 |
|
| 287 |
if (change != undefined) { |
| 288 |
forms.bind('submit', function(e) { |
| 289 |
if (change.innerHTML > 0.00) { |
| 290 |
e.preventDefault(); |
| 291 |
$('a[href="#confirm_change_form"]').click(); |
| 292 |
} |
| 293 |
}); |
| 294 |
} |
| 295 |
|
| 296 |
$('#modal_submit').click(function() { |
| 297 |
forms[0].submit(); |
| 244 |
}); |
298 |
}); |
| 245 |
}); |
299 |
}); |
| 246 |
|
300 |
|
|
Lines 310-315
Link Here
|
| 310 |
|
364 |
|
| 311 |
textObj.value = dolAmount + "." + decAmount; |
365 |
textObj.value = dolAmount + "." + decAmount; |
| 312 |
} |
366 |
} |
|
|
367 |
|
| 368 |
function updateChangeValues() { |
| 369 |
var change = $('#change')[0]; |
| 370 |
change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100; |
| 371 |
if (change.innerHTML <= 0) { |
| 372 |
change.innerHTML = "0.00"; |
| 373 |
} else { |
| 374 |
change.value = change.innerHTML; |
| 375 |
moneyFormat(change); |
| 376 |
change.innerHTML = change.value; |
| 377 |
} |
| 378 |
|
| 379 |
$('#modal_change').html(change.innerHTML); |
| 380 |
} |
| 313 |
</script> |
381 |
</script> |
| 314 |
[% END %] |
382 |
[% END %] |
| 315 |
|
383 |
|
| 316 |
- |
|
|