View | Details | Raw Unified | Return to bug 28374
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/printreceipt.tt (-4 / +15 lines)
Lines 1-14 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE KohaDates %]
5
[% USE Branches %]
6
[% USE Price %]
7
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
8
5
9
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
10
<title>Print receipt</title>
7
<title>Print receipt</title>
11
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
9
10
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
12
12
[% Asset.css("css/printreceiptinvoice.css") | $raw %]
13
[% Asset.css("css/printreceiptinvoice.css") | $raw %]
13
[% INCLUDE 'blocking_errors.inc' %]
14
[% INCLUDE 'blocking_errors.inc' %]
14
</head>
15
</head>
Lines 16-22 Link Here
16
<body id="pat_printfeercpt" class="pat">
17
<body id="pat_printfeercpt" class="pat">
17
18
18
<div id="receipt">
19
<div id="receipt">
19
    [% letter.content | $raw | evaltt %]
20
  [% IF slip %]
21
    [% IF plain %]
22
    <pre>
23
      [% slip | html %]
24
    </pre>
25
    [% ELSE %]
26
      [% slip | $raw %]
27
    [% END %]
28
  [% ELSE %]
29
    No print template found
30
  [% END %]
20
</div>
31
</div>
21
32
22
[% MACRO jsinclude BLOCK %]
33
[% MACRO jsinclude BLOCK %]
(-)a/pos/printreceipt.pl (-16 / +18 lines)
Lines 31-39 my $input = CGI->new; Link Here
31
31
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {
33
    {
34
        template_name   => "pos/printreceipt.tt",
34
        template_name => "pos/printreceipt.tt",
35
        query           => $input,
35
        query         => $input,
36
        type            => "intranet",
36
        type          => "intranet",
37
    }
37
    }
38
);
38
);
39
39
Lines 53-74 output_and_exit_if_error( Link Here
53
) if $patron;    # Payment could have been anonymous
53
) if $patron;    # Payment could have been anonymous
54
54
55
my $lang = $patron ? $patron->lang : $template->lang;
55
my $lang = $patron ? $patron->lang : $template->lang;
56
my $letter = Koha::Notice::Templates->find_effective_template(
56
my $letter = C4::Letters::GetPreparedLetter(
57
    {
57
    module                 => 'pos',
58
        module                 => 'pos',
58
    letter_code            => 'RECEIPT',
59
        code                   => 'RECEIPT',
59
    branchcode             => C4::Context::mybranch,
60
        branchcode             => C4::Context::mybranch,
60
    message_transport_type => 'print',
61
        message_transport_type => 'print',
61
    lang                   => $lang,
62
        lang                   => $lang
62
    tables                 => {
63
        credits   => $payment_id,
64
        borrowers => $patron ? $patron->borrowernumber : undef
65
    },
66
    substitute => {
67
        tendered => scalar $input->param('tendered'),
68
        change   => scalar $input->param('change')
63
    }
69
    }
64
);
70
);
65
71
66
$template->param(
72
$template->param(
67
    letter  => $letter,
73
    slip  => $letter->{content},
68
    payment => $payment,
74
    plain => !$letter->{is_html}
69
70
    tendered => scalar $input->param('tendered'),
71
    change   => scalar $input->param('change')
72
);
75
);
73
76
74
output_html_with_http_headers $input, $cookie, $template->output;
77
output_html_with_http_headers $input, $cookie, $template->output;
75
- 

Return to bug 28374