+ $out.= " +$countrycode ";
+ }
+ my $npa = $rate_prefix->npa;
+ if ( $countrycode eq '1' ) {
+ #$out .= '('. substr( $npa, 0, 3 ). ')';
+ $out .= substr( $npa, 0, 3 );
+ $out .= ' '. substr( $npa, 3 ) if length($npa) > 3;
+ } else {
+ $out .= $rate_prefix->npa;
+ }
+ $out .= '-'. $rate_prefix->nxx if $rate_prefix->nxx;
+ $out .= ', ';
+ }
+ $out =~ s/, $//;
+
+ $out;
+}
+
+sub prefixes_short_sql {
+ my $self = shift;
+
+ my $countrycode = '';
+ my $out = '';
+
+ foreach my $prefix (sort split(',', $self->prefixes)) {
+ my($cc, $npa) = split(' ', $prefix);
+
+ if ( $countrycode ne $cc ) {
+ $out =~ s/, $//;
+ $countrycode = $cc;
+ $out.= " +$countrycode ";
+ }
+ if ( $countrycode eq '1' ) {
+ #$out .= '('. substr( $npa, 0, 3 ). ')';
+ $out .= substr( $npa, 0, 3 );
+ $out .= ' '. substr( $npa, 3 ) if length($npa) > 3;
+ } else {
+ $out .= $npa;