From 39d1b7e61b4e11d76e443f7755aba96e3cf13ab6 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Tue, 21 Jun 2011 14:07:41 +0100 Subject: [PATCH] Bug 5549 : Overdues : Handle some date comparison and display issues --- C4/Overdues.pm | 6 +++--- misc/cronjobs/overdue_notices.pl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 2935b24838..583fb96043 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -124,7 +124,7 @@ sub Getoverdues { SELECT issues.*, items.itype as itemtype, items.homebranch, items.barcode FROM issues LEFT JOIN items USING (itemnumber) - WHERE date_due < CURDATE() + WHERE date_due < NOW() "; } else { $statement = " @@ -132,7 +132,7 @@ LEFT JOIN items USING (itemnumber) FROM issues LEFT JOIN items USING (itemnumber) LEFT JOIN biblioitems USING (biblioitemnumber) - WHERE date_due < CURDATE() + WHERE date_due < NOW() "; } @@ -199,7 +199,7 @@ sub checkoverdues { LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber WHERE issues.borrowernumber = ? - AND issues.date_due < CURDATE()" + AND issues.date_due < NOW()" ); # FIXME: SELECT * across 4 tables? do we really need the marc AND marcxml blobs?? $sth->execute($borrowernumber); diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index af3790d384..cb9ffa2ec6 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -323,7 +323,7 @@ if (@branchcodes) { # these are the fields that will be substituted into <> my @item_content_fields = split( /,/, $itemscontent ); -binmode STDOUT, ':encoding(UTF-8)'; +binmode( STDOUT, ':encoding(UTF-8)' ); our $csv; # the Text::CSV_XS object @@ -350,8 +350,8 @@ if ( defined $htmlfilename ) { if ( $htmlfilename eq '' ) { $html_fh = *STDOUT; } else { - my $today = C4::Dates->new(); - open $html_fh, ">",File::Spec->catdir ($htmlfilename,"notices-".$today->output('iso').".html"); + my $today = DateTime->now(time_zone => C4::Context->tz ); + open $html_fh, ">",File::Spec->catdir ($htmlfilename,"notices-".$today->ymd().".html"); } print $html_fh "\n"; -- 2.39.5