{
'key' => 'cust_main-custom_link',
'section' => 'UI',
- 'description' => 'URL to use as source for the "Custom" tab in the View Customer page. The customer number will be appended, or you can insert "$custnum" to have it inserted elsewhere. "$agentnum" will be replaced with the agent number, and "$usernum" will be replaced with the employee number.',
+ 'description' => 'URL to use as source for the "Custom" tab in the View Customer page. The customer number will be appended, or you can insert "$custnum" to have it inserted elsewhere. "$agentnum" will be replaced with the agent number, "$agent_custid" with be replaced with the agent customer ID (if any), and "$usernum" will be replaced with the employee number.',
'type' => 'textarea',
},
my $url = $conf->config('cust_main-custom_link');
my $agentnum = $cust_main->agentnum;
+my $agent_custid = $cust_main->agent_custid;
my $curuser = $FS::CurrentUser::CurrentUser;
my $usernum = $curuser->usernum;
# like eval(qq("$url")) but with fewer things that can go wrong
# and if $custnum isn't mentioned, assume it goes at the end
$url =~ s/\$custnum/$custnum/ or $url .= $custnum;
$url =~ s/\$agentnum/$agentnum/;
+$url =~ s/\$agent_custid/$agent_custid/;
$url =~ s/\$usernum/$usernum/;
#warn $url;