X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fgraph%2Fcust_bill_pkg.cgi;h=4070069acd159c4f5e8142db4abfd15f45120672;hb=590603ecaea3184f64530755a76626be8205da49;hp=0dbd222ceae6bb03d4baee49a9e54eea9f828a0f;hpb=e65c6a26ca778166aec2b2d1dd3012ab84fa611a;p=freeside.git diff --git a/httemplate/graph/cust_bill_pkg.cgi b/httemplate/graph/cust_bill_pkg.cgi index 0dbd222ce..4070069ac 100644 --- a/httemplate/graph/cust_bill_pkg.cgi +++ b/httemplate/graph/cust_bill_pkg.cgi @@ -1,5 +1,26 @@ -<% +<% include('elements/monthly.html', + 'title' => $title. 'Sales Report (Gross)', + 'graph_type' => 'Mountain', + 'items' => \@items, + 'params' => \@params, + 'labels' => \@labels, + 'graph_labels' => \@labels, + 'colors' => \@colors, + 'links' => \@links, + 'remove_empty' => 1, + 'bottom_total' => 1, + 'bottom_link' => "$link;", + 'start_month' => $smonth, + 'start_year' => $syear, + 'end_month' => $emonth, + 'end_year' => $eyear, + 'agentnum' => $agentnum, + ) +%> +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); #find first month my $syear = $cgi->param('start_year'); # || 1899+$curyear; @@ -18,6 +39,7 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { } my $title = $sel_agent ? $sel_agent->agent.' ' : ''; +#false lazinessish w/search/cust_pkg.cgi my $classnum = 0; my @pkg_class = (); if ( $cgi->param('classnum') =~ /^(\d*)$/ ) { @@ -34,19 +56,25 @@ if ( $cgi->param('classnum') =~ /^(\d*)$/ ) { push @pkg_class, '(empty class)'; } } +#eslaf my $hue = 0; -my $hue_increment = 145; +#my $hue_increment = 170; +#my $hue_increment = 145; +my $hue_increment = 125; -my @items = (); +my @items = (); my @params = (); my @labels = (); my @colors = (); +my @links = (); + +my $link = "${p}search/cust_bill_pkg.cgi?nottax=1;include_comp_cust=1"; foreach my $agent ( $sel_agent || qsearch('agent', { 'disabled' => '' } ) ) { my $col_scheme = Color::Scheme->new - ->from_hue($hue) + ->from_hue($hue) #->from_hex($agent->color) ->scheme('analogic') ; my @recur_colors = (); @@ -67,9 +95,13 @@ foreach my $agent ( $sel_agent || qsearch('agent', { 'disabled' => '' } ) ) { : '' ); - # push some params - push @params, - [ 'classnum' => ( ref($pkg_class) ? $pkg_class->classnum : '' ) ]; + my $row_classnum = ref($pkg_class) ? $pkg_class->classnum : 0; + my $row_agentnum = $agent->agentnum; + push @params, [ 'classnum' => $row_classnum, + 'agentnum' => $row_agentnum, + ]; + + push @links, "$link;agentnum=$row_agentnum;classnum=$row_classnum;"; @recur_colors = ($col_scheme->colors)[0,4,8,1,5,9] unless @recur_colors; @@ -83,22 +115,7 @@ foreach my $agent ( $sel_agent || qsearch('agent', { 'disabled' => '' } ) ) { } -use Data::Dumper; -warn Dumper(\@items); +#use Data::Dumper; +#warn Dumper(\@items); -%><%= include('elements/monthly.html', - 'title' => $title. 'Sales Report', - 'graph_type' => 'Mountain', - 'items' => \@items, - 'params' => \@params, - 'labels' => \@labels, - 'graph_labels' => \@labels, - 'colors' => \@colors, - #'links' => \%link, - 'start_month' => $smonth, - 'start_year' => $syear, - 'end_month' => $emonth, - 'end_year' => $eyear, - 'agentnum' => $agentnum, - ) -%> +