X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Finventory_item.html;h=086c8e92d40c525a5ce7a4149621e50eaea037ba;hb=b6dbe0f12dbbe4ea5209367f905f937789b5b607;hp=bd74f561902f3a48d5b79ad5921280df71d90611;hpb=6d2cd8e6fc566b4fccd0075156e3e1ddd59fa042;p=freeside.git diff --git a/httemplate/search/inventory_item.html b/httemplate/search/inventory_item.html index bd74f5619..086c8e92d 100644 --- a/httemplate/search/inventory_item.html +++ b/httemplate/search/inventory_item.html @@ -1,8 +1,107 @@ -<% +<% include( 'elements/search.html', + 'title' => $title, + + 'menubar' => [ 'View inventory classes' => + $p.'browse/inventory_class.html', + 'Upload '. PL($inventory_class->classname)=> + $p.'misc/inventory_item-import.html?'. + "classnum=$classnum" + ], + + 'name' => PL($inventory_class->classname), + + 'query' => { + 'table' => 'inventory_item', + 'hashref' => {}, + 'select' => join(', ', + 'inventory_item.*', + 'part_svc.svcdb', + 'cust_main.custnum', + FS::UI::Web::cust_sql_fields(), + ), + 'extra_sql' => $extra_sql, + 'addl_from' => $addl_from, + }, + + 'count_query' => $count_query, + + 'agent_virt' => 1, + 'agent_null' => 1, + 'agent_pos' => 2, + + 'header' => [ + '#', + $inventory_class->classname, + 'Service', + FS::UI::Web::cust_header(), + '', # checkbox column + ], + + 'fields' => [ + 'itemnum', + 'item', + #'svcnum', #XXX proper full service customer link ala svc_acct + # "unallocated" ? "available" ? + sub { + #this could be way more efficient with a mixin + # like cust_main_Mixin that let us all all the methods + # on data we already have... + my $inventory_item = shift; + my $cust_svc = $inventory_item->cust_svc; + if ( $cust_svc ) { + my($label, $value) = $cust_svc->label; + "$label: $value"; + } else { + '(available)'; + } + }, + + \&FS::UI::Web::cust_fields, + $sub_checkbox, + + ], + 'align' => 'rll'.FS::UI::Web::cust_aligns(), + 'links' => [ + '', + '', + $link, + ( map { $_ ne 'Cust. Status' ? $link_cust : '' } + FS::UI::Web::cust_header() + ), + ], + 'color' => [ + '', + '', + '', + FS::UI::Web::cust_colors(), + ], + 'style' => [ + '', + '', + '', + FS::UI::Web::cust_styles(), + ], + 'html_form' => + qq! +