continue sales person work: customer and package selection, commissions, reporting...
[freeside.git] / httemplate / misc / sales.cgi
1 <% encode_json( \@return ) %>\
2 <%init>
3
4 my( $agentnum ) = $cgi->param('arg');
5
6 my %hash = ( 'disabled' => '' );
7 if ( $agentnum > 0 ) {
8   $hash{'agentnum'} = $agentnum;
9 }
10 my @sales = qsearch({
11   'table'     => 'sales',
12   'hashref'   => \%hash,
13   'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
14   'order_by'  => 'ORDER BY salesperson',
15 });
16
17 warn scalar(@sales);
18
19 my @return = map  {
20                     ( $_->salesnum,
21                       $_->salesperson,
22                     )
23                   }
24                   #sort { $a->salesperson cmp $b->salesperson }
25                   @sales;
26
27 </%init>