From 1d64fa4a4a452b59e90524d5fd0fa9a078edcffb Mon Sep 17 00:00:00 2001 From: hdl Date: Tue, 28 Jun 2005 10:15:11 +0000 Subject: [PATCH] Minor bug Fix: Displaying Months and day in usual order. --- reports/acquisitions_stats.pl | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/reports/acquisitions_stats.pl b/reports/acquisitions_stats.pl index abb8f18221..53828d5eb5 100755 --- a/reports/acquisitions_stats.pl +++ b/reports/acquisitions_stats.pl @@ -271,27 +271,35 @@ sub calculate { #warn "filtre col ".$colfilter[0]." ".$colfilter[1]; # 1st, loop rows. - my $linefield; + my $linefield; + my $lineorder; if (($line =~/closedate/) and ($podsp == 1)) { #Display by day $linefield .="dayname($line)"; + $lineorder .="weekday($line)"; } elsif (($line=~/closedate/) and ($podsp == 2)) { #Display by Month $linefield .="monthname($line)"; + $lineorder .="month($line)"; } elsif (($line=~/closedate/) and ($podsp == 3)) { #Display by Year $linefield .="Year($line)"; + $lineorder .=$linefield; } elsif (($line =~/received/) and ($rodsp == 1)) { #Display by day $linefield .="dayname($line)"; + $lineorder .="weekday($line)"; } elsif (($line=~/received/) and ($rodsp == 2)) { #Display by Month $linefield .="monthname($line)"; + $lineorder .="month($line)"; } elsif (($line=~/received/) and ($rodsp == 3)) { #Display by Year $linefield .="Year($line)"; + $lineorder .=$linefield; } else { $linefield .= $line; + $lineorder .=$linefield; } my $strsth; @@ -312,7 +320,7 @@ sub calculate { } } $strsth .=" group by $linefield"; - $strsth .=" order by $linefield"; + $strsth .=" order by $lineorder"; warn "". $strsth; my $sth = $dbh->prepare( $strsth ); @@ -337,26 +345,34 @@ sub calculate { # 2nd, loop cols. my $colfield; + my $colorder; if (($column =~/closedate/) and ($podsp == 1)) { #Display by day - $colfield .="dayname($column)"; + $colfield .="dayname($column)"; + $colorder .="weekday($column)"; } elsif (($column=~/closedate/) and ($podsp == 2)) { #Display by Month $colfield .="monthname($column)"; + $colorder .="month($column)"; } elsif (($column=~/closedate/) and ($podsp == 3)) { #Display by Year $colfield .="Year($column)"; + $colorder .= $colfield; } elsif (($column =~/received/) and ($rodsp == 1)) { #Display by day $colfield .="dayname($column)"; + $colorder .="weekday($column)"; } elsif (($column=~/received/) and ($rodsp == 2)) { #Display by Month $colfield .="monthname($column)"; + $colorder .="month($column)"; } elsif (($column=~/received/) and ($rodsp == 3)) { #Display by Year $colfield .="Year($column)"; + $colorder .= $colfield; } else { $colfield .= $column; + $colorder .= $colfield; } my $strsth2; @@ -377,7 +393,7 @@ sub calculate { } } $strsth2 .=" group by $colfield"; - $strsth2 .=" order by $colfield"; + $strsth2 .=" order by $colorder"; warn "". $strsth2; my $sth2 = $dbh->prepare( $strsth2 ); @@ -438,7 +454,7 @@ sub calculate { $strcalc .= " AND aqorders.sort1 like '" . @$filters[6] ."'" if ( @$filters[6] ); @$filters[7]=~ s/\*/%/g if (@$filters[7]); $strcalc .= " AND aqorders.sort2 like '" . @$filters[7] ."'" if ( @$filters[7] ); - $strcalc .= " group by $linefield, $colfield order by $linefield,$colfield"; + $strcalc .= " group by $linefield, $colfield order by $lineorder,$colorder"; warn "". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; -- 2.39.5