Bug 41563: Tidy kohaTable - acqui/invoice.tt

See bug 41324 comment 6
1. Variable serialization

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-06 16:27:54 +01:00 committed by Lucas Gass
parent e987e7f4c9
commit 68219779d0
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 13 additions and 5 deletions

View File

@ -576,16 +576,24 @@
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/modals/edifact-modal.js") | $raw %]
<script>
addPrefs({
AcqEnableFiles: [% Koha.Preference('AcqEnableFiles') ? 1 : 0 | html %],
});
const invoiceincgst = [% invoiceincgst ? 1 : 0 | html %];
const has_files = [% files ? 1 : 0 | html %];
</script>
<script>
function updateColumnsVisibility(visible) {
if ( visible ) {
$("table .tax_excluded, .tax_included").show();
} else {
[% IF ( invoiceincgst ) %]
if (invoiceincgst){
$("table .tax_excluded").hide();
[% ELSE %]
} else {
$("table .tax_included").hide();
[% END %]
}
}
}
@ -596,14 +604,14 @@
searching: false,
dom: "t",
});
[% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
if (prefs.AcqEnableFiles && has_files){
$("#invoice_files_table").kohaTable({
info: false,
paging: false,
searching: false,
dom: "t",
});
[% END %]
}
$("#show_all_details").click(function(){
updateColumnsVisibility( $(this).is(":checked") );
});