X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pkg.pm;h=d60e95b782bf1a9e9f2316a4c473aba1e3df5719;hb=92fa788fb842baab8fa185e159d8effde739bd74;hp=d9a6385e23e86038212e01115415ec3bee95d101;hpb=2d82b5b713c7c11d2d54a018d121b80fd6485c60;p=freeside.git diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index d9a6385e2..d60e95b78 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -1,7 +1,7 @@ package FS::cust_pkg; use strict; -use vars qw(@ISA $disable_agentcheck); +use vars qw(@ISA $disable_agentcheck $DEBUG); use FS::UID qw( getotaker dbh ); use FS::Record qw( qsearch qsearchs ); use FS::Misc qw( send_email ); @@ -25,6 +25,8 @@ use FS::Conf; @ISA = qw( FS::Record ); +$DEBUG = 0; + $disable_agentcheck = 0; sub _cache { @@ -148,7 +150,7 @@ sub insert { return $error if $error; my $cust_main = $self->cust_main; - return "Unknown customer ". $self->custnum unless $cust_main; + return "Unknown custnum: ". $self->custnum unless $cust_main; unless ( $disable_agentcheck ) { my $agent = qsearchs( 'agent', { 'agentnum' => $cust_main->agentnum } ); @@ -614,7 +616,7 @@ sub attribute_since_sqlradacct { Transfers as many services as possible from this package to another package. The destination package must already exist. Services are moved only if -the destination allows services with the correct I (not svcdb). +the destination allows services with the correct I (not svcdb). Any services that can't be moved remain in the original package. Returns an error, if there is one; otherwise, returns the number of services @@ -667,6 +669,9 @@ sub transfer { =item reexport +This method is deprecated. See the I option to the insert and +order_pkgs methods in FS::cust_main for a better way to defer provisioning. + =cut sub reexport { @@ -726,13 +731,16 @@ newly-created cust_pkg objects. =cut sub order { - - # Rewritten to make use of the transfer() method, and in general - # to not suck so badly. - my ($custnum, $pkgparts, $remove_pkgnum, $return_cust_pkg) = @_; # Transactionize this whole mess + local $SIG{HUP} = 'IGNORE'; + local $SIG{INT} = 'IGNORE'; + local $SIG{QUIT} = 'IGNORE'; + local $SIG{TERM} = 'IGNORE'; + local $SIG{TSTP} = 'IGNORE'; + local $SIG{PIPE} = 'IGNORE'; + my $oldAutoCommit = $FS::UID::AutoCommit; local $FS::UID::AutoCommit = 0; my $dbh = dbh;