Lines 314-333
sub GetBasketAsCSV {
Link Here
|
314 |
} |
314 |
} |
315 |
for my $order (@orders) { |
315 |
for my $order (@orders) { |
316 |
my @row; |
316 |
my @row; |
317 |
my $bd = GetBiblioData( $order->{'biblionumber'} ); |
317 |
my $biblio = Koha::Biblios->find( $order->{biblionumber} ); |
318 |
my @biblioitems = GetBiblioItemByBiblioNumber( $order->{'biblionumber'}); |
318 |
my $biblioitem = $biblio->biblioitem; |
319 |
for my $biblioitem (@biblioitems) { |
319 |
$order = { %$order, %{ $biblioitem->unblessed } }; |
320 |
if ( $biblioitem->{isbn} |
|
|
321 |
and $order->{isbn} |
322 |
and $biblioitem->{isbn} eq $order->{isbn} ) |
323 |
{ |
324 |
$order = { %$order, %$biblioitem }; |
325 |
} |
326 |
} |
327 |
if ($contract) { |
320 |
if ($contract) { |
328 |
$order = {%$order, %$contract}; |
321 |
$order = {%$order, %$contract}; |
329 |
} |
322 |
} |
330 |
$order = {%$order, %$basket, %$bd}; |
323 |
$order = {%$order, %$basket, %{ $biblio->unblessed }}; |
331 |
for my $field (@fields) { |
324 |
for my $field (@fields) { |
332 |
push @row, $order->{$field}; |
325 |
push @row, $order->{$field}; |
333 |
} |
326 |
} |
Lines 343-359
sub GetBasketAsCSV {
Link Here
|
343 |
} |
336 |
} |
344 |
else { |
337 |
else { |
345 |
foreach my $order (@orders) { |
338 |
foreach my $order (@orders) { |
346 |
my $bd = GetBiblioData( $order->{'biblionumber'} ); |
339 |
my $biblio = Koha::Biblios->find( $order->{biblionumber} ); |
|
|
340 |
my $biblioitem = $biblio->biblioitem; |
347 |
my $row = { |
341 |
my $row = { |
348 |
contractname => $contract->{'contractname'}, |
342 |
contractname => $contract->{'contractname'}, |
349 |
ordernumber => $order->{'ordernumber'}, |
343 |
ordernumber => $order->{'ordernumber'}, |
350 |
entrydate => $order->{'entrydate'}, |
344 |
entrydate => $order->{'entrydate'}, |
351 |
isbn => $order->{'isbn'}, |
345 |
isbn => $order->{'isbn'}, |
352 |
author => $bd->{'author'}, |
346 |
author => $biblio->author, |
353 |
title => $bd->{'title'}, |
347 |
title => $biblio->title, |
354 |
publicationyear => $bd->{'publicationyear'}, |
348 |
publicationyear => $biblioitem->publicationyear, |
355 |
publishercode => $bd->{'publishercode'}, |
349 |
publishercode => $biblioitem->publishercode, |
356 |
collectiontitle => $bd->{'collectiontitle'}, |
350 |
collectiontitle => $biblioitem->collectiontitle, |
357 |
notes => $order->{'order_vendornote'}, |
351 |
notes => $order->{'order_vendornote'}, |
358 |
quantity => $order->{'quantity'}, |
352 |
quantity => $order->{'quantity'}, |
359 |
rrp => $order->{'rrp'}, |
353 |
rrp => $order->{'rrp'}, |
Lines 412-427
sub GetBasketGroupAsCSV {
Link Here
|
412 |
my $basketgroup = GetBasketgroup( $$basket{basketgroupid} ); |
406 |
my $basketgroup = GetBasketgroup( $$basket{basketgroupid} ); |
413 |
|
407 |
|
414 |
foreach my $order (@orders) { |
408 |
foreach my $order (@orders) { |
415 |
my $bd = GetBiblioData( $order->{'biblionumber'} ); |
409 |
my $biblio = Koha::Biblios->find( $order->{biblionumber} ); |
|
|
410 |
my $biblioitem = $biblio->biblioitem; |
416 |
my $row = { |
411 |
my $row = { |
417 |
clientnumber => $bookseller->accountnumber, |
412 |
clientnumber => $bookseller->accountnumber, |
418 |
basketname => $basket->{basketname}, |
413 |
basketname => $basket->{basketname}, |
419 |
ordernumber => $order->{ordernumber}, |
414 |
ordernumber => $order->{ordernumber}, |
420 |
author => $bd->{author}, |
415 |
author => $biblio->author, |
421 |
title => $bd->{title}, |
416 |
title => $biblio->title, |
422 |
publishercode => $bd->{publishercode}, |
417 |
publishercode => $biblioitem->publishercode, |
423 |
publicationyear => $bd->{publicationyear}, |
418 |
publicationyear => $biblioitem->publicationyear, |
424 |
collectiontitle => $bd->{collectiontitle}, |
419 |
collectiontitle => $biblioitem->collectiontitle, |
425 |
isbn => $order->{isbn}, |
420 |
isbn => $order->{isbn}, |
426 |
quantity => $order->{quantity}, |
421 |
quantity => $order->{quantity}, |
427 |
rrp_tax_included => $order->{rrp_tax_included}, |
422 |
rrp_tax_included => $order->{rrp_tax_included}, |