Bugzilla – Attachment 127367 Details for
Bug 28374
Convert pos/printreceipt.pl to use GetPreparedLetter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28374: Convert printreceipt to use GetPreparedLetter
Bug-28374-Convert-printreceipt-to-use-GetPreparedL.patch (text/plain), 3.76 KB, created by
Martin Renvoize (ashimema)
on 2021-11-05 14:55:13 UTC
(
hide
)
Description:
Bug 28374: Convert printreceipt to use GetPreparedLetter
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-05 14:55:13 UTC
Size:
3.76 KB
patch
obsolete
>From a705a9cad1c074cd29bd62b12c1b983e838446db Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 18 May 2021 16:15:53 +0100 >Subject: [PATCH] Bug 28374: Convert printreceipt to use GetPreparedLetter > >This patch converts the point of sale receipt printer controller to >using GetPreparedLetter instead of calling getletter directly. > >Test plan >1/ Try printing a point of sale receipt before and after applying the >patch >2/ No change should result. > >https://bugs.koha-community.org/show_bug.cgi?id=28374 >--- > .../prog/en/modules/pos/printreceipt.tt | 19 ++++++++--- > pos/printreceipt.pl | 33 ++++++++++--------- > 2 files changed, 33 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/printreceipt.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/printreceipt.tt >index 4aa936de8e..f0f7180be4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/printreceipt.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/printreceipt.tt >@@ -1,14 +1,15 @@ > [% USE raw %] > [% USE Asset %] > [% USE Koha %] >-[% USE KohaDates %] >-[% USE Branches %] >-[% USE Price %] > [% SET footerjs = 1 %] > > [% INCLUDE 'doc-head-open.inc' %] > <title>Print receipt</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 %] > [% INCLUDE 'blocking_errors.inc' %] > </head> >@@ -16,7 +17,17 @@ > <body id="pat_printfeercpt" class="pat"> > > <div id="receipt"> >- [% letter.content | $raw | evaltt %] >+ [% IF slip %] >+ [% IF plain %] >+ <pre> >+ [% slip | html %] >+ </pre> >+ [% ELSE %] >+ [% slip | $raw %] >+ [% END %] >+ [% ELSE %] >+ No print template found >+ [% END %] > </div> > > [% MACRO jsinclude BLOCK %] >diff --git a/pos/printreceipt.pl b/pos/printreceipt.pl >index 02505595c4..044d7aace1 100755 >--- a/pos/printreceipt.pl >+++ b/pos/printreceipt.pl >@@ -29,9 +29,9 @@ my $input = CGI->new; > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >- template_name => "pos/printreceipt.tt", >- query => $input, >- type => "intranet", >+ template_name => "pos/printreceipt.tt", >+ query => $input, >+ type => "intranet", > } > ); > >@@ -51,22 +51,25 @@ output_and_exit_if_error( > ) if $patron; # Payment could have been anonymous > > my $lang = $patron ? $patron->lang : $template->lang; >-my $letter = Koha::Notice::Templates->find_effective_template( >- { >- module => 'pos', >- code => 'RECEIPT', >- branchcode => C4::Context::mybranch, >- message_transport_type => 'print', >- lang => $lang >+my $letter = C4::Letters::GetPreparedLetter( >+ module => 'pos', >+ letter_code => 'RECEIPT', >+ branchcode => C4::Context::mybranch, >+ message_transport_type => 'print', >+ lang => $lang, >+ tables => { >+ credits => $payment_id, >+ borrowers => $patron ? $patron->borrowernumber : undef >+ }, >+ substitute => { >+ tendered => scalar $input->param('tendered'), >+ change => scalar $input->param('change') > } > ); > > $template->param( >- letter => $letter, >- payment => $payment, >- >- tendered => scalar $input->param('tendered'), >- change => scalar $input->param('change') >+ slip => $letter->{content}, >+ plain => !$letter->{is_html} > ); > > output_html_with_http_headers $input, $cookie, $template->output; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28374
:
121116
|
121117
|
122613
|
127367
|
127368
|
127415
|
127434
|
127435
|
127438
|
127439
|
127549
|
127550
|
127551