X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=845d0984889a2760e45ede4e0532ef4d69efea3e;hb=18459c4369f63b7fda11a3ff7a0af067bed0c9bf;hp=1e0e6d3b19e5d35f8405b706d00b1b0586127b6f;hpb=39dc3ac864bac4509c54900d952ef759b2102fb1;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 1e0e6d3b1..845d09848 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3963,9 +3963,16 @@ cust_main-default_agent_custid is set and it has a value, custnum otherwise. sub display_custnum { my $self = shift; - my $prefix = $conf->config('cust_main-custnum-display_prefix') || ''; + my $prefix = $conf->config('cust_main-custnum-display_prefix', $self->agentnum) || ''; if ( my $special = $conf->config('cust_main-custnum-display_special') ) { - if ( $special eq 'CoStCl' ) { + if ( $special eq 'CoStAg' ) { + $prefix = uc( join('', + $self->country, + ($self->state =~ /^(..)/), + $prefix || ($self->agent->agent =~ /^(..)/) + ) ); + } + elsif ( $special eq 'CoStCl' ) { $prefix = uc( join('', $self->country, ($self->state =~ /^(..)/),