diff options
author | ivan <ivan> | 2003-10-25 02:05:42 +0000 |
---|---|---|
committer | ivan <ivan> | 2003-10-25 02:05:42 +0000 |
commit | e7793a8501877df59a8363e709e684825c0b85d9 (patch) | |
tree | 9ef85f49eecb79601565e05b4736c0dfc61cddff /FS/FS/svc_Common.pm | |
parent | 8c630f221fb8b507336cad16c60bce8b4da4892f (diff) |
signups with snarf info!
Diffstat (limited to 'FS/FS/svc_Common.pm')
-rw-r--r-- | FS/FS/svc_Common.pm | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm index 87b6097aa..0147997f1 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -28,7 +28,7 @@ inherit from, i.e. FS::svc_acct. FS::svc_Common inherits from FS::Record. =over 4 -=item insert [ JOBNUM_ARRAYREF ] +=item insert [ JOBNUM_ARRAYREF [ OBJECTS_ARRAYREF ] ] Adds this record to the database. If there is an error, returns the error, otherwise returns false. @@ -39,11 +39,16 @@ defined. An FS::cust_svc record will be created and inserted. If an arrayref is passed as parameter, the B<jobnum>s of any export jobs will be added to the array. +If an arrayref of FS::tablename objects (for example, FS::acct_snarf objects) +is passed as the optional second parameter, they will have their svcnum fields +set and will be inserted after this record, but before any exports are run. + =cut sub insert { my $self = shift; local $FS::queue::jobnums = shift if @_; + my $objects = scalar(@_) ? shift : []; my $error; local $SIG{HUP} = 'IGNORE'; @@ -90,6 +95,15 @@ sub insert { return $error; } + foreach my $object ( @$objects ) { + $object->svcnum($self->svcnum); + $error = $object->insert; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return $error; + } + } + #new-style exports! unless ( $noexport_hack ) { foreach my $part_export ( $self->cust_svc->part_svc->part_export ) { @@ -364,7 +378,7 @@ sub cancel { ''; } =head1 VERSION -$Id: svc_Common.pm,v 1.12 2002-06-14 11:22:53 ivan Exp $ +$Id: svc_Common.pm,v 1.12.4.1 2003-10-25 02:05:41 ivan Exp $ =head1 BUGS |