X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_refund.pm;h=729dc02b023928992a2ba6addad10e84e3687c98;hb=2066bf9d3ebb4e53c49ab8b4b447c4eb88e425a4;hp=65254aef4bf8b0068419b87c1c37c4cfd071c772;hpb=6cd87c0d3b5280446301c647fa5f1ec5a593fa3f;p=freeside.git diff --git a/FS/FS/cust_refund.pm b/FS/FS/cust_refund.pm index 65254aef4..729dc02b0 100644 --- a/FS/FS/cust_refund.pm +++ b/FS/FS/cust_refund.pm @@ -30,8 +30,9 @@ FS::cust_refund - Object method for cust_refund objects =head1 DESCRIPTION -An FS::cust_refund represents a refund. FS::cust_refund inherits from -FS::Record. The following fields are currently supported: +An FS::cust_refund represents a refund: the transfer of money to a customer; +equivalent to a negative payment (see L). FS::cust_refund +inherits from FS::Record. The following fields are currently supported: =over 4 @@ -74,27 +75,12 @@ L). sub insert { my $self = shift; - my $error; - - $error=$self->check; + my $error = $self->check; return $error if $error; my $old_cust_credit = qsearchs( 'cust_credit', { 'crednum' => $self->crednum } ); return "Unknown crednum" unless $old_cust_credit; - my %hash = $old_cust_credit->hash; - $hash{credited} = sprintf("%.2f", $hash{credited} - $self->refund ); - my($new_cust_credit) = new FS::cust_credit ( \%hash ); - - local $SIG{HUP} = 'IGNORE'; - local $SIG{INT} = 'IGNORE'; - local $SIG{QUIT} = 'IGNORE'; - local $SIG{TERM} = 'IGNORE'; - local $SIG{TSTP} = 'IGNORE'; - local $SIG{PIPE} = 'IGNORE'; - - $error = $new_cust_credit->replace($old_cust_credit); - return "Error modifying cust_credit: $error" if $error; $self->SUPER::insert; } @@ -171,7 +157,7 @@ sub check { =head1 VERSION -$Id: cust_refund.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $ +$Id: cust_refund.pm,v 1.3 2001-04-09 23:05:15 ivan Exp $ =head1 BUGS