use Tie::IxHash;
use FS::Record qw(dbh qsearch qsearchs);
use Locale::SubCountry;
+use Carp qw(carp);
our $me = '[broadworks]';
our %client; # exportnum => client object
END
);
-sub export_insert {
+sub _export_insert {
my($self, $svc_x) = (shift, shift);
my $cust_main = $svc_x->cust_main;
'';
}
-sub export_replace {
+sub _export_replace {
my($self, $svc_new, $svc_old) = @_;
my $cust_main = $svc_new->cust_main;
'';
}
-sub export_delete {
+sub _export_delete {
my ($self, $svc_x) = @_;
my $cust_main = $svc_x->cust_main;
sub export_device_insert {
my ($self, $svc_x, $device) = @_;
+ if ( $FS::svc_Common::noexport_hack ) {
+ carp 'export_device_insert() suppressed by noexport_hack'
+ if $self->option('debug');
+ return;
+ }
+
if ( $device->count('svcnum = ?', $svc_x->svcnum) > 1 ) {
return "This service already has a device.";
}
sub export_device_replace {
my ($self, $svc_x, $new_device, $old_device) = @_;
+
+ if ( $FS::svc_Common::noexport_hack ) {
+ carp 'export_device_replace() suppressed by noexport_hack'
+ if $self->option('debug');
+ return;
+ }
+
my $cust_main = $svc_x->cust_main;
my $groupId = $self->groupId($cust_main);
sub export_device_delete {
my ($self, $svc_x, $device) = @_;
+ if ( $FS::svc_Common::noexport_hack ) {
+ carp 'export_device_delete() suppressed by noexport_hack'
+ if $self->option('debug');
+ return;
+ }
+
if ( $device->isa('FS::phone_device') ) {
my $error = $self->set_endpoint( $self->userId($svc_x), '' );
return $error if $error;