'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 = (
'Real-time export to Artera Turbo Reseller API',
'options' => \%options,
#'nodomain' => 'Y',
+ 'no_machine' => 1,
'notes' => <<'END'
Real-time export to <a href="http://www.arteraturbo.com/">Artera Turbo</a>
Reseller API. Requires installation of
<a href="http://search.cpan.org/dist/Net-Artera">Net::Artera</a>
from CPAN. You probably also want to:
<UL>
- <LI>In the configuraiton UI section: set the <B>svc_external-skip_manual</B> and <B>svc_external-display_type</B> configuration values.
+ <LI>In the configuration UI section: set the <B>svc_external-skip_manual</B> and <B>svc_external-display_type</B> configuration values.
<LI>In the message catalog: set <B>svc_external-id</B> to <I>Artera Serial Number</I> and set <B>svc_external-title</B> to <I>Artera Key Code</I>.
</UL>
END
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';
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"
$self->queue_statusChange(15, $svc_external);
}
-sub queueStatusChange {
+sub queue_statusChange {
my( $self, $status, $svc_external ) = @_;
my $queue = new FS::queue {
my $result = $artera->statusChange(
'asn' => sprintf('%010d', $id),
- 'akc' => sprintf('%010d', $title),
+ 'akc' => substr("0000000000$title", -10),
'statusid' => $status,
);