my @search = ();
if ( $cgi->param('agentnum') && $cgi->param('agentnum') =~ /^(\d+)$/ ) {
- push @search, "agentnum = $1";
+ push @search, "cust_main.agentnum = $1";
#my $agent = qsearchs('agent', { 'agentnum' => $1 } );
#die "unknown agentnum $1" unless $agent;
}
}
#here is the agent virtualization
-my $agent_sql = $curuser->agentnums_sql;
-$agent_sql =~ s/agentnum/cust_main.agentnum/g;
-push @search, $agent_sql;
+push @search, $curuser->agentnums_sql( 'table' => 'cust_main' );
my $where = 'WHERE '. join(' AND ', @search );
</SCRIPT>';
-my $menubar = [
- 'Re-print these events' =>
- "javascript:confirm_print_process()",
- 'Re-email these events' =>
- "javascript:confirm_email_process()",
- ];
+my $menubar = [];
-push @$menubar, 'Re-fax these events' =>
- "javascript:confirm_fax_process()"
- if $conf->exists('hylafax');
+if ( $curuser->access_right('Resend invoices') ) {
+
+ push @$menubar, 'Re-print these events' =>
+ "javascript:confirm_print_process()",
+ 'Re-email these events' =>
+ "javascript:confirm_email_process()",
+ ;
+
+ push @$menubar, 'Re-fax these events' =>
+ "javascript:confirm_fax_process()"
+ if $conf->exists('hylafax');
+
+}
my $link_cust = sub {
my $cust_event = shift;