X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fcancel-unaudited.cgi;h=ecfaef29f6b278f6233820717b6b53254675bd20;hp=a73b2ce974dc27f1fbc4b407411be837eeca08ef;hb=62a0a2a05de9f43e625357cc262312b86d178799;hpb=22a35047ecdffff80110e06cc08fc84f9ddba9b0 diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi index a73b2ce97..ecfaef29f 100755 --- a/httemplate/misc/cancel-unaudited.cgi +++ b/httemplate/misc/cancel-unaudited.cgi @@ -25,20 +25,20 @@ local $SIG{TSTP} = 'IGNORE'; local $FS::UID::AutoCommit = 0; my $error = $svc_acct->cancel; -&myeidiot($error) if $error; -$error = $svc_acct->delete; -&myeidiot($error) if $error; +$error ||= $svc_acct->delete; +$error ||= $cust_svc->delete; -$error = $cust_svc->delete; -&myeidiot($error) if $error; - -$dbh->commit or die $dbh->errstr; +if ( $error ) { + $dbh->rollback; + %> + +<% + &eidiot($error); +} else { -print $cgi->redirect(popurl(2)); + $dbh->commit or die $dbh->errstr; -sub myeidiot { - $dbh->rollback; - &eidiot(@_); + print $cgi->redirect(popurl(2)); } %>