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