X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_pkg.cgi;h=d0b572aa42a293cc64fa6af355be93e42da1e19c;hp=b6e47b171d0c37c3d919e106024e7e303de3dde4;hb=cf16b23820da69e3c8d0156ae27e21c635bf1ec5;hpb=6ef34dda51afba96d8dc6c4dd72427c3d4003945 diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index b6e47b171..d0b572aa4 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $p $part_pkg ); @@ -18,18 +18,39 @@ $cgi = new CGI; $p = popurl(2); -print $cgi->header( '-expires' => 'now' ), header("Package Part Listing",menubar( +my %search; +if ( $cgi->param('showdisabled') ) { + %search = (); +} else { + %search = ( 'disabled' => '' ); +} + +my @part_pkg = qsearch('part_pkg', \%search ); +my $total = scalar(@part_pkg); + +print header("Package Definition Listing",menubar( 'Main Menu' => $p, -)), "One or more services are grouped together into a package and given", - " pricing information. Customers purchase packages, not services.

", - &table(), < +)). "One or more services are grouped together into a package and given". + " pricing information. Customers purchase packages". + " rather than purchase services directly.

". + "$total packages "; + +if ( $cgi->param('showdisabled') ) { + $cgi->param('showdisabled', 0); + print qq!( hide disabled packages )!; +} else { + $cgi->param('showdisabled', 1); + print qq!( show disabled packages )!; +} + +my $colspan = $cgi->param('showdisabled') ? 2 : 3; +print &table(), < Package Comment - Setup Fee Freq. - Recur. Fee + Plan + Data Service Quan. @@ -37,21 +58,38 @@ END foreach $part_pkg ( sort { $a->getfield('pkgpart') <=> $b->getfield('pkgpart') -} qsearch('part_pkg',{}) ) { +} @part_pkg ) { my($hashref)=$part_pkg->hashref; my(@pkg_svc)=grep $_->getfield('quantity'), qsearch('pkg_svc',{'pkgpart'=> $hashref->{pkgpart} }); my($rowspan)=scalar(@pkg_svc); + my $plandata; + if ( $hashref->{plan} ) { + $plandata = $hashref->{plandata}; + $plandata =~ s/^(\w+)=/$1 /mg; + $plandata =~ s/\n/
/g; + } else { + $hashref->{plan} = "(legacy)"; + $plandata = "Setup ". $hashref->{setup}. + "
Recur ". $hashref->{recur}; + } print < - - $hashref->{pkgpart} - + $hashref->{pkgpart} +END + + unless ( $cgi->param('showdisabled') ) { + print ""; + print "DISABLED" if $hashref->{disabled}; + print ''; + } + + print <$hashref->{pkg} $hashref->{comment} - $hashref->{setup} $hashref->{freq} - $hashref->{recur} + $hashref->{plan} + $plandata END my($pkg_svc); @@ -69,7 +107,7 @@ END } print <Add new package + Add a new package definition