diff options
author | Mark Wells <mark@freeside.biz> | 2015-07-03 11:38:23 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-07-03 15:31:01 -0700 |
commit | 250979a64087d6113c2ef5eb617dc6e979ceda80 (patch) | |
tree | 50e44244770d3c43decc482b5b5f1d1b2b74812b /FS/FS/Report/Table | |
parent | 5069e4b5dc1b71eb3df22223ff3cfb84efb96daf (diff) |
make new gross sales calculation optional, #25943
Diffstat (limited to 'FS/FS/Report/Table')
-rw-r--r-- | FS/FS/Report/Table/Monthly.pm | 8 |
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 |