X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pkg.pm;h=70dbcde2a9c0689263670e81e5cfd236ad0b9f7e;hp=6f93d2d905b47674c0abbb2d29e9a8ff3b4c0176;hb=91b74d22933e757040ee90c2fd9b2c0abe96fc62;hpb=b75d775f925f7c1703914dddfc36b6a666d620f3 diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 6f93d2d90..70dbcde2a 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -451,6 +451,20 @@ sub delete { } } + #fix the invoice amount + + my $cust_bill = $self->cust_bill; + $cust_bill->charged( $cust_bill->charged - $self->setup - $self->recur ); + + #not adding a cc surcharge, but this override lets us modify charged + $cust_bill->{'Hash'}{'cc_surcharge_replace_hack'} = 1; + + my $error = $cust_bill->replace; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return $error; + } + my $error = $self->SUPER::delete(@_); if ( $error ) { $dbh->rollback if $oldAutoCommit;