@@ -, +, @@ i. Enable EnablePointOfSale and UseCashRegisters system preferences ii. Add a new cash register (Administration > Accounting > Cash registers) iii. Add one or two products for sale (Administration > Accounting > Debit types, make sure 'Can be sold?' is ticked) --- .../prog/en/modules/pos/printreceipt.tt | 19 ++++++++--- pos/printreceipt.pl | 33 ++++++++++--------- 2 files changed, 33 insertions(+), 19 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/printreceipt.tt +++ a/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' %] Print receipt [% INCLUDE 'doc-head-close.inc' %] + + + + [% Asset.css("css/printreceiptinvoice.css") | $raw %] [% INCLUDE 'blocking_errors.inc' %] @@ -16,7 +17,17 @@
- [% letter.content | $raw | evaltt %] + [% IF slip %] + [% IF plain %] +
+      [% slip | html %]
+    
+ [% ELSE %] + [% slip | $raw %] + [% END %] + [% ELSE %] + No print template found + [% END %]
[% MACRO jsinclude BLOCK %] --- a/pos/printreceipt.pl +++ a/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 => { + collected => scalar $input->param('collected'), + 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; --