Bug 12495 - Include streetnumber in hold alert address
[koha_fer] / reports / serials_stats.pl
index 9aff54b..d86c5b9 100755 (executable)
@@ -94,11 +94,20 @@ if($do_it){
     my @datas;
 
     while(my $row = $sth->fetchrow_hashref){
-        $row->{'enddate'} = format_date(GetExpirationDate($row->{'subscriptionid'}));
-        $row->{'startdate'} = format_date($row->{'startdate'});
-        push @datas, $row if ($expired || (not $expired && not HasSubscriptionExpired($row->{subscriptionid})) );
+        $row->{'enddate'} = GetExpirationDate($row->{'subscriptionid'});
+        $row->{expired} = HasSubscriptionExpired($row->{subscriptionid});
+        push @datas, $row if (
+            $expired
+            or (
+                not $expired
+                and (
+                    not $row->{expired}
+                    and not $row->{closed}
+                )
+            )
+        );
     }
-    
+
     if($output eq 'screen'){
         $template->param(datas => \@datas,
                          do_it => 1);