summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Davis <jeremyd@freeside.biz>2014-09-05 11:44:17 -0400
committerJeremy Davis <jeremyd@freeside.biz>2014-09-05 11:44:17 -0400
commite052dea3e4b83b6d077e91436065d8def68ebeca (patch)
tree8f346c26f9c3676f44f2a581a7f90553f736846d
parente3936ba407632934b8c9f91a3b07aaabd3c5e62f (diff)
#14049 Add default area code for 7 digit numbers
-rw-r--r--FS/FS/part_export/nena2.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/FS/FS/part_export/nena2.pm b/FS/FS/part_export/nena2.pm
index 85576d20b..50f4b1695 100644
--- a/FS/FS/part_export/nena2.pm
+++ b/FS/FS/part_export/nena2.pm
@@ -23,6 +23,9 @@ tie %options, 'Tie::IxHash', (
'customer_code' => { label => 'Customer code',
type => 'text',
},
+ 'area_code' => { label => 'Default area code for 7 digit numbers',
+ type => 'text',
+ },
'prefix' => { label => 'File name prefix',
type => 'text',
},
@@ -222,7 +225,13 @@ sub data {
$hash{function_code} = $function_code{$action};
- # phone number
+ # Add default area code if phonenum is 7 digits
+ if ($self->option('area_code') =~ /^\d{3}/ && $svc->phonenum =~ /^\d{7}/ ){
+ $svc->phonenum = $self->option('area_code'). $svc->phonenum
+ }
+
+ # phone number
+
$svc->phonenum =~ /^(\d{3})(\d*)$/;
$hash{npa} = $1;
$hash{calling_number} = $2;