X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fgraph%2Fmoney_time-graph.cgi;h=637a3bf9425f11b8eeedeb635e2e46bcb8d4f568;hb=f29c752d6f9e813c10295b334eefb924216e34cf;hp=bb3d23aae7949afd28dc70af2389c7f287d523f0;hpb=f7fd2a3e34da751cbc02bbf215e99c6dc89adc15;p=freeside.git diff --git a/httemplate/graph/money_time-graph.cgi b/httemplate/graph/money_time-graph.cgi index bb3d23aae..637a3bf94 100755 --- a/httemplate/graph/money_time-graph.cgi +++ b/httemplate/graph/money_time-graph.cgi @@ -12,10 +12,20 @@ my $eyear = $cgi->param('eyear') || 1900+$curyear; my $emonth = $cgi->param('emonth') || $curmon+1; #if ( $emonth++>12 ) { $emonth-=12; $eyear++; } +# XXX or virtual +my $agentnum = ''; +if ( $cgi->param('agentnum') =~ /^(\d*)$/ ) { + $agentnum = $1; +} + #my @labels; #my %data; my @items = qw( invoiced netsales credits payments receipts ); +if ( $cgi->param('12mo') == 1 ) { + @items = map $_.'_12mo', @items; +} + my %label = ( 'invoiced' => 'Gross Sales (invoiced)', 'netsales' => 'Net Sales (invoiced - applied credits)', @@ -23,6 +33,9 @@ my %label = ( 'payments' => 'Gross Receipts (payments)', 'receipts' => 'Net Receipts/Cashflow (payments - refunds)', ); +$label{$_.'_12mo'} = $label{$_}. " (previous 12 months)" + foreach keys %label; + my %color = ( 'invoiced' => [ 153, 153, 255 ], #light blue 'netsales' => [ 0, 0, 204 ], #blue @@ -30,6 +43,8 @@ my %color = ( 'payments' => [ 153, 204, 153 ], #light green 'receipts' => [ 0, 204, 0 ], #green ); +$color{$_.'_12mo'} = $color{$_} + foreach keys %color; my $report = new FS::Report::Table::Monthly ( 'items' => \@items, @@ -37,6 +52,7 @@ my $report = new FS::Report::Table::Monthly ( 'start_year' => $syear, 'end_month' => $emonth, 'end_year' => $eyear, + 'agentnum' => $agentnum, ); my %data = %{$report->data};