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

(-)a/C4/Letters.pm (+25 lines)
Lines 31-36 use Try::Tiny; Link Here
31
use C4::Members;
31
use C4::Members;
32
use C4::Log;
32
use C4::Log;
33
use C4::SMS;
33
use C4::SMS;
34
use C4::Templates;
34
use C4::Debug;
35
use C4::Debug;
35
use Koha::DateUtils;
36
use Koha::DateUtils;
36
use Koha::SMS::Providers;
37
use Koha::SMS::Providers;
Lines 751-758 sub _parseletter_sth { Link Here
751
    #       broke things for the rest of us. prepare_cached is a better
752
    #       broke things for the rest of us. prepare_cached is a better
752
    #       way to cache statement handles anyway.
753
    #       way to cache statement handles anyway.
753
    my $query = 
754
    my $query = 
755
    ($table eq 'accountlines' )    ? "SELECT * FROM $table WHERE   accountlines_id = ?"                               :
754
    ($table eq 'biblio'       )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
756
    ($table eq 'biblio'       )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
755
    ($table eq 'biblioitems'  )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
757
    ($table eq 'biblioitems'  )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
758
    ($table eq 'credits'      )    ? "SELECT * FROM accountlines WHERE   accountlines_id = ?"                         :
759
    ($table eq 'debits'       )    ? "SELECT * FROM accountlines WHERE   accountlines_id = ?"                         :
756
    ($table eq 'items'        )    ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
760
    ($table eq 'items'        )    ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
757
    ($table eq 'issues'       )    ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
761
    ($table eq 'issues'       )    ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
758
    ($table eq 'old_issues'   )    ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1"  :
762
    ($table eq 'old_issues'   )    ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1"  :
Lines 1487-1492 sub _process_tt { Link Here
1487
    my $loops = $params->{loops};
1491
    my $loops = $params->{loops};
1488
    my $substitute = $params->{substitute} || {};
1492
    my $substitute = $params->{substitute} || {};
1489
1493
1494
    my $htdocs = C4::Context->config('intrahtdocs');
1495
    my ($theme, $lang, $activethemes)= C4::Templates::themelanguage( $htdocs, 'about.tt', 'intranet');
1496
    my @includes;
1497
    foreach (@$activethemes) {
1498
        push @includes, "$htdocs/$_/$lang/includes";
1499
        push @includes, "$htdocs/$_/en/includes" unless $lang eq 'en';
1500
    }
1501
1490
    my $use_template_cache = C4::Context->config('template_cache_dir') && defined $ENV{GATEWAY_INTERFACE};
1502
    my $use_template_cache = C4::Context->config('template_cache_dir') && defined $ENV{GATEWAY_INTERFACE};
1491
    my $template           = Template->new(
1503
    my $template           = Template->new(
1492
        {
1504
        {
Lines 1495-1500 sub _process_tt { Link Here
1495
            PLUGIN_BASE  => 'Koha::Template::Plugin',
1507
            PLUGIN_BASE  => 'Koha::Template::Plugin',
1496
            COMPILE_EXT  => $use_template_cache ? '.ttc' : '',
1508
            COMPILE_EXT  => $use_template_cache ? '.ttc' : '',
1497
            COMPILE_DIR  => $use_template_cache ? C4::Context->config('template_cache_dir') : '',
1509
            COMPILE_DIR  => $use_template_cache ? C4::Context->config('template_cache_dir') : '',
1510
            INCLUDE_PATH => \@includes,
1498
            FILTERS      => {},
1511
            FILTERS      => {},
1499
            ENCODING     => 'UTF-8',
1512
            ENCODING     => 'UTF-8',
1500
        }
1513
        }
Lines 1548-1553 sub _get_tt_params { Link Here
1548
            plural   => 'branches',
1561
            plural   => 'branches',
1549
            pk       => 'branchcode',
1562
            pk       => 'branchcode',
1550
        },
1563
        },
1564
        credits => {
1565
            module => 'Koha::Account::Lines',
1566
            singular => 'credit',
1567
            plural => 'credits',
1568
            pk => 'accountlines_id',
1569
        },
1570
        debits => {
1571
            module => 'Koha::Account::Lines',
1572
            singular => 'debit',
1573
            plural => 'debits',
1574
            pk => 'accountlines_id',
1575
        },
1551
        items => {
1576
        items => {
1552
            module   => 'Koha::Items',
1577
            module   => 'Koha::Items',
1553
            singular => 'item',
1578
            singular => 'item',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt (-6 / +15 lines)
Lines 1-16 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
[% PROCESS 'accounts.inc' %]
10
11
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
12
<title>Print receipt for [% patron.cardnumber | html %]</title>
7
<title>Print receipt for [% patron.cardnumber | html %]</title>
13
[% 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
14
[% Asset.css("css/printreceiptinvoice.css") | $raw %]
13
[% Asset.css("css/printreceiptinvoice.css") | $raw %]
15
[% INCLUDE 'blocking_errors.inc' %]
14
[% INCLUDE 'blocking_errors.inc' %]
16
</head>
15
</head>
Lines 18-24 Link Here
18
<body id="pat_printfeercpt" class="pat">
17
<body id="pat_printfeercpt" class="pat">
19
18
20
<div id="receipt">
19
<div id="receipt">
21
    [% 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 %]
22
</div>
31
</div>
23
32
24
[% MACRO jsinclude BLOCK %]
33
[% MACRO jsinclude BLOCK %]
(-)a/members/printfeercpt.pl (-8 / +14 lines)
Lines 55-69 output_and_exit_if_error( Link Here
55
    }
55
    }
56
);
56
);
57
57
58
my $letter = C4::Letters::getletter( 'circulation', 'ACCOUNT_CREDIT',
58
my $letter = C4::Letters::GetPreparedLetter(
59
    C4::Context::mybranch, 'print', $patron->lang );
59
    module                 => 'circulation',
60
    letter_code            => 'ACCOUNT_CREDIT',
61
    branchcode             => C4::Context::mybranch,
62
    message_transport_type => 'print',
63
    lang                   => $patron->lang,
64
    tables                 => { 'credits' => $credit_id },
65
    substitute             => {
66
        tendered => scalar $input->param('tendered'),
67
        change   => scalar $input->param('change')
68
    }
69
);
60
70
61
$template->param(
71
$template->param(
62
    letter => $letter,
72
    slip => $letter->{content},
63
    credit => $credit,
73
    plain => !$letter->{is_html}
64
65
    tendered => scalar $input->param('tendered'),
66
    change   => scalar $input->param('change')
67
);
74
);
68
75
69
output_html_with_http_headers $input, $cookie, $template->output;
76
output_html_with_http_headers $input, $cookie, $template->output;
70
- 

Return to bug 24381