From 0c525f3ba7b2b6730b8939b950e4d76dd16802a9 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Thu, 5 Jan 2006 09:34:30 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'SQL_LEDGER_2_4_4'. --- httemplate/browse/part_pkg.cgi | 169 ----------------------------------------- 1 file changed, 169 deletions(-) delete mode 100755 httemplate/browse/part_pkg.cgi (limited to 'httemplate/browse/part_pkg.cgi') diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi deleted file mode 100755 index 8d5b55451..000000000 --- a/httemplate/browse/part_pkg.cgi +++ /dev/null @@ -1,169 +0,0 @@ - -<% - -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} - -my @part_pkg = qsearch('part_pkg', \%search ); -my $total = scalar(@part_pkg); - -my $sortby; -my %num_active_cust_pkg = (); -my( $suspended_sth, $canceled_sth ) = ( '', '' ); -if ( $cgi->param('active') ) { - my $active_sth = dbh->prepare( - 'SELECT COUNT(*) FROM cust_pkg WHERE pkgpart = ?'. - ' AND ( cancel IS NULL OR cancel = 0 )'. - ' AND ( susp IS NULL OR susp = 0 )' - ) or die dbh->errstr; - foreach my $part_pkg ( @part_pkg ) { - $active_sth->execute($part_pkg->pkgpart) or die $active_sth->errstr; - $num_active_cust_pkg{$part_pkg->pkgpart} = - $active_sth->fetchrow_arrayref->[0]; - } - $sortby = sub { - $num_active_cust_pkg{$b->pkgpart} <=> $num_active_cust_pkg{$a->pkgpart}; - }; - - $suspended_sth = dbh->prepare( - 'SELECT COUNT(*) FROM cust_pkg WHERE pkgpart = ?'. - ' AND ( cancel IS NULL OR cancel = 0 )'. - ' AND susp IS NOT NULL AND susp != 0' - ) or die dbh->errstr; - - $canceled_sth = dbh->prepare( - 'SELECT COUNT(*) FROM cust_pkg WHERE pkgpart = ?'. - ' AND cancel IS NOT NULL AND cancel != 0' - ) or die dbh->errstr; - -} else { - $sortby = sub { $a->pkgpart <=> $b->pkgpart; }; -} - -my $conf = new FS::Conf; -my $taxclasses = $conf->exists('enable_taxclasses'); - -%> -<%= header("Package Definition Listing",menubar( 'Main Menu' => $p )) %> -<% unless ( $cgi->param('active') ) { %> - One or more service definitions are grouped together into a package - definition and given pricing information. Customers purchase packages - rather than purchase services directly.

- Add a new package definition -

-<% } %> - -<%= $total %> package definitions -<% if ( $cgi->param('showdisabled') ) { $cgi->param('showdisabled', 0); %> - ( hide disabled packages ) -<% } else { $cgi->param('showdisabled', 1); %> - ( show disabled packages ) -<% } %> - -<% my $colspan = $cgi->param('showdisabled') ? 2 : 3; %> - -<%= &table() %> - - >Package - Comment -<% if ( $cgi->param('active') ) { %> - Customer
packages
-<% } %> - Freq. -<% if ( $taxclasses ) { %> - Taxclass -<% } %> - Plan - Data - Service - Quan. -<% if ( dbdef->table('pkg_svc')->column('primary_svc') ) { %> - Primary -<% } %> - - - -<% -foreach my $part_pkg ( sort $sortby @part_pkg ) { - my @pkg_svc = $part_pkg->pkg_svc; - my($rowspan)=scalar(@pkg_svc); - my $plandata; - if ( $part_pkg->plan ) { - $plandata = $part_pkg->plandata; - $plandata =~ s/^(\w+)=/$1 /mg; - $plandata =~ s/\n/
/g; - } else { - $part_pkg->plan('(legacy)'); - $plandata = "Setup ". $part_pkg->setup. - "
Recur ". $part_pkg->recur; - } -%> - - ><%= $part_pkg->pkgpart %> - -<% unless ( $cgi->param('showdisabled') ) { %> - > - <% if ( $part_pkg->disabled ) { %> - DISABLED - <% } %> - -<% } %> - - ><%= $part_pkg->pkg %> - ><%= $part_pkg->comment %> - -<% if ( $cgi->param('active') ) { %> - > - <%= $num_active_cust_pkg{$part_pkg->pkgpart} %> active
- - <% $suspended_sth->execute( $part_pkg->pkgpart ) - or die $suspended_sth->errstr; - my $num_suspended = $suspended_sth->fetchrow_arrayref->[0]; - %> - <%= $num_suspended %> suspended
- - <% $canceled_sth->execute( $part_pkg->pkgpart ) - or die $canceled_sth->errstr; - my $num_canceled = $canceled_sth->fetchrow_arrayref->[0]; - %> - <%= $num_canceled %> canceled - -<% } %> - - ><%= $part_pkg->freq_pretty %> - -<% if ( $taxclasses ) { %> - ><%= $part_pkg->taxclass || ' ' %> -<% } %> - - ><%= $part_pkg->plan %> - ><%= $plandata %> - -<% - my($n)=""; - foreach my $pkg_svc ( @pkg_svc ) { - my($svcpart)=$pkg_svc->getfield('svcpart'); - my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart }); - print $n,qq!!, - $part_svc->getfield('svc'),"", - $pkg_svc->getfield('quantity'),""; - if ( dbdef->table('pkg_svc')->column('primary_svc') ) { - print ''; - print 'PRIMARY' if $pkg_svc->primary_svc =~ /^Y/i; - print ''; - } - print "\n"; - $n=""; - } -%> - - -<% } %> - - - - -- cgit v1.2.1