use C4::Koha;
use C4::Overdues;
use Koha::Patrons;
+use Koha::Items;
use Koha::Patron::Categories;
use URI::Escape;
my $payment_id = $input->param('payment_id');
our $change_given = $input->param('change_given');
+our @renew_results = $input->multi_param('renew_result');
# get borrower details
-my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
+my $logged_in_user = Koha::Patrons->find( $loggedinuser );
our $patron = Koha::Patrons->find($borrowernumber);
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
. "&error_over=1" );
} else {
- Koha::Account->new( { patron_id => $borrowernumber } )->pay(
+ $payment_id = Koha::Account->new( { patron_id => $borrowernumber } )->pay(
{
amount => $amount,
- lines => [ scalar Koha::Account::Lines->find($accountlines_id) ],
+ lines => [ Koha::Account::Lines->find($accountlines_id) ],
type => 'WRITEOFF',
note => $payment_note,
interface => C4::Context->interface,
}
}
+# Populate an arrayref with everything we need to display any
+# renew results that occurred based on what we were passed
+my $renew_results_display = [];
+foreach my $renew_result(@renew_results) {
+ my ($itemnumber, $success, $info) = split(/,/, $renew_result);
+ my $item = Koha::Items->find($itemnumber);
+ if ($success) {
+ $info = uri_unescape($info);
+ }
+ push @{$renew_results_display}, {
+ item => $item,
+ success => $success,
+ info => $info
+ };
+}
+
$template->param(
finesview => 1,
payment_id => $payment_id,
change_given => $change_given,
+ renew_results => $renew_results_display
);
add_accounts_to_template();
Koha::Account->new( { patron_id => $borrowernumber } )->pay(
{
amount => $amount,
- lines => [ scalar Koha::Account::Lines->find($accountlines_id) ],
+ lines => [ Koha::Account::Lines->find($accountlines_id) ],
type => 'WRITEOFF',
note => $payment_note,
interface => C4::Context->interface,