1 <% include('elements/search.html',
2 'title' => 'Inventory summary per agent',
3 'name_singular' => 'agent',
4 'query' => { 'table' => 'agent',
5 'hashref' => { 'disabled' => '' },
6 'extra_sql' => "AND $agentnums_sql",
8 'count_query' => "SELECT COUNT(*) FROM agent".
9 " WHERE disabled = '' OR disabled IS NULL".
10 " AND $agentnums_sql",
18 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
21 my $agentnums_sql = $FS::CurrentUser::CurrentUser->agentnums_sql;
23 my @header = ('Agent');
24 my @fields = ('agent');
27 foreach my $inventory_class ( qsearch('inventory_class', {}) ) {
28 push @header, $inventory_class->classname;
31 my $sub = FS::inventory_class->countcell_factory(
32 'p' => $p, 'agentnum' => $agent->agentnum,
34 &{$sub}($inventory_class);
38 #XXX show global inventory too