X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fgraph%2Fmoney_time.cgi;h=2b98af838a582e16ced6b0efad197596ecd27d4c;hb=587f0384fb03179f6b504daeada93e193d2ea27f;hp=f085c226436030ff24c9cd28d6498fd097774285;hpb=e65c6a26ca778166aec2b2d1dd3012ab84fa611a;p=freeside.git diff --git a/httemplate/graph/money_time.cgi b/httemplate/graph/money_time.cgi index f085c2264..2b98af838 100644 --- a/httemplate/graph/money_time.cgi +++ b/httemplate/graph/money_time.cgi @@ -1,4 +1,23 @@ -<% +<% include('elements/monthly.html', + 'title' => $agentname. + 'Sales, Credits and Receipts Summary', + 'items' => \@items, + 'labels' => \%label, + 'graph_labels' => \%graph_label, + 'colors' => \%color, + 'links' => \%link, + 'start_month' => $smonth, + 'start_year' => $syear, + 'end_month' => $emonth, + 'end_year' => $eyear, + 'agentnum' => $agentnum, + 'nototal' => scalar($cgi->param('12mo')), + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); #find first month my $syear = $cgi->param('start_year'); # || 1899+$curyear; @@ -15,6 +34,7 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { $agent = qsearchs('agent', { 'agentnum' => $agentnum } ); die "agentnum $agentnum not found!" unless $agent; } + my $agentname = $agent ? $agent->agent.' ' : ''; my @items = qw( invoiced netsales credits payments receipts ); @@ -62,19 +82,4 @@ my %link = ( ); # XXX link 12mo? -%><%= include('elements/monthly.html', - 'title' => $agentname. - 'Sales, Credits and Receipts Summary', - 'items' => \@items, - 'labels' => \%label, - 'graph_labels' => \%graph_label, - 'colors' => \%color, - 'links' => \%link, - 'start_month' => $smonth, - 'start_year' => $syear, - 'end_month' => $emonth, - 'end_year' => $eyear, - 'agentnum' => $agentnum, - 'nototal' => scalar($cgi->param('12mo')), - ) -%> +