[freeside-commits] branch FREESIDE_2_3_BRANCH updated. a69bdc8db4a3ec643bd19764431aeaf49feadf6c
Jeremy Davis
jeremyd at 420.am
Thu May 29 08:35:19 PDT 2014
The branch, FREESIDE_2_3_BRANCH has been updated
via a69bdc8db4a3ec643bd19764431aeaf49feadf6c (commit)
from 7d6818c03f5137848e9459d6943323c21ebdca8b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a69bdc8db4a3ec643bd19764431aeaf49feadf6c
Author: Ivan Kohler <ivan at freeside.biz>
Date: Thu May 8 02:02:48 2014 -0700
fix daily sales/credits/receipts summary vs DST boundaries, RT#26199
diff --git a/FS/FS/Report/Table/Daily.pm b/FS/FS/Report/Table/Daily.pm
index 6087b0d..c668016 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 );
@@ -66,12 +66,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;
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Report/Table/Daily.pm | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
More information about the freeside-commits
mailing list