summaryrefslogtreecommitdiff
path: root/FS/FS/cust_credit_refund.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-12-28 16:11:46 -0800
committerIvan Kohler <ivan@freeside.biz>2013-12-28 16:11:46 -0800
commit32072dbf59a054529f5304574c0f56f9567d14d0 (patch)
treeeaca19adc8da8daf4b0eaaed1a16c3a8e5a53cb0 /FS/FS/cust_credit_refund.pm
parent66c235e33563ccd785ff9e0828398f778a75fb9f (diff)
autoload methods returning foreign records, RT#13971
Diffstat (limited to 'FS/FS/cust_credit_refund.pm')
-rw-r--r--FS/FS/cust_credit_refund.pm28
1 files changed, 3 insertions, 25 deletions
diff --git a/FS/FS/cust_credit_refund.pm b/FS/FS/cust_credit_refund.pm
index 9fc03f2..a0aeca7 100644
--- a/FS/FS/cust_credit_refund.pm
+++ b/FS/FS/cust_credit_refund.pm
@@ -1,13 +1,7 @@
package FS::cust_credit_refund;
+use base qw( FS::cust_main_Mixin FS::Record );
use strict;
-use vars qw( @ISA );
-use FS::Record qw( qsearch qsearchs dbh );
-use FS::cust_main_Mixin;
-use FS::cust_credit;
-use FS::cust_refund;
-
-@ISA = qw( FS::cust_main_Mixin FS::Record );
=head1 NAME
@@ -126,12 +120,10 @@ sub check {
return "amount must be > 0" if $self->amount <= 0;
return "unknown cust_credit.crednum: ". $self->crednum
- unless my $cust_credit =
- qsearchs( 'cust_credit', { 'crednum' => $self->crednum } );
+ unless my $cust_credit = $self->cust_credit;
return "Unknown refund"
- unless my $cust_refund =
- qsearchs( 'cust_refund', { 'refundnum' => $self->refundnum } );
+ unless my $cust_refund = $self->cust_refund;
$self->_date(time) unless $self->_date;
@@ -148,24 +140,10 @@ sub check {
Returns the refund (see L<FS::cust_refund>)
-=cut
-
-sub cust_refund {
- my $self = shift;
- 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 BUGS