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_main.cgi | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 6fe759bd9..9b7b5d029 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -342,17 +342,6 @@ print qq!
Packages !, #display packages -#formatting -print qq!!, &table(), "\n", - qq!Package!, - qq!DatesServices\n!, - qq!Setup!, - qq!Next bill!, - qq!Susp.Expire!, - qq!!, - qq!Cancel!, - qq!\n!; - #get package info my @packages; if ( $conf->exists('hidecancelledpackages') ) { @@ -361,6 +350,23 @@ if ( $conf->exists('hidecancelledpackages') ) { @packages = sort { $a->pkgnum <=> $b->pkgnum } ($cust_main->all_pkgs); } +if ( @packages ) { + #formatting + print &table(), "\n", + qq!Package!, + qq!DatesServices\n!, + qq!Setup!; + + print qq!Last bill! + if $packages[0]->dbdef_table->column('last_bill'); + + print qq!Next bill!, + qq!Susp.!, + qq!Expire!!, + qq!Cancel!, + qq!\n!; +} + my $n1 = ''; foreach my $package (@packages) { my $pkgnum = $package->pkgnum; @@ -424,7 +430,11 @@ foreach my $package (@packages) { } print ''; - for ( qw( setup bill susp expire cancel ) ) { + my @fields = qw( setup ); + push @fields, qw( last_bill ) if $package->dbdef_table->column('last_bill'); + push @fields, qw( bill susp expire cancel); + + for ( @fields ) { print "", ( $package->getfield($_) ? time2str("%D
%l:%M:%S%P %z", $package->getfield($_) ) @@ -471,6 +481,7 @@ print ""; #formatting print ""; + print < function cust_pay_areyousure(href) { -- cgit v1.2.1