'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;
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;
} 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');
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
);
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;
'';
}
alter table svc_external alter column id drop not null;
alter table h_svc_external alter column id drop not null;
+INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 20, 'svc_external-id', 'en_US', 'External ID' );
+INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 21, 'svc_external-title', 'en_US', 'Title' );
+
dbdef-create username
create-history-tables username cust_pay_refund cust_pay_void
dbdef-create username
'en_US' => 'Night Phone',
},
+ 'svc_external-id' => {
+ 'en_US' => 'External ID',
+ },
+
+ 'svc_external-title' => {
+ 'en_US' => 'Title',
+ },
+
);
}
install NetAddr::IP, Chart::Base, IPC::ShareLite and Locale::SubCountry
+INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 20, 'svc_external-id', 'en_US', 'External ID' );
+INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 21, 'svc_external-title', 'en_US', 'Title' );
+
CREATE TABLE cust_bill_pkg_detail (
detailnum serial,
pkgnum int NOT NULL,
my $svc_external = qsearchs( 'svc_external', { 'svcnum' => $svcnum } )
or die "svc_external: Unknown svcnum $svcnum";
+my $conf = new FS::Conf;
+
#false laziness w/all svc_*.cgi
my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
my $pkgnum = $cust_svc->getfield('pkgnum');
}
#eofalse
+
%>
<%= header('External Service View', menubar(
<TR><TD ALIGN="right">Service number</TD>
<TD BGCOLOR="#ffffff"><%= $svcnum %></TD></TR>
-<TR><TD ALIGN="right">External ID</TD>
- <TD BGCOLOR="#ffffff"><%= $svc_external->id %></TD></TR>
-<TR><TD ALIGN="right">Title</TD>
+<TR><TD ALIGN="right"><%= FS::Msgcat::_gettext('svc_external-id') || 'External ID' %></TD>
+ <TD BGCOLOR="#ffffff"><%= $conf->config('svc_external-display_type') eq 'artera_turbo' ? sprintf('%010d', $svc_external->id) : $svc_external->id %></TD></TR>
+<TR><TD ALIGN="right"><%= FS::Msgcat::_gettext('svc_external-title') || 'Title' %></TD>
<TD BGCOLOR="#ffffff"><%= $svc_external->title %></TD></TR>
<% foreach (sort { $a cmp $b } $svc_external->virtual_fields) { %>