package FS::cust_bill_pay;
+use base qw( FS::cust_main_Mixin FS::cust_bill_ApplicationCommon );
use strict;
-use vars qw( @ISA $conf );
-use FS::Record qw( qsearchs );
-use FS::cust_main_Mixin;
-use FS::cust_bill_ApplicationCommon;
-use FS::cust_bill;
-use FS::cust_pay;
-use FS::cust_pkg;
-
-@ISA = qw( FS::cust_main_Mixin FS::cust_bill_ApplicationCommon );
+use vars qw( $conf );
+use FS::UID;
#ask FS::UID to run this stuff for us later
FS::UID->install_callback( sub {
sub delete {
my $self = shift;
return "Can't delete application for closed payment"
- if $self->cust_pay->closed =~ /^Y/i;
+ if $self->cust_pay && $self->cust_pay->closed =~ /^Y/i;
return "Can't delete application for closed invoice"
- if $self->cust_bill->closed =~ /^Y/i;
+ if $self->cust_bill && $self->cust_bill->closed =~ /^Y/i;
$self->SUPER::delete(@_);
}
Returns the payment (see L<FS::cust_pay>)
-=cut
-
-sub cust_pay {
- my $self = shift;
- qsearchs( 'cust_pay', { 'paynum' => $self->paynum } );
-}
-
=item send_receipt HASHREF | OPTION => VALUE ...
-
Sends a payment receipt for the associated payment, against this specific
invoice. If there is an error, returns the error, otherwise returns false.