3 # Copyright Koustubha Kale 2010
4 # Copyright PTFS Europe 2020
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # Koha is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Koha; if not, see <http://www.gnu.org/licenses>.
27 use Koha::Account::Lines;
31 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33 template_name => "members/printfeercpt.tt",
37 borrowers => 'edit_borrowers',
38 updatecharges => 'remaining_permissions'
43 my $credit_id = $input->param('accountlines_id');
44 my $credit = Koha::Account::Lines->find($credit_id);
45 my $patron = $credit->patron;
47 my $logged_in_user = Koha::Patrons->find($loggedinuser) or die "Not logged in";
48 output_and_exit_if_error(
53 logged_in_user => $logged_in_user,
54 current_patron => $patron
58 my $letter = C4::Letters::GetPreparedLetter(
59 module => 'circulation',
60 letter_code => 'ACCOUNT_CREDIT',
61 branchcode => C4::Context::mybranch,
62 message_transport_type => 'print',
63 lang => $patron->lang,
65 credits => $credit_id,
66 borrowers => $patron->borrowernumber
69 tendered => scalar $input->param('tendered'),
70 change => scalar $input->param('change')
75 slip => $letter->{content},
76 plain => !$letter->{is_html},
80 output_html_with_http_headers $input, $cookie, $template->output;