X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Finventory_item.html;h=55fef94329a4c3fa8938af9d48976913d163e291;hb=624b2d44625f69d71175c3348cae635d580c890b;hp=06b084745dba31992dc2546e613eea73a86b4f24;hpb=250b4e946383d7eea2a6ce3691879bcf0bab8326;p=freeside.git diff --git a/httemplate/search/inventory_item.html b/httemplate/search/inventory_item.html index 06b084745..55fef9432 100644 --- a/httemplate/search/inventory_item.html +++ b/httemplate/search/inventory_item.html @@ -9,6 +9,7 @@ 'hashref' => {}, 'select' => join(', ', 'inventory_item.*', + 'part_svc.svcdb', 'cust_main.custnum', FS::UI::Web::cust_sql_fields(), ), @@ -79,7 +80,7 @@ die "access denied" my $classnum = $cgi->param('classnum'); $classnum =~ /^(\d+)$/ or errorpage("illegal classnum $classnum"); $classnum = $1; -my $extra_sql = 'inventory_item.classnum = $classnum '; +my $extra_sql = "WHERE inventory_item.classnum = $classnum "; my $inventory_class = qsearchs( { 'table' => 'inventory_class', @@ -98,12 +99,21 @@ if ( $cgi->param('avail') ) { } my $count_query = - "SELECT COUNT(*) FROM inventory_item WHERE $extra_sql"; + "SELECT COUNT(*) FROM inventory_item $extra_sql"; my $link = sub { my $inventory_item = shift; if ( $inventory_item->svcnum ) { - [ "${p}view/svc_acct.cgi?", 'svcnum' ]; + + #[ "${p}view/svc_acct.cgi?", 'svcnum' ]; + my $url = svc_url( + 'm' => $m, + 'action' => 'view', + #'svcdb' => $inventory_item->cust_svc->part_svc->svcdb, + 'svcdb' => $inventory_item->svcdb, #we have it from the joined search + 'query' => '', + ); + [ $url, 'svcnum' ]; } else { ''; }