diff --git a/koha-tmpl/intranet-tmpl/default/en/reports/reports-home.tmpl b/koha-tmpl/intranet-tmpl/default/en/reports/reports-home.tmpl
index 2ab13a7944..5ce671b5ec 100644
--- a/koha-tmpl/intranet-tmpl/default/en/reports/reports-home.tmpl
+++ b/koha-tmpl/intranet-tmpl/default/en/reports/reports-home.tmpl
@@ -3,28 +3,26 @@
Reports
+
+
Other stats
+
on catalogue
-
Stats on issues
+
on issues
-
Stats on acquisitions
-
data exports
diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl
index 84f6976043..9be9fd1348 100755
--- a/reports/issues_stats.pl
+++ b/reports/issues_stats.pl
@@ -307,7 +307,7 @@ sub calculate {
my $linefield;
if (($line =~/datetime/) and ($dsp == 1)) {
#Display by day
- $linefield .="dayname($line)";
+ $linefield .="concat(weekday($line),' ',dayname($line))";
} elsif (($line=~/datetime/) and ($dsp == 2)) {
#Display by Month
$linefield .="monthname($line)";
@@ -319,7 +319,9 @@ sub calculate {
} else {
$linefield .= $line;
}
-
+ my $lineorder = $linefield;
+ $lineorder = "weekday($line)" if $lineorder =~ "^dayname";
+
my $strsth;
$strsth .= "select distinctrow $linefield from statistics, borrowers where (statistics.borrowernumber=borrowers.borrowernumber) and $line is not null ";
@@ -339,8 +341,8 @@ sub calculate {
$strsth .= " and $line LIKE ? " ;
}
$strsth .=" group by $linefield";
- $strsth .=" order by $linefield";
-# warn "". $strsth;
+ $strsth .=" order by $lineorder";
+ warn "". $strsth;
my $sth = $dbh->prepare( $strsth );
if (( @linefilter ) and ($linefilter[1])){
@@ -467,8 +469,8 @@ sub calculate {
$strcalc .= " AND monthname(datetime) like '" . $monthsel ."'" if ( $monthsel );
$strcalc .= " AND statistics.type like '" . $type ."'" if ( $type );
- $strcalc .= " group by $linefield, $colfield order by $linefield,$colfield";
-# warn "". $strcalc;
+ $strcalc .= " group by $linefield, $colfield order by $lineorder,$colfield";
+ warn "". $strcalc;
my $dbcalc = $dbh->prepare($strcalc);
$dbcalc->execute;
# warn "filling table";