#!/usr/bin/perl\r
\r
-\r
use strict;\r
use CGI;\r
use C4::Output;\r
use C4::Context;\r
use Date::Manip;\r
use C4::Stats;\r
+use Text::CSV_XS;\r
+\r
+my $csv = Text::CSV_XS->new(\r
+ {\r
+ 'quote_char' => '"',\r
+ 'escape_char' => '"',\r
+ 'sep_char' => ',',\r
+ 'binary' => 1\r
+ }\r
+);\r
\r
my $input=new CGI;\r
my $time=$input->param('time');\r
push (@loop2, \@rows2);\r
$i++;\r
$totalcredits = $totalcredits + $credits[$i]->{'amount'};\r
- ;\r
-\r
}\r
+\r
#takes off first char minus sign "-100.00"\r
$totalcredits = substr($totalcredits, 1);\r
\r
\r
for my $row ( @loop1 ) {\r
\r
- my $csv->combine(@$row);\r
+ $csv->combine(@$row);\r
my $string = $csv->string;\r
print $string, "\n";\r
}\r
\r
for my $row ( @loop2 ) {\r
\r
- my $csv->combine(@$row);\r
+ $csv->combine(@$row);\r
my $string = $csv->string;\r
print $string, "\n";\r
}\r
print ",,Total Amount Paid, $totalpaid\n";\r
print ",,Total Number Written, $totalwritten\n";\r
print ",,Total Amount Credits, $totalcredits\n";\r
-\r