X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fsoma.pm;h=c73d9f978587155a2bb3be37efb618256376340a;hb=1aecd5bf33146bf3f374341a3814960ae1d419e8;hp=a0b433d84245dd6478eadd75b3c8fa5f12231636;hpb=6d13a0d4dd94fd0294b25e5cd15be91e890db84c;p=freeside.git diff --git a/FS/FS/part_export/soma.pm b/FS/FS/part_export/soma.pm index a0b433d84..c73d9f978 100644 --- a/FS/FS/part_export/soma.pm +++ b/FS/FS/part_export/soma.pm @@ -140,9 +140,9 @@ sub queue_statuschange { my $queue = new FS::queue { 'svcnum' => $svc->svcnum, - 'job' => 'FS::part_export::soma::$method', + 'job' => 'FS::part_export::soma::statuschange', }; - my $error = $queue->insert( $self->option('url'), %args ); + my $error = $queue->insert( %args ); return $error if $error; @@ -311,11 +311,13 @@ sub _queueable_suspend { next unless $application->definitionId == $appid; $instance_id = $application->instanceId; - $app_def = $app_catalog->getApplicationDef($appid, $cpeid); - @attr_def = grep { $_->internalName eq 'status' } @{$app_def->attributes}; + my $app_def = + $soma_objects->{AppCatalog}->getApplicationDef($appid, $cpeid); + my @attr_def = grep { $_->internalName eq 'status' } + @{$app_def->attributes}; foreach my $attribute ( @{$application->attributes} ) { - next unless $attibute->definitionId == $attr_def[0]->definitionId; + next unless $attribute->definitionId == $attr_def[0]->definitionId; $attribute->{value} = 'S'; $soma_objects->{Applications}->setAppAttribute( $cpeid, @@ -351,11 +353,13 @@ sub _queueable_unsuspend { next unless $application->definitionId == $appid; $instance_id = $application->instanceId; - $app_def = $app_catalog->getApplicationDef($appid, $cpeid); - @attr_def = grep { $_->internalName eq 'status' } @{$app_def->attributes}; + my $app_def = + $soma_objects->{AppCatalog}->getApplicationDef($appid, $cpeid); + my @attr_def = grep { $_->internalName eq 'status' } + @{$app_def->attributes}; - foreach my $attribute ( @{$applicate->attributes} ) { - next unless $attibute->definitionId == $attr_def[0]->definitionId; + foreach my $attribute ( @{$application->attributes} ) { + next unless $attribute->definitionId == $attr_def[0]->definitionId; $attribute->{value} = 'E'; $soma_objects->{Applications}->setAppAttribute( $cpeid, @@ -383,8 +387,8 @@ sub esn { if ($svcdb eq 'svc_external') { my $esn = $svc->title; - $esn =~ /^\s*(\d[a-fA-F])+\s*$/ && ($esn = $1); - return sprintf( '%016X', $esn ) if $svcdb eq 'svc_external'; + $esn =~ /^\s*([\da-fA-F]{1,16})\s*$/ && ($esn = $1); + return sprintf( '%016s', $esn ); } my $cust_pkg = $svc->cust_svc->cust_pkg; @@ -399,9 +403,9 @@ sub esn { if scalar( @cust_svc ) > 1; my $esn = $cust_svc[0]->svc_x->title; - $esn =~ /^\s*(\d[a-fA-F])+\s*$/ && ($esn = $1); + $esn =~ /^\s*([\da-fA-F]{1,16})\s*$/ && ($esn = $1); - sprintf( '%016X', $esn ); + sprintf( '%016s', $esn ); }