[freeside-commits] freeside/httemplate/graph cust_bill_pkg.cgi, 1.5, 1.5.2.1 money_time.cgi, 1.16, 1.16.2.1 cust_pkg.cgi, NONE, 1.1.2.2 report_cust_pkg.html, NONE, 1.1.2.2

Ivan,,, ivan at wavetail.420.am
Tue Aug 14 14:47:26 PDT 2007


Update of /home/cvs/cvsroot/freeside/httemplate/graph
In directory wavetail:/tmp/cvs-serv30553/httemplate/graph

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	cust_bill_pkg.cgi money_time.cgi 
Added Files:
      Tag: FREESIDE_1_7_BRANCH
	cust_pkg.cgi report_cust_pkg.html 
Log Message:
add package churn report/graph

--- NEW FILE: report_cust_pkg.html ---
<% include('/elements/header.html', 'Package Churn Summary' ) %>

<FORM ACTION="cust_pkg.cgi" METHOD="GET">

<TABLE>

<% include('/elements/tr-select-from_to.html' ) %>

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

</TABLE>

<BR><INPUT TYPE="submit" VALUE="Display">
</FORM>

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

#XXX use a different ACL for package churn?
die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');

</%init>

Index: money_time.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/graph/money_time.cgi,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- money_time.cgi	3 Feb 2007 11:36:30 -0000	1.16
+++ money_time.cgi	14 Aug 2007 21:47:23 -0000	1.16.2.1
@@ -6,10 +6,6 @@
                 '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')),
              )
@@ -19,14 +15,6 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
 
-#find first month
-my $syear = $cgi->param('start_year'); # || 1899+$curyear;
-my $smonth = $cgi->param('start_month'); # || $curmon+1;
-
-#find last month
-my $eyear = $cgi->param('end_year'); # || 1900+$curyear;
-my $emonth = $cgi->param('end_month'); # || $curmon+1;
-
 #XXX or virtual
 my( $agentnum, $agent ) = ('', '');
 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {

Index: cust_bill_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/graph/cust_bill_pkg.cgi,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- cust_bill_pkg.cgi	3 Feb 2007 11:36:30 -0000	1.5
+++ cust_bill_pkg.cgi	14 Aug 2007 21:47:23 -0000	1.5.2.1
@@ -10,10 +10,6 @@
                 'remove_empty' => 1,
                 'bottom_total' => 1,
                 'bottom_link'  => "$link;",
-                'start_month'  => $smonth,
-                'start_year'   => $syear,
-                'end_month'    => $emonth,
-                'end_year'     => $eyear,
                 'agentnum'     => $agentnum,
              )
 %>
@@ -22,14 +18,6 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
 
-#find first month
-my $syear = $cgi->param('start_year'); # || 1899+$curyear;
-my $smonth = $cgi->param('start_month'); # || $curmon+1;
-
-#find last month
-my $eyear = $cgi->param('end_year'); # || 1900+$curyear;
-my $emonth = $cgi->param('end_month'); # || $curmon+1;
-
 #XXX or virtual
 my( $agentnum, $sel_agent ) = ('', '');
 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {

--- NEW FILE: cust_pkg.cgi ---
<% include('elements/monthly.html',
                'title'         => $agentname. 'Package Churn',
                'items'         => \@items,
                'labels'        => \%label,
                'graph_labels'  => \%graph_label,
                'colors'        => \%color,
                'links'         => \%link,
                'agentnum'      => $agentnum,
                'sprintf'       => '%u',
                'disable_money' => 1,
             )
%>
<%init>

#XXX use a different ACL for package churn?
die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');

#false laziness w/money_time.cgi, cust_bill_pkg.cgi

#XXX or virtual
my( $agentnum, $agent ) = ('', '');
if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
  $agentnum = $1;
  $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
  die "agentnum $agentnum not found!" unless $agent;
}

my $agentname = $agent ? $agent->agent.' ' : '';

my @items = qw( setup_pkg susp_pkg cancel_pkg );

my %label = (
  'setup_pkg'  => 'New orders',
  'susp_pkg'   => 'Suspensions',
#  'unsusp' => 'Unsuspensions',
  'cancel_pkg' => 'Cancellations',
);
my %graph_label = %label;

my %color = (
  'setup_pkg'   => '00cc00', #green
  'susp_pkg'    => 'ff9900', #yellow
  #'unsusp'  => '', #light green?
  'cancel_pkg'  => 'cc0000', #red ? 'ff0000'
);

my %link = (
  'setup_pkg'  => { 'link' => "${p}search/cust_pkg.cgi?agentnum=$agentnum;",
                    'fromparam' => 'setup_begin',
                    'toparam'   => 'setup_end',
                  },
  'susp_pkg'   => { 'link' => "${p}search/cust_pkg.cgi?agentnum=$agentnum;",
                    'fromparam' => 'susp_begin',
                    'toparam'   => 'susp_end',
                  },
  'cancel_pkg' => { 'link' => "${p}search/cust_pkg.cgi?agentnum=$agentnum;",
                    'fromparam' => 'cancel_begin',
                    'toparam'   => 'cancel_end',
                  },
);

</%init>



More information about the freeside-commits mailing list