X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_bill.html;h=337e9e859343b2d88d7a4cf1dcfb246fe1663919;hp=3a5db35490546a92905b152893d465d2ba1a3e8f;hb=28f7684d096f8f5c97a68d04193bc9ba1d503ef5;hpb=bfb3a80bc91a835513e437b242de366f190e9021 diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html index 3a5db3549..337e9e859 100755 --- a/httemplate/search/cust_bill.html +++ b/httemplate/search/cust_bill.html @@ -50,7 +50,13 @@ } my $link = [ "${p}view/cust_bill.cgi?", 'invnum', ]; - my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ]; + my $clink = sub { + my $cust_bill = shift; + my $cust_main = $cust_bill->cust_main; + $cust_main + ? [ "${p}view/cust_main.cgi?", 'custnum' ] + : ''; + }; %> <%= include( 'elements/search.html', @@ -70,12 +76,13 @@ sub { sprintf('$%.2f', shift->get('owed') ) }, sub { sprintf('$%.2f', shift->charged ) }, sub { time2str('%b %d %Y', shift->_date ) }, - sub { my $cust_main = shift->cust_main; + sub { my $cust_bill = shift; + my $cust_main = $cust_bill->cust_main; $cust_main ? $cust_main->get('last'). ', '. $cust_main->first - : 'WARNING: can't find cust_main.custnum '. - shift->custnum. ' (cust_bill.invnum '. - shift->invnum. ')'; + : "WARNING: can't find cust_main.custnum ". + $cust_bill->custnum. ' (cust_bill.invnum '. + $cust_bill->invnum. ')'; }, sub { my $cust_main = shift->cust_main; $cust_main ? $cust_main->company : '';