From 51984ac3d3da3006809c6866fdecd4ad83610731 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jul 2001 07:36:04 +0000 Subject: templates!!! --- httemplate/view/cust_pkg.cgi | 210 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100755 httemplate/view/cust_pkg.cgi (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi new file mode 100755 index 000000000..5e733225b --- /dev/null +++ b/httemplate/view/cust_pkg.cgi @@ -0,0 +1,210 @@ +<% +# +# $Id: cust_pkg.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# Usage: cust_pkg.cgi pkgnum +# http://server.name/path/cust_pkg.cgi?pkgnum +# +# ivan@voicenet.com 96-dec-15 +# +# services section needs to be cleaned up, needs to display extraneous +# entries in cust_pkg! +# ivan@voicenet.com 96-dec-31 +# +# added navigation bar +# ivan@voicenet.com 97-jan-30 +# +# changed and fixed up suspension and cancel stuff, now you can't add +# services to a cancelled package +# ivan@voicenet.com 97-feb-27 +# +# rewrote for new API, still needs to be cleaned up! +# ivan@voicenet.com 97-jul-29 +# +# no FS::Search ivan@sisd.com 98-mar-7 +# +# $Log: cust_pkg.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# 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 +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.6 1999/01/18 09:41:44 ivan +# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl +# (good idea anyway) +# +# Revision 1.5 1998/12/23 03:11:40 ivan +# *** empty log message *** +# +# Revision 1.3 1998/12/17 09:57:22 ivan +# s/CGI::(Base|Request)/CGI.pm/; +# +# Revision 1.2 1998/11/13 09:56:49 ivan +# change configuration file layout to support multiple distinct databases (with +# own set of config files, export, etc.) +# + +use strict; +use vars qw ( $cgi %uiview %uiadd $part_svc $query $pkgnum $cust_pkg $part_pkg + $custnum $susp $cancel $expire $pkg $comment $setup $bill + $otaker ); +use Date::Format; +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl header menubar ntable table); +use FS::Record qw(qsearch qsearchs); +use FS::part_svc; +use FS::cust_pkg; +use FS::part_pkg; +use FS::pkg_svc; +use FS::cust_svc; + +$cgi = new CGI; +cgisuidsetup($cgi); + +foreach $part_svc ( qsearch('part_svc',{}) ) { + $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi"; + $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi"; +} + +($query) = $cgi->keywords; +$query =~ /^(\d+)$/; +$pkgnum = $1; + +#get package record +$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +die "No package!" unless $cust_pkg; +$part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); + +$custnum = $cust_pkg->getfield('custnum'); +print $cgi->header( '-expires' => 'now' ), header('Package View', menubar( + "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", + 'Main Menu' => popurl(2) +)); + +#print info +($susp,$cancel,$expire)=( + $cust_pkg->getfield('susp'), + $cust_pkg->getfield('cancel'), + $cust_pkg->getfield('expire'), +); +($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); +($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); +$otaker = $cust_pkg->getfield('otaker'); + +print "Package information"; +print ' (unsuspend)' if ( $susp && ! $cancel ); +print ' (suspend)' unless ( $susp || $cancel ); +print ' (cancel)' unless $cancel; + +print &ntable("#cccccc"), '', &ntable("#cccccc",2), + 'Package number', + $pkgnum, '', + 'Package', + $pkg, '', + 'Comment', + $comment, '', + 'Setup date', + ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '', + 'Next bill date', + ( $bill ? time2str("%D",$bill) : " " ), '', +; +print 'Suspension date', + time2str("%D",$susp), '' if $susp; +print 'Expiration date', + time2str("%D",$expire), '' if $expire; +print 'Cancellation date', + time2str("%D",$cancel), '' if $cancel; +print 'Order taker', + $otaker, '', + '' +; + +# print < +# +#Expire (date): +# +#END + +unless ($cancel) { + + #services + print '
Service Information', &table(); + + #list of services this pkgpart includes + 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; + foreach $svcpart (sort {$a <=> $b} keys %pkg_svc) { + + my($svc)=qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc'); + + my(@cust_svc)=qsearch('cust_svc',{'pkgnum'=>$pkgnum, + 'svcpart'=>$svcpart, + }); + + my($enum); + for $enum ( 1 .. $pkg_svc{$svcpart} ) { + + my($cust_svc); + if ( $cust_svc=shift @cust_svc ) { + my($svcnum)=$cust_svc->svcnum; + my($label, $value, $svcdb) = $cust_svc->label; + print <(View) $svc: $value +END + } else { + print < + + (Add) $svc + or + (Link to existing) $svc + + +END + } + + } + warn "WARNING: Leftover services pkgnum $pkgnum!" if @cust_svc;; + } + + print "", + "Choose (View) to view or edit an existing service
", + "Choose (Add) to setup a new service
", + "Choose (Link to existing) to link to a legacy (pre-Freeside) service", + "
" + ; +} + +#formatting +print < + +END + +%> -- cgit v1.2.1 From 3d671921441ba8422650b54435a1959ad1d4c71d Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 21 Aug 2001 02:31:57 +0000 Subject: remove $Log$ messages. whew. --- httemplate/view/cust_pkg.cgi | 59 +------------------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index 5e733225b..b354318d4 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -1,62 +1,5 @@ <% -# -# $Id: cust_pkg.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# Usage: cust_pkg.cgi pkgnum -# http://server.name/path/cust_pkg.cgi?pkgnum -# -# ivan@voicenet.com 96-dec-15 -# -# services section needs to be cleaned up, needs to display extraneous -# entries in cust_pkg! -# ivan@voicenet.com 96-dec-31 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# changed and fixed up suspension and cancel stuff, now you can't add -# services to a cancelled package -# ivan@voicenet.com 97-feb-27 -# -# rewrote for new API, still needs to be cleaned up! -# ivan@voicenet.com 97-jul-29 -# -# no FS::Search ivan@sisd.com 98-mar-7 -# -# $Log: cust_pkg.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# 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 -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.6 1999/01/18 09:41:44 ivan -# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl -# (good idea anyway) -# -# Revision 1.5 1998/12/23 03:11:40 ivan -# *** empty log message *** -# -# Revision 1.3 1998/12/17 09:57:22 ivan -# s/CGI::(Base|Request)/CGI.pm/; -# -# Revision 1.2 1998/11/13 09:56:49 ivan -# change configuration file layout to support multiple distinct databases (with -# own set of config files, export, etc.) -# +# use strict; use vars qw ( $cgi %uiview %uiadd $part_svc $query $pkgnum $cust_pkg $part_pkg -- cgit v1.2.1 From 9410e9f656b950a9d4b383a3992fa50bb7a270db Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 15 Oct 2001 14:58:03 +0000 Subject: date editing --- httemplate/view/cust_pkg.cgi | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index b354318d4..6dd1d2455 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw ( $cgi %uiview %uiadd $part_svc $query $pkgnum $cust_pkg $part_pkg @@ -50,13 +50,30 @@ print $cgi->header( '-expires' => 'now' ), header('Package View', menubar( ($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); $otaker = $cust_pkg->getfield('otaker'); +print < +function areyousure(href) { + if (confirm("Permanantly delete included services and cancel this package?") == true) + window.location.href = href; +} + +END + print "Package information"; print ' (unsuspend)' if ( $susp && ! $cancel ); + '">unsuspend)' + if ( $susp && ! $cancel ); + print ' (suspend)' unless ( $susp || $cancel ); -print ' (cancel)' unless $cancel; + '">suspend)' + unless ( $susp || $cancel ); + +print ' (cancel)' + unless $cancel; + +print ' (edit dates)'; print &ntable("#cccccc"), '', &ntable("#cccccc",2), 'Package number', -- cgit v1.2.1 From 91387f8f489e561deaf1de052d80ef800a4970a3 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 26 Oct 2001 10:24:56 +0000 Subject: cache foo *sigh* --- httemplate/view/cust_pkg.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index 6dd1d2455..5ddb17aee 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw ( $cgi %uiview %uiadd $part_svc $query $pkgnum $cust_pkg $part_pkg @@ -35,7 +35,7 @@ die "No package!" unless $cust_pkg; $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); $custnum = $cust_pkg->getfield('custnum'); -print $cgi->header( '-expires' => 'now' ), header('Package View', menubar( +print $cgi->header( @FS::CGI::header ), header('Package View', menubar( "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", 'Main Menu' => popurl(2) )); -- cgit v1.2.1 From c14a267229fc0d6f2d2afdebab3bd34d825df2ef Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Oct 2001 14:54:07 +0000 Subject: get rid of header foo in individual templates --- httemplate/view/cust_pkg.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index 5ddb17aee..c8b362cc3 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw ( $cgi %uiview %uiadd $part_svc $query $pkgnum $cust_pkg $part_pkg @@ -35,7 +35,7 @@ die "No package!" unless $cust_pkg; $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); $custnum = $cust_pkg->getfield('custnum'); -print $cgi->header( @FS::CGI::header ), header('Package View', menubar( +print header('Package View', menubar( "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", 'Main Menu' => popurl(2) )); -- cgit v1.2.1 From 1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 30 Jan 2002 14:18:09 +0000 Subject: remove use Module; and $cgi = new CGI; &cgisuidsetup(); from all templates. should work better under Mason. --- httemplate/view/cust_pkg.cgi | 45 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 31 deletions(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index c8b362cc3..0e6773713 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -1,54 +1,37 @@ + <% -# - -use strict; -use vars qw ( $cgi %uiview %uiadd $part_svc $query $pkgnum $cust_pkg $part_pkg - $custnum $susp $cancel $expire $pkg $comment $setup $bill - $otaker ); -use Date::Format; -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl header menubar ntable table); -use FS::Record qw(qsearch qsearchs); -use FS::part_svc; -use FS::cust_pkg; -use FS::part_pkg; -use FS::pkg_svc; -use FS::cust_svc; - -$cgi = new CGI; -cgisuidsetup($cgi); - -foreach $part_svc ( qsearch('part_svc',{}) ) { + +my %uiview = (); +my %uiadd = (); +foreach my $part_svc ( qsearch('part_svc',{}) ) { $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi"; $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi"; } -($query) = $cgi->keywords; +my ($query) = $cgi->keywords; $query =~ /^(\d+)$/; -$pkgnum = $1; +my $pkgnum = $1; #get package record -$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); die "No package!" unless $cust_pkg; -$part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); +my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); -$custnum = $cust_pkg->getfield('custnum'); +my $custnum = $cust_pkg->getfield('custnum'); print header('Package View', menubar( "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", 'Main Menu' => popurl(2) )); #print info -($susp,$cancel,$expire)=( +my ($susp,$cancel,$expire)=( $cust_pkg->getfield('susp'), $cust_pkg->getfield('cancel'), $cust_pkg->getfield('expire'), ); -($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); -($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); -$otaker = $cust_pkg->getfield('otaker'); +my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); +my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); +my $otaker = $cust_pkg->getfield('otaker'); print < -- cgit v1.2.1 From 22a35047ecdffff80110e06cc08fc84f9ddba9b0 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 13:21:31 +0000 Subject: removed from all files to fix any redirects, whew Mason handler.pl overrides CGI::redirect fixed strict; problems in edit/part_pkg.cgi & edit/process/part_pkg.cgi --- httemplate/view/cust_pkg.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index 0e6773713..3cf908386 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -1,4 +1,3 @@ - <% my %uiview = (); -- cgit v1.2.1 From a4c96748eb6eab29a70f3a944c6520283a635c78 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 16:05:22 +0000 Subject: *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. --- httemplate/view/cust_pkg.cgi | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index 3cf908386..e9670cd22 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -1,3 +1,4 @@ + <% my %uiview = (); -- cgit v1.2.1 From 4dbbbee37e78a035022974d19b3b80aeaead6049 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 22 Feb 2002 01:07:23 +0000 Subject: UI work: make all functions of view/cust_pkg.cgi available on view/cust_main.cgi - having them one link down in "Edit" is confusing. closes: Bug#325 --- httemplate/view/cust_pkg.cgi | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index e9670cd22..75fe983b4 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -1,6 +1,8 @@ <% +my $conf = new FS::Conf; + my %uiview = (); my %uiadd = (); foreach my $part_svc ( qsearch('part_svc',{}) ) { @@ -118,18 +120,18 @@ unless ($cancel) { my($svcnum)=$cust_svc->svcnum; my($label, $value, $svcdb) = $cust_svc->label; print <(View) $svc: $value +(View/Edit) $svc: $value END } else { - print < - - (Add) $svc - or - (Link to existing) $svc - - -END + print qq!!. + qq!!. + qq!(Provision) $svc!; + + print qq! or !. + qq!(Link to legacy) $svc! + if $conf->exists('legacy_link'); + + print ''; } } @@ -137,11 +139,13 @@ END } print "", - "Choose (View) to view or edit an existing service
", - "Choose (Add) to setup a new service
", - "Choose (Link to existing) to link to a legacy (pre-Freeside) service", - "
" - ; + "Choose (View/Edit) to view or edit an existing service
", + "Choose (Provision) to setup a new service
"; + + print "Choose (Link to legacy) to link to a legacy (pre-Freeside) service" + if $conf->exists('legacy_link'); + + print ""; } #formatting -- cgit v1.2.1 From 86bf1d97a86661716d2d0276b28985c24180153b Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 6 Jul 2002 08:32:22 +0000 Subject: speling --- httemplate/view/cust_pkg.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index 75fe983b4..09a2a7a8b 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -38,7 +38,7 @@ my $otaker = $cust_pkg->getfield('otaker'); print < function areyousure(href) { - if (confirm("Permanantly delete included services and cancel this package?") == true) + if (confirm("Permanently delete included services and cancel this package?") == true) window.location.href = href; } -- cgit v1.2.1 From 641abe71e152f194c551d21ceeb26c15265795f6 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 19 Sep 2002 07:15:03 +0000 Subject: cancel later in view UI... hmm --- httemplate/view/cust_pkg.cgi | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index 09a2a7a8b..aa3b3b15a 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -83,12 +83,14 @@ print 'Order taker', '' ; -# print < -# -#Expire (date): -# -#END +unless ($expire) { + print < + +Expire (date): + +END +} unless ($cancel) { -- cgit v1.2.1 From f3b8b72d2a07683b2deb2774f29407e25e725b5a Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 1 Apr 2003 01:22:25 +0000 Subject: correct last_bill problems with $0 invoice (non-existant) edge cases --- httemplate/view/cust_pkg.cgi | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index aa3b3b15a..c3880114c 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -68,10 +68,16 @@ print &ntable("#cccccc"), '', &ntable("#cccccc",2), 'Comment', $comment, '', 'Setup date', - ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '', - 'Next bill date', - ( $bill ? time2str("%D",$bill) : " " ), '', -; + ( $setup ? time2str("%D",$setup) : "(Not setup)" ), ''; + +print 'Last bill date', + ( $cust_pkg->last_bill ? time2str("%D",$cust_pkg->last_bill) : " " ), + '' + if $cust_pkg->dbdef_table->column('last_bill'); + +print 'Next bill date', + ( $bill ? time2str("%D",$bill) : " " ), ''; + print 'Suspension date', time2str("%D",$susp), '' if $susp; print 'Expiration date', @@ -80,8 +86,7 @@ print 'Cancellation date', time2str("%D",$cancel), '' if $cancel; print 'Order taker', $otaker, '', - '' -; + ''; unless ($expire) { print < Date: Sat, 10 May 2003 06:45:45 +0000 Subject: first pass at new package list UI --- httemplate/view/cust_pkg.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index c3880114c..5f0e6bffc 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -71,7 +71,7 @@ print &ntable("#cccccc"), '', &ntable("#cccccc",2), ( $setup ? time2str("%D",$setup) : "(Not setup)" ), ''; print 'Last bill date', - ( $cust_pkg->last_bill ? time2str("%D",$cust_pkg->last_bill) : " " ), + ( $cust_pkg->get('last_bill') ? time2str("%D",$cust_pkg->get('last_bill')) : " " ), '' if $cust_pkg->dbdef_table->column('last_bill'); -- cgit v1.2.1 From 5061c5bba69d3658968f1b0c0b9aff7fd5336e26 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 12 Jul 2005 09:31:21 +0000 Subject: More of the same: these patches make it safer to subclass FS::part_pkg's pkg_svc method by eliminating qsearches on table pkg_svc. --- httemplate/view/cust_pkg.cgi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'httemplate/view/cust_pkg.cgi') diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index 5f0e6bffc..a20149ae2 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -104,8 +104,9 @@ unless ($cancel) { #list of services this pkgpart includes my $pkg_svc; - my %pkg_svc = (); - foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) { + my %pkg_svc; + #foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) { + foreach $pkg_svc ( $cust_pkg->part_pkg->pkg_svc ) { $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity; } -- cgit v1.2.1