diff options
Diffstat (limited to 'httemplate/edit/cust_main/billing.html')
-rw-r--r-- | httemplate/edit/cust_main/billing.html | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 4c4be23c0..3f3d80176 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -477,10 +477,13 @@ my @payby = grep /\w/, $conf->config('payby'); @payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) unless @payby; -#false laziness w/view/cust_main/billing.html -my $term_sql = "SELECT COUNT(*) FROM cust_pkg LEFT JOIN part_pkg USING ( pkgpart ) WHERE custnum = ? AND plan = 'cdr_termination' LIMIT 1"; -my $term_sth = dbh->prepare($term_sql) or die dbh->errstr; -$term_sth->execute($cust_main->custnum) or die $term_sth->errstr; -my $show_term = $term_sth->fetchrow_arrayref->[0]; +my $show_term = ''; +if ( $cust_main->custnum ) { + #false laziness w/view/cust_main/billing.html + my $term_sql = "SELECT COUNT(*) FROM cust_pkg LEFT JOIN part_pkg USING ( pkgpart ) WHERE custnum = ? AND plan = 'cdr_termination' LIMIT 1"; + my $term_sth = dbh->prepare($term_sql) or die dbh->errstr; + $term_sth->execute($cust_main->custnum) or die $term_sth->errstr; + $show_term = $term_sth->fetchrow_arrayref->[0]; +} </%init> |