From bfb3a80bc91a835513e437b242de366f190e9021 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 1 May 2004 21:05:48 +0000 Subject: [PATCH] handle missing customer records without erroring out --- httemplate/search/cust_bill.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html index 27b147108..3a5db3549 100755 --- a/httemplate/search/cust_bill.html +++ b/httemplate/search/cust_bill.html @@ -71,10 +71,14 @@ sub { sprintf('$%.2f', shift->charged ) }, sub { time2str('%b %d %Y', shift->_date ) }, sub { my $cust_main = shift->cust_main; - $cust_main->get('last'). ', '. $cust_main->first; + $cust_main + ? $cust_main->get('last'). ', '. $cust_main->first + : 'WARNING: can't find cust_main.custnum '. + shift->custnum. ' (cust_bill.invnum '. + shift->invnum. ')'; }, sub { my $cust_main = shift->cust_main; - $cust_main->company; + $cust_main ? $cust_main->company : ''; }, ], 'links' => [ -- 2.11.0