X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_svc.html;h=b245d31142d92d0d9c164e9077658db96c9d0373;hb=b594ce910540fae472cfa1fb132f658d4846c638;hp=e2a83b7dec4ca463d79ab5bd7f157b7b4c099b75;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;p=freeside.git diff --git a/httemplate/search/cust_svc.html b/httemplate/search/cust_svc.html index e2a83b7de..b245d3114 100644 --- a/httemplate/search/cust_svc.html +++ b/httemplate/search/cust_svc.html @@ -96,6 +96,7 @@ if ( length( $cgi->param('search_svc') ) ) { my $extra_sql = ' WHERE '. join(' AND ', @extra_sql ); $sql_query = { + 'select' => 'svcnum', 'table' => 'cust_svc', 'addl_from' => $addl_from, 'hashref' => {}, @@ -105,8 +106,8 @@ if ( length( $cgi->param('search_svc') ) ) { } $sql_query->{'select'} = join(', ', - 'cust_svc.*', - 'part_svc.*', + $sql_query->{'select'}, + #'part_svc.*', 'cust_main.custnum', FS::UI::Web::cust_sql_fields(), ); @@ -117,14 +118,17 @@ my $count_query = "SELECT COUNT(*) FROM cust_svc ". $sql_query->{addl_from}. my $link = sub { my $cust_svc = shift; - my $url = svc_url( - 'm' => $m, - 'action' => 'view', - #'part_svc' => $cust_svc->part_svc, - 'svcdb' => $cust_svc->svcdb, #we have it from the joined search - #'svc' => $cust_svc, #redundant - 'query' => '', - ); + my $url; + if ( $cust_svc->svcpart ) { + $url = svc_url( + 'm' => $m, + 'action' => 'view', + 'svcdb' => $cust_svc->svcdb, #we have it from the joined search + 'query' => '', + ); + } else { # bizarre unlinked service case + $url = $p.'view/svc_Common.html?svcdb='.$cust_svc->svcdb.';svcnum='; + } [ $url, 'svcnum' ]; };