Bug 9044: DBRev 3.13.00.036
[koha.git] / reports / borrowers_stats.pl
index eca9b3a..8181285 100755 (executable)
@@ -56,7 +56,7 @@ my @filters = $input->param("Filter");
 $filters[3]=format_date_in_iso($filters[3]);
 $filters[4]=format_date_in_iso($filters[4]);
 my $digits = $input->param("digits");
-my $period = $input->param("period");
+our $period = $input->param("period");
 my $borstat = $input->param("status");
 my $borstat1 = $input->param("activity");
 my $output = $input->param("output");
@@ -354,7 +354,7 @@ sub calculate {
     $sth2->execute(@strparams2);
        while (my ($celvalue) = $sth2->fetchrow) {
                my %cell;
-               if ($celvalue) {
+             if (defined $celvalue) {
                        $cell{coltitle} = $celvalue;
                        # $cell{coltitle_display} = ($colfield eq 'branchcode') ? $branches->{$celvalue}->{branchname} : $celvalue;
                        $cell{coltitle_display} = $cathash{$celvalue} if ($column eq 'categorycode');
@@ -372,6 +372,7 @@ sub calculate {
             my $coltitle = $row->{coltitle} // '';
             $table{$rowtitle}->{$coltitle} = 0;
                }
+        $row->{rowtitle} ||= '';
                $table{$row->{rowtitle}}->{totalrow}=0;
                $table{$row->{rowtitle}}->{rowtitle_display} = $row->{rowtitle_display};
        }