Bug 41575: Tidy kohaTable - pos/pay.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2026-01-08 14:23:53 +01:00 committed by Lucas Gass
parent 78744f7008
commit 4420daf91e
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 14 additions and 5 deletions

View File

@ -248,6 +248,17 @@
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'format_price.inc' %]
[% INCLUDE 'datatables.inc' %]
<script>
var items_table_settings = [% TablesSettings.GetTableSettings('pos', 'pay', 'invoices', 'json') | $raw %];
var zero_formatted = "[% 0 | $Price %]";
const payment_id = "[% payment_id | html %]";
const tendered = "[% tendered | html %]";
const change = "[% change | html %]";
addPrefs({
FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
});
</script>
<script>
function moneyFormat(textObj) {
var newValue = textObj.value;
@ -315,7 +326,6 @@
function updateChangeValues() {
var change = $('#change')[0];
var zero_formatted = "[% 0 | $Price %]";
change.innerHTML = Math.round(($('#tendered')[0].value - $('#paid')[0].value) * 100) / 100;
if (change.innerHTML <= 0) {
var paid = $('#paid')[0];
@ -438,7 +448,6 @@
}
});
var items_table_settings = [% TablesSettings.GetTableSettings('pos', 'pay', 'invoices', 'json') | $raw %];
var items_table = $("#invoices").kohaTable(
{
pagingType: "full",
@ -519,13 +528,13 @@
}
});
[% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
if (payment_id && prefs.FinePaymentAutoPopup){
$("#printReceipt").click(function() {
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&tendered=[% tendered | uri %]&change=[% change | uri %]', '_blank');
var win = window.open(`/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=${payment_id}&tendered=${tendered}&change=${change}`, '_blank');
win.focus();
});
$("#printReceipt").click();
[% END %]
}
});
</script>
[% END %]