Bug 18405: Self checkout: Fix broken silent printing

Fix broken 'silent printing' (without printer dialog) in self checkout.

To reproduce:
Set up silent printing to slip printers as described in:
https://wiki.koha-community.org/wiki/Setting_up_slip_printer_to_print_silently

Verify that it works for check-outs in staff client.
Verify that it does not work in Self checkout.

To test:
Apply patch
Verify that silent printing works on SCO

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Marc Véron 2017-04-09 16:58:21 +02:00 committed by Kyle M Hall
parent e96f39ab52
commit a0cc3703bf
2 changed files with 19 additions and 7 deletions

View file

@ -0,0 +1,10 @@
<script type="text/javascript">
[% IF ( Koha.Preference('IntranetSlipPrinterJS') ) %]
[% Koha.Preference('IntranetSlipPrinterJS') %]
[% ELSE %]
$( window ).load(function() {
window.print();
setTimeout('window.close()', 1);
});
[% END %]
</script>

View file

@ -1,3 +1,4 @@
[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] &rsaquo; Self checkout &rsaquo; Print Receipt for [% borrowernumber %]</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@ -6,15 +7,16 @@
[% IF stylesheet %]
<link rel="stylesheet" type="text/css" href="[% stylesheet %]" />
[% END %]
<script type="text/javascript">
function printThenClose() {
window.print();
setTimeout('window.close()', 1);
}
</script>
<!-- JavaScript includes -->
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/jquery.js"></script>
<script type="text/javascript" src="[% interface %]/[% theme %]/js/global.js"></script>
[% INCLUDE 'slip-print.inc' %]
</head>
<body id="circ_printslip" class="circ" onload="printThenClose();">
<body id="circ_printslip" class="circ">
<div id="receipt">
[% IF plain %]
<pre>