X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htdocs%2Fview%2Fcust_pkg.cgi;h=0054ee0fa7e6dff685b8f25622a1f62bedc33fdb;hb=069f8453eb624a0d4a77734aca8bc9367dbb60e6;hp=939fcc2dcdb974511f2b1de357437700489d3adf;hpb=37dcdd94962587d6dbc3225439c91e46b0b623c5;p=freeside.git diff --git a/htdocs/view/cust_pkg.cgi b/htdocs/view/cust_pkg.cgi index 939fcc2dc..0054ee0fa 100755 --- a/htdocs/view/cust_pkg.cgi +++ b/htdocs/view/cust_pkg.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: cust_pkg.cgi,v 1.8 1999-02-28 00:04:01 ivan Exp $ +# $Id: cust_pkg.cgi,v 1.11 1999-04-09 04:22:34 ivan Exp $ # # Usage: cust_pkg.cgi pkgnum # http://server.name/path/cust_pkg.cgi?pkgnum @@ -24,7 +24,16 @@ # no FS::Search ivan@sisd.com 98-mar-7 # # $Log: cust_pkg.cgi,v $ -# Revision 1.8 1999-02-28 00:04:01 ivan +# Revision 1.11 1999-04-09 04:22:34 ivan +# also table() +# +# Revision 1.10 1999/04/09 03:52:55 ivan +# explicit & for table/itable/ntable +# +# Revision 1.9 1999/04/08 12:00:19 ivan +# aesthetic update +# +# Revision 1.8 1999/02/28 00:04:01 ivan # removed misleading comments # # Revision 1.7 1999/01/19 05:14:20 ivan @@ -54,7 +63,7 @@ use Date::Format; use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl header); +use FS::CGI qw(popurl header menubar ntable table); use FS::Record qw(qsearch qsearchs); use FS::part_svc; use FS::cust_pkg; @@ -70,8 +79,6 @@ foreach $part_svc ( qsearch('part_svc',{}) ) { $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi"; } -print $cgi->header( '-expires' => 'now' ), header('Package View', ''); - ($query) = $cgi->keywords; $query =~ /^(\d+)$/; $pkgnum = $1; @@ -81,10 +88,11 @@ $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); die "No package!" unless $cust_pkg; $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); -#nav bar $custnum = $cust_pkg->getfield('custnum'); -print qq!
Package: $pkg - $comment";
-
($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
-print " Order taken by $otaker";
+
+print "Package information";
+print ' (unsuspend)' if ( $susp && ! $cancel );
+print ' (suspend)' unless ( $susp || $cancel );
+print ' (cancel)' unless $cancel;
+
+print &ntable("#c0c0c0"), '
Setup: ", $setup ? time2str("%D",$setup) : "(Not setup)" ,"";
-print "
Next bill: ", $bill ? time2str("%D",$bill) : "" ,"";
-
-if ($susp) {
- print "
Suspended: ", time2str("%D",$susp), "";
- print qq! Unsuspend! unless $cancel;
-} else {
- print qq!
Suspend! unless $cancel;
-}
-
-if ($expire) {
- print "
Expire: ", time2str("%D",$expire), "";
-}
- print <
Cancelled: ", time2str("%D",$cancel), "";
-} else {
- print qq!
Cancel now!;
-}
-
-#otaker
$otaker = $cust_pkg->getfield('otaker');
-print "', &ntable("#c0c0c0",2),
+ ' ',
+ 'Package number ',
+ $pkgnum, ' ',
+ 'Package ',
+ $pkg, ' ',
+ 'Comment ',
+ $comment, ' ',
+ 'Setup date ',
+ ( $setup ? time2str("%D",$setup) : "(Not setup)" ), ' ',
+;
+print 'Next bill date ',
+ ( $bill ? time2str("%D",$bill) : " " ), ' ' if $susp;
+print 'Suspension date ',
+ time2str("%D",$susp), ' ' if $expire;
+print 'Expiration date ',
+ time2str("%D",$expire), ' ' if $cancel;
+print 'Cancellation date ',
+ time2str("%D",$cancel), ' ',
+ ''
+;
+
+# print <Order taker ',
+ $otaker, '
Click on service to view/edit/add service.
-
-
",
+ "Choose (View) to view or edit an existing service
+Service
-END
+ print '
Service Information', &table();
#list of services this pkgpart includes
- my($pkg_svc,%pkg_svc);
+ my $pkg_svc;
+ my %pkg_svc = ();
foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) {
$pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity;
}
#list of records from cust_svc
- my($svcpart);
+ my $svcpart;
foreach $svcpart (sort {$a <=> $b} keys %pkg_svc) {
my($svc)=qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc');
@@ -167,8 +170,9 @@ END
my($cust_svc);
if ( $cust_svc=shift @cust_svc ) {
my($svcnum)=$cust_svc->svcnum;
+ my($label, $value, $svcdb) = $cust_svc->label;
print <(View) $svc
END
} else {
print <(View) $svc: $value
",
+ "Choose (Add) to setup a new service
",
+ "Choose (Link to existing) to link to a legacy (pre-Freeside) service",
+ ""
+ ;
}
#formatting