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 29-37 my $input = CGI->new; Link Here
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
32
        template_name   => "pos/printreceipt.tt",
32
        template_name => "pos/printreceipt.tt",
33
        query           => $input,
33
        query         => $input,
34
        type            => "intranet",
34
        type          => "intranet",
35
    }
35
    }
36
);
36
);
37
37
Lines 51-72 output_and_exit_if_error( Link Here
51
) if $patron;    # Payment could have been anonymous
51
) if $patron;    # Payment could have been anonymous
52
52
53
my $lang = $patron ? $patron->lang : $template->lang;
53
my $lang = $patron ? $patron->lang : $template->lang;
54
my $letter = Koha::Notice::Templates->find_effective_template(
54
my $letter = C4::Letters::GetPreparedLetter(
55
    {
55
    module                 => 'pos',
56
        module                 => 'pos',
56
    letter_code            => 'RECEIPT',
57
        code                   => 'RECEIPT',
57
    branchcode             => C4::Context::mybranch,
58
        branchcode             => C4::Context::mybranch,
58
    message_transport_type => 'print',
59
        message_transport_type => 'print',
59
    lang                   => $lang,
60
        lang                   => $lang
60
    tables                 => {
61
        credits   => $payment_id,
62
        borrowers => $patron ? $patron->borrowernumber : undef
63
    },
64
    substitute => {
65
        collected => scalar $input->param('collected'),
66
        change    => scalar $input->param('change')
61
    }
67
    }
62
);
68
);
63
69
64
$template->param(
70
$template->param(
65
    letter  => $letter,
71
    slip  => $letter->{content},
66
    payment => $payment,
72
    plain => !$letter->{is_html}
67
68
    tendered => scalar $input->param('tendered'),
69
    change   => scalar $input->param('change')
70
);
73
);
71
74
72
output_html_with_http_headers $input, $cookie, $template->output;
75
output_html_with_http_headers $input, $cookie, $template->output;
73
- 

Return to bug 28374