[Koha-cvs] CVS: koha/reports acquisitions_stats.pl,1.5,1.6

Henri-Damien LAURENT hdl at users.sourceforge.net
Mon Jun 20 12:28:11 CEST 2005


Update of /cvsroot/koha/koha/reports
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16241/reports

Modified Files:
	acquisitions_stats.pl 
Log Message:
Reordering dates with usual order and not alphabetical one

Index: acquisitions_stats.pl
===================================================================
RCS file: /cvsroot/koha/koha/reports/acquisitions_stats.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** acquisitions_stats.pl	4 May 2005 09:02:38 -0000	1.5
--- acquisitions_stats.pl	20 Jun 2005 10:28:09 -0000	1.6
***************
*** 272,296 ****
                                                
  # 1st, loop rows.                             
! 	my $linefield;                               
  	if (($line =~/closedate/) and ($podsp == 1)) {
  		#Display by day
! 		$linefield .="dayname($line)";  
  	} elsif (($line=~/closedate/) and ($podsp == 2)) {
  		#Display by Month
  		$linefield .="monthname($line)";  
  	} elsif (($line=~/closedate/) and ($podsp == 3)) {
  		#Display by Year
  		$linefield .="Year($line)";
  	} elsif (($line =~/received/) and ($rodsp == 1)) {
  		#Display by day
  		$linefield .="dayname($line)";  
  	} elsif (($line=~/received/) and ($rodsp == 2)) {
  		#Display by Month
  		$linefield .="monthname($line)";  
  	} elsif (($line=~/received/) and ($rodsp == 3)) {
  		#Display by Year
  		$linefield .="Year($line)";
  	} else {
  		$linefield .= $line;
  	}  
  	
--- 272,304 ----
                                                
  # 1st, loop rows.                             
! 	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 .="Year($line)";
  	} 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 .="Year($line)";
  	} else {
  		$linefield .= $line;
+ 		$lineorder .= $line;
  	}  
  	
***************
*** 313,317 ****
   	}
  	$strsth .=" group by $linefield";
! 	$strsth .=" order by $linefield";
  	warn "". $strsth;
  	
--- 321,325 ----
   	}
  	$strsth .=" group by $linefield";
! 	$strsth .=" order by $lineorder";
  	warn "". $strsth;
  	
***************
*** 338,361 ****
--- 346,377 ----
  # 2nd, loop cols.
  	my $colfield;
+ 	my $colorder;
  	if (($column =~/closedate/) and ($podsp == 1)) {
  		#Display by day
  		$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 .="Year($column)";
  	} 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 .="Year($column)";
  	} else {
  		$colfield .= $column;
+ 		$colorder .= $column;
  	}  
  	
***************
*** 378,387 ****
   	}
  	$strsth2 .=" group by $colfield";
! 	$strsth2 .=" order by $colfield";
   	warn "". $strsth2;
  	
  	my $sth2 = $dbh->prepare( $strsth2 );
  	if (( @colfilter ) and ($colfilter[1])){
! 		warn "from : ".$colfilter[0]." To  :".$colfilter[1];
  		$sth2->execute("'".$colfilter[0]."'","'".$colfilter[1]."'");
  	} elsif ($colfilter[0]) {
--- 394,403 ----
   	}
  	$strsth2 .=" group by $colfield";
! 	$strsth2 .=" order by $colorder";
   	warn "". $strsth2;
  	
  	my $sth2 = $dbh->prepare( $strsth2 );
  	if (( @colfilter ) and ($colfilter[1])){
! #		warn "from : ".$colfilter[0]." To  :".$colfilter[1];
  		$sth2->execute("'".$colfilter[0]."'","'".$colfilter[1]."'");
  	} elsif ($colfilter[0]) {
***************
*** 439,443 ****
  	@$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";
  	warn "". $strcalc;
  	my $dbcalc = $dbh->prepare($strcalc);
--- 455,459 ----
  	@$filters[7]=~ s/\*/%/g if (@$filters[7]);
  	$strcalc .= " AND aqorders.sort2 like '" . @$filters[7] ."'" if ( @$filters[7] );
! 	$strcalc .= " group by $linefield, $colfield order by $lineorder,$colorder";
  	warn "". $strcalc;
  	my $dbcalc = $dbh->prepare($strcalc);





More information about the Koha-cvs mailing list