|
Lines 51-57
Link Here
|
| 51 |
<div class="alert alert-info audio-alert-action"> |
51 |
<div class="alert alert-info audio-alert-action"> |
| 52 |
<p>Payment received</p> |
52 |
<p>Payment received</p> |
| 53 |
<p> |
53 |
<p> |
| 54 |
<a target="_blank" href="/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&collected=[% collected | uri %]&change=[% change | uri %]" class="btn btn-default" |
54 |
<a target="_blank" href="/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&tendered=[% tendered | uri %]&change=[% change | uri %]" class="btn btn-default" |
| 55 |
><i class="fa fa-print"></i> Print receipt</a |
55 |
><i class="fa fa-print"></i> Print receipt</a |
| 56 |
> |
56 |
> |
| 57 |
<a href="#" data-bs-toggle="modal" data-bs-target="#emailReceiptModal" class="btn btn-default"><i class="fa-solid fa-envelope"></i> Email receipt</a> |
57 |
<a href="#" data-bs-toggle="modal" data-bs-target="#emailReceiptModal" class="btn btn-default"><i class="fa-solid fa-envelope"></i> Email receipt</a> |
|
Lines 138-145
Link Here
|
| 138 |
<input type="text" inputmode="none" pattern="[0-9]*" name="paid" id="paid" value="" readonly /> |
138 |
<input type="text" inputmode="none" pattern="[0-9]*" name="paid" id="paid" value="" readonly /> |
| 139 |
</li> |
139 |
</li> |
| 140 |
<li> |
140 |
<li> |
| 141 |
<label for="collected" class="required">Amount tendered: </label> |
141 |
<label for="tendered" class="required">Amount tendered: </label> |
| 142 |
<input type="text" inputmode="numeric" pattern="[0-9]*" name="collected" id="collected" value="" class="required" required="required" /> |
142 |
<input type="text" inputmode="numeric" pattern="[0-9]*" name="tendered" id="tendered" value="" class="required" required="required" /> |
| 143 |
<span class="required">Required</span> |
143 |
<span class="required">Required</span> |
| 144 |
</li> |
144 |
</li> |
| 145 |
<li> |
145 |
<li> |
|
Lines 181-187
Link Here
|
| 181 |
<form id="email_form" action="/cgi-bin/koha/pos/pay.pl" method="post" enctype="multipart/form-data" class="validated"> |
181 |
<form id="email_form" action="/cgi-bin/koha/pos/pay.pl" method="post" enctype="multipart/form-data" class="validated"> |
| 182 |
[% INCLUDE 'csrf-token.inc' %] |
182 |
[% INCLUDE 'csrf-token.inc' %] |
| 183 |
<input type="hidden" name="payment_id" value="[% payment_id | uri %]" /> |
183 |
<input type="hidden" name="payment_id" value="[% payment_id | uri %]" /> |
| 184 |
<input type="hidden" name="collected" value="[% collected | uri %]" /> |
184 |
<input type="hidden" name="tendered" value="[% tendered | uri %]" /> |
| 185 |
<input type="hidden" name="change" value="[% change | uri %]" />" |
185 |
<input type="hidden" name="change" value="[% change | uri %]" />" |
| 186 |
<div class="modal-dialog"> |
186 |
<div class="modal-dialog"> |
| 187 |
<div class="modal-content"> |
187 |
<div class="modal-content"> |
|
Lines 316-326
Link Here
|
| 316 |
function updateChangeValues() { |
316 |
function updateChangeValues() { |
| 317 |
var change = $('#change')[0]; |
317 |
var change = $('#change')[0]; |
| 318 |
var zero_formatted = "[% 0 | $Price %]"; |
318 |
var zero_formatted = "[% 0 | $Price %]"; |
| 319 |
change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100; |
319 |
change.innerHTML = Math.round(($('#tendered')[0].value - $('#paid')[0].value) * 100) / 100; |
| 320 |
if (change.innerHTML <= 0) { |
320 |
if (change.innerHTML <= 0) { |
| 321 |
var paid = $('#paid')[0]; |
321 |
var paid = $('#paid')[0]; |
| 322 |
moneyFormat(paid); |
322 |
moneyFormat(paid); |
| 323 |
$('#collected').rules( "add", { min: Number(paid.value) }); |
323 |
$('#tendered').rules( "add", { min: Number(paid.value) }); |
| 324 |
change.innerHTML = zero_formatted; |
324 |
change.innerHTML = zero_formatted; |
| 325 |
$(':input[name="change"]').val(zero_formatted); |
325 |
$(':input[name="change"]').val(zero_formatted); |
| 326 |
} else { |
326 |
} else { |
|
Lines 456-462
Link Here
|
| 456 |
|
456 |
|
| 457 |
// Change calculation and modal |
457 |
// Change calculation and modal |
| 458 |
var change = $('#change')[0]; |
458 |
var change = $('#change')[0]; |
| 459 |
$("#paid, #collected").on("change",function() { |
459 |
$("#paid, #tendered").on("change",function() { |
| 460 |
moneyFormat( this ); |
460 |
moneyFormat( this ); |
| 461 |
if (change != undefined) { |
461 |
if (change != undefined) { |
| 462 |
updateChangeValues(); |
462 |
updateChangeValues(); |
|
Lines 474-480
Link Here
|
| 474 |
paid: { |
474 |
paid: { |
| 475 |
required: true |
475 |
required: true |
| 476 |
}, |
476 |
}, |
| 477 |
collected: { |
477 |
tendered: { |
| 478 |
required: true |
478 |
required: true |
| 479 |
}, |
479 |
}, |
| 480 |
payment_type: { |
480 |
payment_type: { |
|
Lines 518-524
Link Here
|
| 518 |
|
518 |
|
| 519 |
[% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %] |
519 |
[% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %] |
| 520 |
$("#printReceipt").click(function() { |
520 |
$("#printReceipt").click(function() { |
| 521 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&collected=[% collected | uri %]&change=[% change | uri %]', '_blank'); |
521 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&tendered=[% tendered | uri %]&change=[% change | uri %]', '_blank'); |
| 522 |
win.focus(); |
522 |
win.focus(); |
| 523 |
}); |
523 |
}); |
| 524 |
$("#printReceipt").click(); |
524 |
$("#printReceipt").click(); |