summaryrefslogtreecommitdiff
path: root/FS/FS/Report/Table
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-07-03 11:38:23 -0700
committerMark Wells <mark@freeside.biz>2015-07-03 15:31:01 -0700
commit250979a64087d6113c2ef5eb617dc6e979ceda80 (patch)
tree50e44244770d3c43decc482b5b5f1d1b2b74812b /FS/FS/Report/Table
parent5069e4b5dc1b71eb3df22223ff3cfb84efb96daf (diff)
make new gross sales calculation optional, #25943
Diffstat (limited to 'FS/FS/Report/Table')
-rw-r--r--FS/FS/Report/Table/Monthly.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/Report/Table/Monthly.pm b/FS/FS/Report/Table/Monthly.pm
index 0ff7efd..f4ba020 100644
--- a/FS/FS/Report/Table/Monthly.pm
+++ b/FS/FS/Report/Table/Monthly.pm
@@ -182,9 +182,15 @@ sub data {
push @{$data{label}}, "$smonth/$syear"; # sprintf?
my $speriod = timelocal(0,0,0,1,$smonth-1,$syear);
- push @{$data{speriod}}, $speriod;
if ( ++$smonth == 13 ) { $syear++; $smonth=1; }
my $eperiod = timelocal(0,0,0,1,$smonth-1,$syear);
+ # 12-month mode: show results in a sliding window ending at $eperiod,
+ # but starting 12 months before.
+ if ( $self->{'12mo'}) {
+ $speriod = timelocal(0,0,0,1,$smonth-1,$syear-1);
+ }
+
+ push @{$data{speriod}}, $speriod;
push @{$data{eperiod}}, $eperiod;
my $col = 0; # a "column" here is the data corresponding to an item