[freeside-commits] freeside/httemplate/search customer_accounting_summary.html, NONE, 1.1.2.2 report_customer_accounting_summary.html, NONE, 1.1.2.2

Erik Levinson levinse at wavetail.420.am
Thu Dec 30 15:03:54 PST 2010


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv24398/httemplate/search

Added Files:
      Tag: FREESIDE_2_1_BRANCH
	customer_accounting_summary.html 
	report_customer_accounting_summary.html 
Log Message:
add customer accounting summary report, RT10911

--- NEW FILE: customer_accounting_summary.html ---
<% include('/graph/elements/monthly.html',
   #Dumper(
                'title'        => $title,
                'graph_type'   => 'none',
                'items'        => \@items,
                'params'       => \@params,
                'labels'       => \@labels,
                'graph_labels' => \@labels,
                'remove_empty' => 1,
                'bottom_total' => 1,
                'agentnum'     => $agentnum,
		'doublemonths' => \@doublemonths,
		'nototal'	=> 1,
             )
%>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');

my @doublemonths = ( 'Billed', 'Paid' );

my ($agentnum,$sel_agent);
if ( $cgi->param('agentnum') eq 'all' ) {
  $agentnum = 0;
}
elsif ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
  $agentnum = $1;
  $sel_agent = qsearchs('agent', { 'agentnum' => $agentnum } );
  die "agentnum $agentnum not found!" unless $sel_agent;
}
my $title = $sel_agent ? $sel_agent->agent.' ' : '';
$title .= 'Customer Accounting Summary Report';

my @custs = ();
@custs = qsearch('cust_main', {} ); 

my @items  = ();
my @params = ();
my @labels = ();

my $status = $cgi->param('status');
die "invalid status" unless $status =~ /^\w+|$/;

foreach my $cust_main ( @custs ) {
  next unless ($status eq '' || $status eq $cust_main->status); 
  next unless ($agentnum == 0 || $cust_main->agentnum eq $agentnum);

  push @items, 'netsales', 'cashflow';

  push @labels, $cust_main->name;

  push @params, [ ('custnum' => $cust_main->custnum),
		],
		[ ('custnum' => $cust_main->custnum),
		];
}

</%init>

--- NEW FILE: report_customer_accounting_summary.html ---
<% include('/elements/header.html', 'Customer Accounting Summary Report' ) %>

<FORM ACTION="customer_accounting_summary.html" METHOD="GET">

  <TABLE BGCOLOR="#cccccc" CELLSPACING=0>

    <% include( '/elements/tr-select-agent.html',
                 'curr_value'    => scalar( $cgi->param('agentnum') ),
                 'label'         => 'Agent ',
                 'disable_empty' => 0,
             )
    %>

    <% include('/elements/tr-select-from_to.html' ) %>
    
    <% include( '/elements/tr-select-cust_main-status.html',
		'label' => 'Customer Status'
    ) %>
    
  </TABLE>

<BR>
<INPUT TYPE="submit" VALUE="Get Report">

</FORM>

<% include('/elements/footer.html') %>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');

</%init>



More information about the freeside-commits mailing list