From ef902ea85f7120747dfde5db6a92efcb6e0e18e9 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Thu, 3 Jan 2008 18:20:36 -0600 Subject: [PATCH] circ/stats.pl - debugify warnings Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- circ/stats.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/circ/stats.pl b/circ/stats.pl index 23841ba9d6..6d8a8ead5e 100755 --- a/circ/stats.pl +++ b/circ/stats.pl @@ -29,6 +29,12 @@ use C4::Auth; use Date::Manip; use C4::Stats; +use vars qw($debug); + +BEGIN { + $debug = $ENV{DEBUG} || 0; +} + my $input = new CGI; my $time = $input->param('time'); @@ -65,7 +71,7 @@ if ( $time eq 'daybefore' ) { if ( $time eq 'month' ) { $date = ParseDate('1 month ago'); $date2 = ParseDate('today'); - warn "d : $date // d2 : $date2"; + $debug and warn "d : $date // d2 : $date2"; } if ( $time =~ /\// ) { $date = ParseDate($time); @@ -74,7 +80,7 @@ if ( $time =~ /\// ) { } $date = UnixDate( $date, '%Y-%m-%d' ); $date2 = UnixDate( $date2, '%Y-%m-%d' ); -warn "d : $date // d2 : $date2"; +$debug and warn "d : $date // d2 : $date2"; my @payments = TotalPaid( $date, $date2 ); my $count = @payments; my $total = 0; @@ -85,7 +91,7 @@ my %row; my $i = 0; while ( $i < $count ) { - warn " pay : " . $payments[$i]{'timestamp'}; + $debug and warn " pay : " . $payments[$i]{'timestamp'}; my $time = $payments[$i]{'datetime'}; my $payments = $payments[$i]{'value'}; my $charge = 0; -- 2.39.5