Secure flag, 'Y' indicates that when using encryption, the job needs to be
run on a machine with the private key.
+=item usernum
+
+For access_user that created the job
+
=cut
=back
$self->custnum( $args{'custnum'} ) if $args{'custnum'};
+ $self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum;
+
my $error = $self->SUPER::insert;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
}
}
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ foreach my $cust_pay_pending (qsearch('cust_pay_pending',{ jobnum => $self->jobnum })) {
+ $cust_pay_pending->set('jobnum','');
+ my $error = $cust_pay_pending->replace();
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
my $error = $self->SUPER::delete;
- return $error if $error;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
unlink $reportname if $reportname;
'';
|| $self->ut_enum('status',['', qw( new locked failed done )])
|| $self->ut_anything('statustext')
|| $self->ut_numbern('svcnum')
+ || $self->ut_foreign_keyn('usernum', 'access_user', 'usernum')
;
return $error if $error;
#'';
}
+# not needed in 4
+#=item access_user
+#
+#Returns FS::access_user object (if any) associated with this user.
+#
+#Returns nothing if not found.
+#
+#=cut
+#
+#sub access_user {
+# my $self = shift;
+# my $usernum = $self->usernum || return ();
+# return qsearchs('access_user',{ 'usernum' => $usernum }) || ();
+#}
+
=back
=head1 SUBROUTINES