diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-05-08 02:02:48 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-05-08 02:02:48 -0700 |
commit | 64f4f823955fc738709bfefc0091869cc3cce278 (patch) | |
tree | 46a004b3859fc5147e2ad6998f5383fb96226ff4 | |
parent | 2e1d2ce44a7143929f09e714a17082c4093ba60a (diff) |
fix daily sales/credits/receipts summary vs DST boundaries, RT#26199
-rw-r--r-- | FS/FS/Report/Table/Daily.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/Report/Table/Daily.pm b/FS/FS/Report/Table/Daily.pm index 570fefe4d..c18106461 100644 --- a/FS/FS/Report/Table/Daily.pm +++ b/FS/FS/Report/Table/Daily.pm @@ -4,7 +4,7 @@ use strict; use vars qw( @ISA ); use FS::Report::Table; use FS::Conf; -use Time::Local qw( timelocal ); +use Time::Local qw( timelocal timelocal_nocheck ); # eventually replace with DateTime use Date::Format qw( time2str ); @ISA = qw( FS::Report::Table ); @@ -69,12 +69,15 @@ sub data { #warn "daily range $sdate $edate\n"; # XXX: use date_format config for the labels since we have day in the labels now? - # XXX: leap seconds / DST while ( $sdate < $edate ) { push @{$data{label}}, time2str($date_format, $sdate); my $speriod = $sdate; - $sdate += 86400; + + #ala part_pkg->add_freq, to deal with local DST. DateTime also a good idea + my ($mday,$mon,$year) = (localtime($sdate) )[3,4,5]; + $sdate = timelocal_nocheck(0,0,0,$mday+1,$mon,$year); + my $eperiod = $sdate; push @{$data{speriod}}, $speriod; |