Bug 23363: Fix Internal Server Error when clicking on shipment cost invoice link
authorLiz Rea <wizzyrea@gmail.com>
Tue, 23 Jul 2019 15:22:20 +0000 (10:22 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 26 Jul 2019 10:13:33 +0000 (11:13 +0100)
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=<your fund>&fund_code=<your
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 <JDeShaw@fargolibrary.org>
Signed-off-by: Laurel Moran <lmoran@sdlawlibrary.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

acqui/spent.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt

index 20d2b13..ba843a8 100755 (executable)
@@ -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};
 }
index 2e5ca3f..6466080 100644 (file)
@@ -88,7 +88,7 @@
                 <tr>
                     <td></td>
                     <td colspan="8">Shipping cost for invoice
-                        <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% shipmentcode.invoiceid | uri %]">
+                        <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% shipmentcost.invoiceid | uri %]">
                              [% shipmentcost.invoicenumber | html %]
                         </a>
                     </td>