my $eventtable = $cust_event->eventtable;
if ( $eventtable eq 'cust_pkg' ) {
my $custnum = $cust_event->cust_main_custnum;
- [ "${p}view/cust_main.cgi?$custnum#cust_pkg", 'tablenum' ];
+ my $show = $FS::CurrentUser::CurrentUser->default_customer_view =~ /^(jumbo|packages)$/
+ ? ''
+ : ';show=packages';
+ my $pkgnum = $cust_event->tablenum;
+ my $frag = "cust_pkg$pkgnum"; #hack for IE ignoring real #fragment
+ [ "${p}view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#cust_pkg", 'tablenum' ];
} else {
[ "${p}view/$eventtable.cgi?", 'tablenum' ];
}
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;