X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fgraph%2Fcust_bill_pkg.cgi;h=b655f1f01bb693209ad46f836e6826bdc3e2a5c1;hb=b6a644c59f47d0a890c2f3122d362a72958fbc58;hp=d7cae80556624dae048efba38f024fa0582453f5;hpb=6b74e2e7a98a11b8b4f62a10676ba8b37ee2ef4f;p=freeside.git diff --git a/httemplate/graph/cust_bill_pkg.cgi b/httemplate/graph/cust_bill_pkg.cgi index d7cae8055..b655f1f01 100644 --- a/httemplate/graph/cust_bill_pkg.cgi +++ b/httemplate/graph/cust_bill_pkg.cgi @@ -9,7 +9,7 @@ 'links' => \@links, 'remove_empty' => 1, 'bottom_total' => 1, - 'bottom_link' => "$link;", + 'bottom_link' => $bottom_link, 'agentnum' => $agentnum, ) %> @@ -18,30 +18,52 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); +my $link = "${p}search/cust_bill_pkg.cgi?nottax=1;include_comp_cust=1"; +my $bottom_link = "$link;"; + #XXX or virtual my( $agentnum, $sel_agent ) = ('', ''); if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { $agentnum = $1; + $bottom_link .= "agentnum=$agentnum;"; $sel_agent = qsearchs('agent', { 'agentnum' => $agentnum } ); die "agentnum $agentnum not found!" unless $sel_agent; } my $title = $sel_agent ? $sel_agent->agent.' ' : ''; -#false lazinessish w/search/cust_pkg.cgi +#classnum (here) +# 0: all classes +# not specified: empty class +# N: classnum +#classnum (link) +# not specified: all classes +# 0: empty class +# N: classnum + +#false lazinessish w/FS::cust_pkg::search_sql (previously search/cust_pkg.cgi) my $classnum = 0; my @pkg_class = (); if ( $cgi->param('classnum') =~ /^(\d*)$/ ) { $classnum = $1; - if ( $classnum ) { + + if ( $classnum ) { #a specific class + @pkg_class = ( qsearchs('pkg_class', { 'classnum' => $classnum } ) ); die "classnum $classnum not found!" unless $pkg_class[0]; $title .= $pkg_class[0]->classname.' '; - } elsif ( $classnum eq '' ) { + $bottom_link .= "classnum=$classnum;"; + + } elsif ( $classnum eq '' ) { #the empty class + $title .= 'Empty class '; @pkg_class = ( '(empty class)' ); - } elsif ( $classnum eq '0' ) { + $bottom_link .= "classnum=0;"; + + } elsif ( $classnum eq '0' ) { #all classes + @pkg_class = qsearch('pkg_class', {} ); # { 'disabled' => '' } ); push @pkg_class, '(empty class)'; + } } #eslaf @@ -57,8 +79,6 @@ 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 @@ -75,7 +95,6 @@ foreach my $agent ( $sel_agent || qsearch('agent', { 'disabled' => '' } ) ) { push @items, 'cust_bill_pkg'; - push @labels, ( $sel_agent ? '' : $agent->agent.' ' ). ( $classnum eq '0'