summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2004-10-17 09:19:23 +0000
committerivan <ivan>2004-10-17 09:19:23 +0000
commit326123622b3e60db0d6893f076b3a082f4e2a44a (patch)
treed70aa7c07c357a7abacd2a8293adf41586d3946e /FS
parentdbc6a01ed6a3b4373b01bf985ca735386dd047d4 (diff)
add options to adjust UI for artera turbo as svc_export
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm8
-rw-r--r--FS/FS/cust_svc.pm8
-rw-r--r--FS/FS/part_export/artera_turbo.pm15
3 files changed, 24 insertions, 7 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index c8fd7cd95..eb6c69073 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1298,6 +1298,14 @@ httemplate/docs/config.html
'type' => 'checkbox',
},
+ {
+ 'key' => 'svc_external-display_type',
+ 'section' => 'UI',
+ 'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
+ 'type' => 'select',
+ 'select_enum' => [ 'generic', 'artera_turbo', ],
+ },
+
);
1;
diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm
index 0c17c9706..65f8d58b6 100644
--- a/FS/FS/cust_svc.pm
+++ b/FS/FS/cust_svc.pm
@@ -3,6 +3,7 @@ package FS::cust_svc;
use strict;
use vars qw( @ISA $ignore_quantity );
use Carp qw( cluck );
+use FS::Conf;
use FS::Record qw( qsearch qsearchs dbh );
use FS::cust_pkg;
use FS::part_pkg;
@@ -303,7 +304,12 @@ sub label {
} elsif ( $svcdb eq 'svc_broadband' ) {
$tag = $svc_x->ip_addr;
} elsif ( $svcdb eq 'svc_external' ) {
- $tag = $svc_x->id. ': '. $svc_x->title;
+ my $conf = new FS::Conf;
+ if ( $conf->config('svc_external-display_type') eq 'artera_turbo' ) {
+ $tag = sprintf('%010d', $svc_x->id). '-'. $svc_x->title;
+ } else {
+ $tag = $svc_x->id. ': '. $svc_x->title;
+ }
} else {
cluck "warning: asked for label of unsupported svcdb; using svcnum";
$tag = $svc_x->getfield('svcnum');
diff --git a/FS/FS/part_export/artera_turbo.pm b/FS/FS/part_export/artera_turbo.pm
index 60cafc34f..52ab232e0 100644
--- a/FS/FS/part_export/artera_turbo.pm
+++ b/FS/FS/part_export/artera_turbo.pm
@@ -34,7 +34,11 @@ tie my %options, 'Tie::IxHash',
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.
+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 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
);
@@ -100,11 +104,10 @@ sub _export_insert {
sub _export_replace {
my( $self, $new, $old ) = (shift, shift, shift);
- #except the first time, hehe..
- #return "can't change serial number with Artera"
- # if $old->id != $new->id;
- #return "can't change key code with Artera"
- # if $old->title ne $new->title;
+ return "can't change serial number with Artera"
+ if $old->id != $new->id && $old->id;
+ return "can't change key code with Artera"
+ if $old->title ne $new->title && $old->title;
'';
}