1 <& 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",
17 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
20 my $agentnums_sql = $FS::CurrentUser::CurrentUser->agentnums_sql;
22 my @header = ('Agent');
23 my @fields = ('agent');
26 foreach my $inventory_class ( qsearch('inventory_class', {}) ) {
27 push @header, $inventory_class->classname;
30 my $sub = FS::inventory_class->countcell_factory(
31 'p' => $p, 'agentnum' => $agent->agentnum,
33 &{$sub}($inventory_class);
37 #XXX show global inventory too