Lines 32-37
use Koha::Acquisition::Order;
Link Here
|
32 |
use Koha::Acquisition::Bookseller; |
32 |
use Koha::Acquisition::Bookseller; |
33 |
use Koha::Number::Price; |
33 |
use Koha::Number::Price; |
34 |
use Koha::Libraries; |
34 |
use Koha::Libraries; |
|
|
35 |
use Koha::CsvProfiles; |
35 |
|
36 |
|
36 |
use C4::Koha; |
37 |
use C4::Koha; |
37 |
|
38 |
|
Lines 286-296
sub GetBasketAsCSV {
Link Here
|
286 |
my $template = C4::Templates::gettemplate("acqui/csv/basket.tt", "intranet", $cgi); |
287 |
my $template = C4::Templates::gettemplate("acqui/csv/basket.tt", "intranet", $cgi); |
287 |
my @rows; |
288 |
my @rows; |
288 |
if ($csv_profile_id) { |
289 |
if ($csv_profile_id) { |
289 |
my $csv_profile = C4::Csv::GetCsvProfile( $csv_profile_id ); |
290 |
my $csv_profile = Koha::CsvProfiles->find( $csv_profile_id ); |
290 |
die "There is no valid csv profile given" unless $csv_profile; |
291 |
die "There is no valid csv profile given" unless $csv_profile; |
291 |
|
292 |
|
292 |
my $csv = Text::CSV_XS->new({'quote_char'=>'"','escape_char'=>'"','sep_char'=>$csv_profile->{csv_separator},'binary'=>1}); |
293 |
my $csv = Text::CSV_XS->new({'quote_char'=>'"','escape_char'=>'"','sep_char'=>$csv_profile->csv_separator,'binary'=>1}); |
293 |
my $csv_profile_content = $csv_profile->{content}; |
294 |
my $csv_profile_content = $csv_profile->content; |
294 |
my ( @headers, @fields ); |
295 |
my ( @headers, @fields ); |
295 |
while ( $csv_profile_content =~ / |
296 |
while ( $csv_profile_content =~ / |
296 |
([^=]+) # header |
297 |
([^=]+) # header |
Lines 321-327
sub GetBasketAsCSV {
Link Here
|
321 |
} |
322 |
} |
322 |
push @rows, \@row; |
323 |
push @rows, \@row; |
323 |
} |
324 |
} |
324 |
my $content = join( $csv_profile->{csv_separator}, @headers ) . "\n"; |
325 |
my $content = join( $csv_profile->csv_separator, @headers ) . "\n"; |
325 |
for my $row ( @rows ) { |
326 |
for my $row ( @rows ) { |
326 |
$csv->combine(@$row); |
327 |
$csv->combine(@$row); |
327 |
my $string = $csv->string; |
328 |
my $string = $csv->string; |