X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_credit.pm;h=032953532fa7e507b38ee66b826f1532d47ef053;hb=c01c0065f9de3428af812638f6e3bb9e02fb725f;hp=544a0e83d2dcf7ff3c484705d1e48adbcf35bc76;hpb=9aee669886202be7035e6c6049fc71bc99dd3013;p=freeside.git diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index 544a0e83d..032953532 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -9,7 +9,6 @@ use vars qw( $conf $unsuspendauto $me $DEBUG use List::Util qw( min ); use Date::Format; use FS::UID qw( dbh ); -use FS::Misc qw(send_email); use FS::Record qw( qsearch qsearchs dbdef ); use FS::CurrentUser; use FS::cust_pkg; @@ -41,7 +40,6 @@ $FS::UID::callback{'FS::cust_credit'} = sub { our %reasontype_map = ( 'referral_credit_type' => 'Referral Credit', 'cancel_credit_type' => 'Cancellation Credit', - 'signup_credit_type' => 'Self-Service Credit', ); =head1 NAME @@ -277,35 +275,6 @@ sub delete { return $error; } - if ( !$opt{void} and $conf->config('deletecredits') ne '' ) { - - my $cust_main = $self->cust_main; - - my $error = send_email( - 'from' => $conf->invoice_from_full($self->cust_main->agentnum), - #invoice_from??? well as good as any - 'to' => $conf->config('deletecredits'), - 'subject' => 'FREESIDE NOTIFICATION: Credit deleted', - 'body' => [ - "This is an automatic message from your Freeside installation\n", - "informing you that the following credit has been deleted:\n", - "\n", - 'crednum: '. $self->crednum. "\n", - 'custnum: '. $self->custnum. - " (". $cust_main->last. ", ". $cust_main->first. ")\n", - 'amount: $'. sprintf("%.2f", $self->amount). "\n", - 'date: '. time2str("%a %b %e %T %Y", $self->_date). "\n", - 'reason: '. $self->reason. "\n", - ], - ); - - if ( $error ) { - $dbh->rollback if $oldAutoCommit; - return "can't send credit deletion notification: $error"; - } - - } - $dbh->commit or die $dbh->errstr if $oldAutoCommit; ''; @@ -408,14 +377,14 @@ sub void { my $cust_credit_void = new FS::cust_credit_void ( { map { $_ => $self->get($_) } $self->fields } ); - $cust_credit_void->set('void_reasonnum', $reason->reasonnum); + $cust_credit_void->set('void_reasonnum', $reason->reasonnum) if $reason; my $error = $cust_credit_void->insert; if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; } - $error = $self->delete(void => 1); # suppress deletecredits warning + $error = $self->delete(); if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error;