@@ -, +, @@ --- C4/Acquisition.pm | 17 +++++++---------- .../prog/en/modules/catalogue/moredetail.tt | 11 ++++------- 2 files changed, 11 insertions(+), 17 deletions(-) --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -72,20 +72,17 @@ sub GetOrderFromItemnumber { my ($itemnumber) = @_; my $dbh = C4::Context->dbh; my $query = qq| - - SELECT * from aqorders LEFT JOIN aqorders_items - ON ( aqorders.ordernumber = aqorders_items.ordernumber ) - WHERE itemnumber = ? |; + SELECT ord.* from aqorders ord + LEFT JOIN items it ON it.biblionumber=ord.biblionumber + WHERE it.itemnumber=?|; + #Bugzilla 6916: query used join with aqorders_items, but this only + #worked if syspref AcqCreateItems == placing an order. Now we use items. + #It is not needed to return columns from tables other than aqorders. my $sth = $dbh->prepare($query); - -# $sth->trace(3); - $sth->execute($itemnumber); - my $order = $sth->fetchrow_hashref; - return ( $order ); - + return $order; } # Returns the itemnumber(s) associated with the ordernumber given in parameter --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -151,20 +151,17 @@