Bug 20914

Summary: Internal server error in OPAC
Product: Koha Reporter: Stefan Berndtsson <stefan.berndtsson>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Stefan Berndtsson 2018-06-12 13:33:21 UTC
opac-user.pl tries to fetch an invalid column when calculating fines.

my $rental_fines = Koha::Account::Lines->search(
    {
        borrowernumber    => $patron->borrowernumber,
        amountoutstanding => { '>' => 0 },
        accounttype       => 'Rent',
        itemnumber        => $issue->{itemnumber}
    },
    {
        select => [ { sum => 'amountoutstanding' } ],
        as     => ['rental_fines']
    }
);
$issue->{rentalfines} = $charges->count ? $charges->next->get_column('rental_fines') : 0;

This code fetches the column "rental_fines" into the variable "$rental_fines", but then tries
to read that column data from a different variable ("$charges").
Comment 1 Jonathan Druart 2018-06-12 14:04:08 UTC

*** This bug has been marked as a duplicate of bug 20832 ***