X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fcancel-unaudited.cgi;h=11cde968d3a0d9a3309854b9f2dcdc939a427026;hp=a73b2ce974dc27f1fbc4b407411be837eeca08ef;hb=aee635ea9986d031a996381f71e67d1446c10331;hpb=22a35047ecdffff80110e06cc08fc84f9ddba9b0 diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi index a73b2ce97..11cde968d 100755 --- a/httemplate/misc/cancel-unaudited.cgi +++ b/httemplate/misc/cancel-unaudited.cgi @@ -7,38 +7,25 @@ my($query) = $cgi->keywords; $query =~ /^(\d+)$/; my $svcnum = $1; -my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -die "Unknown svcnum!" unless $svc_acct; +#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); +#die "Unknown svcnum!" unless $svc_acct; my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); +die "Unknown svcnum!" unless $cust_svc; &eidiot(qq!This account has already been audited. Cancel the package instead.!) if $cust_svc->pkgnum ne '' && $cust_svc->pkgnum ne '0'; -local $SIG{HUP} = 'IGNORE'; -local $SIG{INT} = 'IGNORE'; -local $SIG{QUIT} = 'IGNORE'; -local $SIG{TERM} = 'IGNORE'; -local $SIG{TSTP} = 'IGNORE'; +my $error = $cust_svc->cancel; -local $FS::UID::AutoCommit = 0; - -my $error = $svc_acct->cancel; -&myeidiot($error) if $error; -$error = $svc_acct->delete; -&myeidiot($error) if $error; - -$error = $cust_svc->delete; -&myeidiot($error) if $error; - -$dbh->commit or die $dbh->errstr; - -print $cgi->redirect(popurl(2)); - -sub myeidiot { - $dbh->rollback; - &eidiot(@_); +if ( $error ) { + %> + +<% + &eidiot($error); +} else { + print $cgi->redirect(popurl(2)); } %>