2 % my $url = 'sales_pkg_class.html?' . $cgi->query_string;
3 <% $cgi->redirect($url) %>
5 <& elements/commission.html,
7 'name_singular' => 'sales person',
8 'header' => [ 'Sales person' ],
9 'fields' => [ 'salesperson' ],
13 'count_query' => $count_query,
15 'sales_detail_link' => $sales_link,
16 'credit_detail_link' => $commission_link,
22 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
24 my $conf = new FS::Conf;
26 my %query = ( 'table' => 'sales' );
27 my $count_query = "SELECT COUNT(*) FROM sales";
29 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
30 $query{hashref}->{agentnum} = $1;
31 $count_query .= " WHERE agentnum = $1";
35 if ( $cgi->param('salesnum') =~ /^(\d+)$/ ) {
38 $cgi->delete('salesnum');
41 my $title = 'Sales person commission';
43 my $cust_main_sales = $cgi->param('cust_main_sales') eq 'Y' ? 'Y' : '';
44 $query{'cust_main_sales'} = $cust_main_sales;
46 my $sales_link = [ 'sales_pkg_class.html?'.
47 "cust_main_sales=$cust_main_sales;salesnum=",
51 my $commission_link = [ 'cust_credit.html?'.
52 "cust_main_sales=$cust_main_sales;commission_salesnum=",