79 lines
2.4 KiB
Plaintext
79 lines
2.4 KiB
Plaintext
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE Koha %]
|
|
[% PROCESS 'i18n.inc' %]
|
|
[% SET footerjs = 1 %]
|
|
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title
|
|
>[% FILTER collapse %]
|
|
[% t("Print receipt") | html %]
|
|
[% END %]</title
|
|
>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
|
|
|
|
[% Asset.css("css/printreceiptinvoice.css") | $raw %] <!-- prettier-ignore-start -->
|
|
[% IF style %]<style nonce="[% Koha.CSPNonce | $raw %]">[% style | $raw %]</style>[% END %]
|
|
<!-- prettier-ignore-end -->
|
|
[% INCLUDE 'blocking_errors.inc' %]
|
|
</head>
|
|
|
|
<body id="pat_printfeercpt" class="pat">
|
|
|
|
<div id="receipt">
|
|
[% IF slip %]
|
|
[% IF plain %]
|
|
<pre>
|
|
[% slip | html %]
|
|
</pre
|
|
>
|
|
[% ELSE %]
|
|
[% slip | $raw %]
|
|
[% END %]
|
|
[% ELSE %]
|
|
<span>No print template found</span>
|
|
[% END %]
|
|
</div>
|
|
|
|
[% IF error_msg %]
|
|
<div class="alert alert-danger">
|
|
<p>[% error_msg | html %]</p>
|
|
<button id="close-window" class="btn btn-secondary" onclick="window.close();"> [% t("Close") | html %] </button>
|
|
</div>
|
|
[% ELSE %]
|
|
<div class="no-print" style="margin-top: 20px; text-align: center;">
|
|
<button id="print-receipt" class="btn btn-primary"> <i class="fa fa-print"></i> [% t("Print receipt") | html %] </button>
|
|
<button id="close-window" class="btn btn-secondary" onclick="window.close();"> [% t("Close") | html %] </button>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
<script nonce="[% Koha.CSPNonce | $raw %]">
|
|
[% IF ( Koha.Preference('IntranetSlipPrinterJS') ) %]
|
|
[% Koha.Preference('IntranetSlipPrinterJS') | $raw %]
|
|
[% ELSE %]
|
|
function doPrint() {
|
|
window.print();
|
|
}
|
|
|
|
window.onafterprint = () => {
|
|
window.close();
|
|
};
|
|
|
|
window.addEventListener('load', () => {
|
|
if ( [% autoprint | html %] == 1 ) {
|
|
doPrint();
|
|
}
|
|
});
|
|
|
|
document.getElementById('print-receipt')
|
|
.addEventListener('click', doPrint);
|
|
[% END %]
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|