X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Frate_region.pm;fp=FS%2FFS%2Frate_region.pm;h=65dfd2a25c4a08642a723c6f1b9b963690d04428;hb=902e98b8b1dd2fd4ba76e5f8b3d1d20796d65a69;hp=7945f5290fd5016d00a3bf26e826f7001d1c3b0a;hpb=584caeef2ac90ab10fc028a7928b9ebc53e8b33a;p=freeside.git diff --git a/FS/FS/rate_region.pm b/FS/FS/rate_region.pm index 7945f5290..65dfd2a25 100644 --- a/FS/FS/rate_region.pm +++ b/FS/FS/rate_region.pm @@ -281,13 +281,20 @@ sub prefixes_short { foreach my $rate_prefix ( $self->rate_prefix ) { if ( $countrycode ne $rate_prefix->countrycode ) { - $out =~ s/,$//; + $out =~ s/, $//; $countrycode = $rate_prefix->countrycode; - $out.= " $countrycode-"; + $out.= " +$countrycode "; } - $out .= $rate_prefix->npa. ','; + my $npa = $rate_prefix->npa; + if ( $countrycode eq '1' ) { + $out .= '('. substr( $npa, 0, 3 ). ')'; + $out .= ' '. substr( $npa, 3 ) if length($npa) > 3; + } else { + $out .= $rate_prefix->npa; + } + $out .= ', '; } - $out =~ s/,$//; + $out =~ s/, $//; $out; }