X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pay.pm;h=23f881408d38b8031484278ca8fc4e2ed9622df0;hp=3f787d3b72500e976e07538a2fd2ae1472d302f2;hb=3adb46fccf9f631e188ea5383bd147b340477639;hpb=664a6d35a1e811eb2c10503b288be178cc14801c diff --git a/FS/FS/cust_bill_pay.pm b/FS/FS/cust_bill_pay.pm index 3f787d3b7..23f881408 100644 --- a/FS/FS/cust_bill_pay.pm +++ b/FS/FS/cust_bill_pay.pm @@ -1,15 +1,9 @@ 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 { @@ -89,9 +83,9 @@ Deletes this payment application, unless the closed flag for the parent payment 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(@_); } @@ -143,13 +137,6 @@ sub check { Returns the payment (see L) -=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