Bug 19332 - Basket grouping PDF and CSV exports empty
[koha.git] / acqui / basketgroup.pl
index 333e542..0e8a9a1 100755 (executable)
@@ -54,6 +54,7 @@ use CGI qw ( -utf8 );
 use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV/;
 use Koha::EDI qw/create_edi_order get_edifact_ean/;
 
+use Koha::Biblioitems;
 use Koha::Acquisition::Booksellers;
 use Koha::ItemTypes;
 use Koha::Patrons;
@@ -174,7 +175,7 @@ sub printbasketgrouppdf{
             $ord->{total_tax_included} = $ord->{ecost_tax_included} * $ord->{quantity};
             $ord->{total_tax_excluded} = $ord->{ecost_tax_excluded} * $ord->{quantity};
 
-            my $bib = GetBiblioData($ord->{biblionumber});
+            my $biblioitem = Koha::Biblioitems->search({ biblionumber => $ord->{biblionumber} })->next;
 
             #FIXME DELETE ME
             # 0      1        2        3         4            5         6       7      8        9
@@ -183,7 +184,7 @@ sub printbasketgrouppdf{
             # Editor Number
             my $en;
             my $edition;
-            my $ord->{marcxml} = C4::Biblio::GetXmlBiblio( $ord->{biblionumber} );
+            $ord->{marcxml} = C4::Biblio::GetXmlBiblio( $ord->{biblionumber} );
             my $marcrecord=eval{MARC::Record::new_from_xml( $ord->{marcxml},'UTF-8' )};
             if ($marcrecord){
                 if ( C4::Context->preference("marcflavour") eq 'UNIMARC' ) {
@@ -195,7 +196,7 @@ sub printbasketgrouppdf{
                 }
             }
 
-            $ord->{itemtype} = ( $ord->{itemtype} and $bib->{itemtype} ) ? Koha::ItemTypes->find( $bib->{itemtype} )->description : undef;
+            $ord->{itemtype} = ( $ord->{itemtype} and $biblioitem->itemtype ) ? Koha::ItemTypes->find( $biblioitem->itemtype )->description : undef;
             $ord->{en} = $en ? $en : undef;
             $ord->{edition} = $edition ? $edition : undef;