diff options
Diffstat (limited to 'FS/FS/part_export/nena2.pm')
-rw-r--r-- | FS/FS/part_export/nena2.pm | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/FS/FS/part_export/nena2.pm b/FS/FS/part_export/nena2.pm index 85576d20b..e172a15a9 100644 --- a/FS/FS/part_export/nena2.pm +++ b/FS/FS/part_export/nena2.pm @@ -15,7 +15,7 @@ my %upload_targets; tie %options, 'Tie::IxHash', ( 'company_name' => { label => 'Company name for header record', - type => 'text' + type => 'text', }, 'company_id' => { label => 'NENA company ID', type => 'text', @@ -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; |