-package cust_credit_refund;
+package FS::cust_credit_refund;
use strict;
use vars qw( @ISA );
Creates a new record. To add the record to the database, see L<"insert">.
+=cut
+
sub table { 'cust_credit_refund'; }
=item insert
my $error =
$self->ut_numbern('creditrefundnum')
|| $self->ut_number('crednum')
- || $self->ut_numner('refundnum')
+ || $self->ut_number('refundnum')
|| $self->ut_money('amount')
|| $self->ut_numbern('_date')
;
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
qsearchs( 'cust_refund', { 'refundnum' => $self->refundnum } );
}
+=item cust_credit
+
+Returns the credit (see L<FS::cust_credit>)
+
+=cut
+
+sub cust_credit {
+ my $self = shift;
+ qsearchs( 'cust_credit', { 'crednum' => $self->crednum } );
+}
+
=back
=head1 VERSION
-$Id: cust_credit_refund.pm,v 1.2 2001-09-02 01:27:11 ivan Exp $
+$Id: cust_credit_refund.pm,v 1.9 2002-01-26 01:52:31 ivan Exp $
=head1 BUGS