X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fartera_turbo.pm;h=c006db9cdb78cc804fadbf2d98b0741803e9b18b;hb=9a778387bc4bfc97d28b25a9c123700fc6c15062;hp=6b70329de71927efeac76b6f9931fb5d41f253f4;hpb=c79c1bc757fb9524c4339613d265d403abbefa0e;p=freeside.git
diff --git a/FS/FS/part_export/artera_turbo.pm b/FS/FS/part_export/artera_turbo.pm
index 6b70329de..c006db9cd 100644
--- a/FS/FS/part_export/artera_turbo.pm
+++ b/FS/FS/part_export/artera_turbo.pm
@@ -25,6 +25,9 @@ tie my %options, 'Tie::IxHash',
'debug' => { 'label' => 'Enable debug logging',
'type' => 'checkbox',
},
+ 'enable_edit' => { 'label' => 'Enable local editing of Artera serial numbers and key codes (note that the changes will NOT be exported to Artera)',
+ 'type' => 'checkbox',
+ },
;
%info = (
@@ -40,7 +43,7 @@ Reseller API. Requires installation of
Net::Artera
from CPAN. You probably also want to:
- - In the configuraiton UI section: set the svc_external-skip_manual and svc_external-display_type configuration values.
+
- In the configuration UI section: set the svc_external-skip_manual and svc_external-display_type configuration values.
- In the message catalog: set svc_external-id to Artera Serial Number and set svc_external-title to Artera Key Code.
END
@@ -101,7 +104,7 @@ sub _export_insert {
if ( $result->{'id'} == 1 ) {
my $new = new FS::svc_external { $svc_external->hash };
$new->id(sprintf('%010d', $result->{'ASN'}));
- $new->title(sprintf('%010d', $result->{'AKC'}));
+ $new->title( substr('0000000000'.uc($result->{'AKC'}), -10) );
$new->replace($svc_external);
} else {
$result->{'message'} || 'No response from Artera';
@@ -110,6 +113,7 @@ sub _export_insert {
sub _export_replace {
my( $self, $new, $old ) = (shift, shift, shift);
+ return '' if $self->option('enable_edit');
return "can't change serial number with Artera"
if $old->id != $new->id && $old->id;
return "can't change key code with Artera"
@@ -165,7 +169,7 @@ sub statusChange {
my $result = $artera->statusChange(
'asn' => sprintf('%010d', $id),
- 'akc' => sprintf('%010d', $title),
+ 'akc' => substr("0000000000$title", -10),
'statusid' => $status,
);