X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_credit_refund.pm;h=cc3b32cdba2d0abd0ce080ccea160f9257236a65;hb=4c18a45810f000bb013d23d4738cfca012794c4b;hp=4c5195717740d0f82afbf421bcd1f65bb13d02d5;hpb=4f8a0bb6d0c789c7e156a446dc61dbe27938a372;p=freeside.git diff --git a/FS/FS/cust_credit_refund.pm b/FS/FS/cust_credit_refund.pm index 4c5195717..cc3b32cdb 100644 --- a/FS/FS/cust_credit_refund.pm +++ b/FS/FS/cust_credit_refund.pm @@ -57,6 +57,8 @@ L and L for conversion functions. Creates a new record. To add the record to the database, see L<"insert">. +=cut + sub table { 'cust_credit_refund'; } =item insert @@ -147,6 +149,8 @@ sub check { ; return $error if $error; + return "amount must be > 0" if $self->amount <= 0; + $self->_date(time) unless $self->_date; return "unknown cust_credit.crednum: ". $self->crednum @@ -166,11 +170,22 @@ sub cust_refund { qsearchs( 'cust_refund', { 'refundnum' => $self->refundnum } ); } +=item cust_credit + +Returns the credit (see L) + +=cut + +sub cust_credit { + my $self = shift; + qsearchs( 'cust_credit', { 'crednum' => $self->crednum } ); +} + =back =head1 VERSION -$Id: cust_credit_refund.pm,v 1.3 2001-09-02 05:38:13 ivan Exp $ +$Id: cust_credit_refund.pm,v 1.9 2002-01-26 01:52:31 ivan Exp $ =head1 BUGS