cust_refund and cust_pay get custnums
[freeside.git] / FS / FS / cust_bill_pay.pm
index e7040d9..a7e2831 100644 (file)
@@ -3,7 +3,8 @@ package cust_bill_pay;
 use strict;
 use vars qw( @ISA );
 use FS::Record qw( qsearch qsearchs dbh );
-#use FS::cust_bill
+use FS::cust_bill;
+use FS::cust_pay;
 
 @ISA = qw( FS::Record );
 
@@ -167,17 +168,40 @@ sub check {
   ''; #no error
 }
 
+=item cust_pay 
+
+Returns the payment (see L<FS::cust_pay>)
+
+=cut
+
+sub cust_pay {
+  my $self = shift;
+  qsearchs( 'cust_pay', { 'paynum' => $self->paynum } );
+}
+
+=item cust_bill 
+
+Returns the invoice (see L<FS::cust_bill>)
+
+=cut
+
+sub cust_bill {
+  my $self = shift;
+  qsearchs( 'cust_bill', { 'invnum' => $self->invnum } );
+}
+
 =back
 
 =head1 VERSION
 
-$Id: cust_bill_pay.pm,v 1.2 2001-09-01 21:55:06 jeff Exp $
+$Id: cust_bill_pay.pm,v 1.4 2001-09-02 02:46:55 ivan Exp $
 
 =head1 BUGS
 
 Delete and replace methods.
 
-cust_credit_bill isn't checked yet (uncomment around line 111)
+the checks for over-applied payments could be better done like the ones in
+cust_bill_credit
 
 =head1 SEE ALSO