projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NENA2 export: supply a default value for class of service, #14049
[freeside.git]
/
FS
/
FS
/
part_export
/
nena2.pm
diff --git
a/FS/FS/part_export/nena2.pm
b/FS/FS/part_export/nena2.pm
index
fa3597b
..
8d59425
100644
(file)
--- a/
FS/FS/part_export/nena2.pm
+++ b/
FS/FS/part_export/nena2.pm
@@
-169,15
+169,6
@@
my %function_code = (
);
sub immediate {
);
sub immediate {
- local $@;
- eval "use Geo::StreetAddress::US";
- if ($@) {
- if ($@ =~ /^Can't locate/) {
- return "Geo::StreetAddress::US must be installed to use the NENA2 export.";
- } else {
- die $@;
- }
- }
# validate some things
my ($self, $action, $svc) = @_;
# validate some things
my ($self, $action, $svc) = @_;
@@
-209,6
+200,15
@@
sub create_item {
}
sub data {
}
sub data {
+ local $@;
+ eval "use Geo::StreetAddress::US";
+ if ($@) {
+ if ($@ =~ /^Can't locate/) {
+ return "Geo::StreetAddress::US must be installed to use the NENA2 export.";
+ } else {
+ die $@;
+ }
+ }
# generate the entire record here. reconciliation of multiple updates to
# the same service can be done at process time.
my $self = shift;
# generate the entire record here. reconciliation of multiple updates to
# the same service can be done at process time.
my $self = shift;
@@
-259,11
+259,19
@@
sub data {
} else {
$hash{location} = $cust_location->address2;
}
} else {
$hash{location} = $cust_location->address2;
}
- $hash{location} = $location_hash->{address2};
# customer name and class
$hash{customer_name} = $svc->phone_name_or_cust;
$hash{class_of_service} = $svc->e911_class;
# customer name and class
$hash{customer_name} = $svc->phone_name_or_cust;
$hash{class_of_service} = $svc->e911_class;
+ if (!$hash{class_of_service}) {
+ # then guess
+ my $cust_main = $svc->cust_main;
+ if ($cust_main->company) {
+ $hash{class_of_service} = '2';
+ } else {
+ $hash{class_of_service} = '1';
+ }
+ }
$hash{type_of_service} = $svc->e911_type || '0';
$hash{exchange} = '';
$hash{type_of_service} = $svc->e911_type || '0';
$hash{exchange} = '';