projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bad reuse of variable
[freeside.git]
/
FS
/
FS
/
cust_credit_refund.pm
diff --git
a/FS/FS/cust_credit_refund.pm
b/FS/FS/cust_credit_refund.pm
index
4c51957
..
cc3b32c
100644
(file)
--- a/
FS/FS/cust_credit_refund.pm
+++ b/
FS/FS/cust_credit_refund.pm
@@
-57,6
+57,8
@@
L<Time::Local> and L<Date::Parse> for conversion functions.
Creates a new record. To add the record to the database, see L<"insert">.
Creates a new record. To add the record to the database, see L<"insert">.
+=cut
+
sub table { 'cust_credit_refund'; }
=item insert
sub table { 'cust_credit_refund'; }
=item insert
@@
-147,6
+149,8
@@
sub check {
;
return $error if $error;
;
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
$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 } );
}
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
=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
=head1 BUGS