From 7ec406b38decfcd1c023a947690181ac7811697a Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Tue, 23 Jul 2019 10:22:20 -0500 Subject: [PATCH] Bug 23363: Fix Internal Server Error when clicking on shipment cost invoice link To test: On the fund detail page, have some shipment costs associated with a fund an example would be cgi-bin/koha/acqui/spent.pl?fund=&fund_code= Click the link for the fund, without this patch it will give an internal server error. With this patch, the shipment invoice will be loaded. Signed-off-by: Jason DeShaw Signed-off-by: Laurel Moran Signed-off-by: Josef Moravec Signed-off-by: Martin Renvoize (cherry picked from commit be4c4f8040ba9485f1cc72937ae77027568c0779) Signed-off-by: Fridolin Somers (cherry picked from commit aa7f80a740d4b8b76c9485cf72d204859121927b) Signed-off-by: Lucas Gass --- acqui/spent.pl | 5 +++-- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/acqui/spent.pl b/acqui/spent.pl index 20d2b13c0c..ba843a8d72 100755 --- a/acqui/spent.pl +++ b/acqui/spent.pl @@ -119,7 +119,7 @@ while ( my $data = $sth->fetchrow_hashref ) { my $total = $subtotal; $query = qq{ - SELECT invoicenumber, shipmentcost + SELECT invoiceid, invoicenumber, shipmentcost FROM aqinvoices WHERE shipmentcost_budgetid = ? }; @@ -129,7 +129,8 @@ my @shipmentcosts; while (my $data = $sth->fetchrow_hashref) { push @shipmentcosts, { shipmentcost => sprintf("%.2f", $data->{shipmentcost}), - invoicenumber => $data->{invoicenumber} + invoiceid => $data->{invoiceid}, + invoicenumber => $data->{invoicenumber} }; $total += $data->{shipmentcost}; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt index f02ca4160c..9dcc8063cf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt @@ -89,7 +89,7 @@ Shipping cost for invoice - + [% shipmentcost.invoicenumber | html %] -- 2.39.5