X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fgraph%2Felements%2Fmonthly.html;h=cfe5a3c6d9fba8e354cfc206098fa322932260b6;hb=f654e068b6e7be55bdbd749293c1bda7737cf870;hp=939f18a3549487f3f91728216a49d0021043d0b4;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125;p=freeside.git diff --git a/httemplate/graph/elements/monthly.html b/httemplate/graph/elements/monthly.html index 939f18a35..cfe5a3c6d 100644 --- a/httemplate/graph/elements/monthly.html +++ b/httemplate/graph/elements/monthly.html @@ -27,7 +27,7 @@ Example: 'start_year' => $syear, 'end_month' => $emonth, 'end_year' => $eyear, - + '12mo' => 0, #optional, pulled from CGI params if not specified, #only if 'daily' option is given @@ -59,6 +59,7 @@ Example: 'no_graph' => \@no_graph, 'bottom_link' => \@bottom_link, 'transpose' => $opt{'daily'}, + 'sprintf_fields' => $sprintf_fields, map { $_, $opt{$_} } (qw(title nototal graph_type @@ -79,6 +80,7 @@ my $fromparam = $opt{'link_fromparam'} || 'begin'; my $toparam = $opt{'link_toparam'} || 'end'; my @items = @{ $opt{'items'} }; +my $sprintf_fields = $opt{'sprintf_fields'}; foreach my $other (qw( labels graph_labels colors links )) { if ( ref($opt{$other}) eq 'HASH' ) { @@ -96,6 +98,8 @@ $opt{'start_year'} ||= $cgi->param('start_year'); # || 1899+$curyear; $opt{'end_month'} ||= $cgi->param('end_month'); # || $curmon+1; $opt{'end_year'} ||= $cgi->param('end_year'); # || 1900+$curyear; +$opt{'12mo'} ||= $cgi->param('12mo') ? 1 : 0; + $opt{'projection'} ||= $cgi->param('projection') ? 1 : 0; if ( $opt{'daily'} ) { # daily granularity @@ -119,12 +123,14 @@ my %reportopts = ( 'end_day' => $opt{'end_day'}, 'end_month' => $opt{'end_month'}, 'end_year' => $opt{'end_year'}, + '12mo' => $opt{'12mo'}, 'projection' => $opt{'projection'}, 'agentnum' => $opt{'agentnum'}, 'refnum' => $opt{'refnum'}, 'cust_classnum'=> $opt{'cust_classnum'}, 'remove_empty' => $opt{'remove_empty'}, 'doublemonths' => $opt{'doublemonths'}, + 'normalize' => $opt{'normalize'}, ); warn Dumper({ 'REPORTOPTS' => \%reportopts }) if $opt{'debug'}; @@ -147,17 +153,12 @@ $col_labels = $data->{label} if $opt{'daily'}; my @colors; my @graph_labels; my @no_graph; -if ( $opt{'remove_empty'} ) { +#if ( $opt{'remove_empty'} ) { # no, always do this # then filter out per-item things for collapsed rows - foreach my $i (@{ $data->{'indices'} }) { - push @colors, $opt{'colors'}[$i]; - push @graph_labels, $opt{'graph_labels'}[$i]; - push @no_graph, $opt{'no_graph'}[$i]; - } -} else { - @colors = @{ $opt{'colors'} }; - @graph_labels = @{ $opt{'graph_labels'} }; - @no_graph = @{ $opt{'no_graph'} || [] }; +foreach my $i (@{ $data->{'indices'} }) { + push @colors, $opt{'colors'}[$i]; + push @graph_labels, $opt{'graph_labels'}[$i]; + push @no_graph, $opt{'no_graph'}[$i]; } my @links;