X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FAcquisition.pm;h=738fe1661e9a444c292bcbfbf6ecaa0162f62804;hb=68f99cdf980222dcb557667925bd6024640cda2a;hp=cd1e6706f7888e4e0c931c7997cdaa12b35e8af7;hpb=ecda6f730537691054852b16a9d6ecc55f8f2b24;p=koha_gimpoz diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index cd1e6706f7..738fe1661e 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -233,7 +233,7 @@ sub GetBasketAsCSV { my $output; # TODO: Translate headers - my @headers = qw(contractname ordernumber line entrydate isbn author title publishercode collectiontitle notes quantity rrp); + my @headers = qw(contractname ordernumber entrydate isbn author title publishercode collectiontitle notes quantity rrp); $csv->combine(@headers); $output = $csv->string() . "\n"; @@ -241,16 +241,17 @@ sub GetBasketAsCSV { my @rows; foreach my $order (@orders) { my @cols; - my $bd = GetBiblioData($order->{'biblionumber'}); + # newlines are not valid characters for Text::CSV combine() + $order->{'notes'} =~ s/[\r\n]+//g; push(@cols, $contract->{'contractname'}, $order->{'ordernumber'}, $order->{'entrydate'}, $order->{'isbn'}, - $bd->{'author'}, - $bd->{'title'}, - $bd->{'publishercode'}, - $bd->{'collectiontitle'}, + $order->{'author'}, + $order->{'title'}, + $order->{'publishercode'}, + $order->{'collectiontitle'}, $order->{'notes'}, $order->{'quantity'}, $order->{'rrp'}, @@ -258,10 +259,6 @@ sub GetBasketAsCSV { push (@rows, \@cols); } - # Sort by publishercode - # TODO: Sort by publishercode then by title - @rows = sort { @$a[7] cmp @$b[7] } @rows; - foreach my $row (@rows) { $csv->combine(@$row); $output .= $csv->string() . "\n";