1 <& elements/commission.html,
3 'name_singular' => 'package class',
4 'header' => [ 'Package class' ],
5 'fields' => [ 'classname' ],
9 'count_query' => $count_query,
10 'sales_detail_link' => $sales_link,
11 'credit_detail_link' => $commission_link,
16 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
18 my $conf = new FS::Conf;
20 $cgi->param('agentnum') =~ /^(\d+)$/ or die 'illegal agentnum';
22 my $agent = FS::agent->by_key($agentnum);
24 my $title = $agent->agent . ' commission';
26 my %query = ( 'table' => 'agent_pkg_class',
27 'addl_from' => ' LEFT JOIN pkg_class USING (classnum)',
28 'hashref' => { 'agentnum' => $agentnum },
30 my $count_query = "SELECT COUNT(*) FROM agent_pkg_class WHERE agentnum = $agentnum";
32 # cust_bill_pkg.cgi expects "classnum=0" for null classnum
33 my $sales_link = [ 'cust_bill_pkg.cgi?nottax=1;'.
34 "agentnum=$agentnum;" .
36 sub { shift->classnum || 0 },
39 my $commission_link = [ 'cust_credit.html?'.
40 "commission_agentnum=$agentnum;" .