X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fartera_turbo.pm;h=e22bbf2af2b7ab134d590290119d96169ab8b940;hb=68cdfc7f046ac2496ed880d93e07f0eae34a5366;hp=c2de4d99bd2db3b01d95c675d792de03512f755e;hpb=06ca1a12c7b613571f7a611e05bb2a318eb4fabc;p=freeside.git
diff --git a/FS/FS/part_export/artera_turbo.pm b/FS/FS/part_export/artera_turbo.pm
index c2de4d99b..e22bbf2af 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 = (
@@ -34,13 +37,14 @@ tie my %options, 'Tie::IxHash',
'Real-time export to Artera Turbo Reseller API',
'options' => \%options,
#'nodomain' => 'Y',
+ 'no_machine' => 1,
'notes' => <<'END'
Real-time export to Artera Turbo
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 +105,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 +114,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"
@@ -132,7 +137,7 @@ sub _export_unsuspend {
$self->queue_statusChange(15, $svc_external);
}
-sub queue_StatusChange {
+sub queue_statusChange {
my( $self, $status, $svc_external ) = @_;
my $queue = new FS::queue {
@@ -165,7 +170,7 @@ sub statusChange {
my $result = $artera->statusChange(
'asn' => sprintf('%010d', $id),
- 'akc' => sprintf('%010d', $title),
+ 'akc' => substr("0000000000$title", -10),
'statusid' => $status,
);