-if ( $agentnum =~ /^\d+$/ ) {
- $origin = FS::Conf->new->config('company_address', $agentnum);
- $origin = uri_escape($origin);
-}
+my @origin = $opt{company_address}
+ ? @{ $opt{company_address} }
+ : ( $conf->config('company_physical_address', $agentnum)
+ ? $conf->config('company_physical_address', $agentnum)
+ : $conf->config('company_address', $agentnum) );
+my $origin = uri_escape(join(',', @origin));
+