X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pay.pm;h=831d7f26ce40e1873cc3de9fffd0fd952b48145e;hb=3c54c844c665ed108c7892a154fd3972fab1f3e5;hp=74a8bcdd44ae1b4727d9134b1ce5e21a755bc852;hpb=05686487551e26418c9b2d6b92ea0d89bb100082;p=freeside.git diff --git a/FS/FS/cust_bill_pay.pm b/FS/FS/cust_bill_pay.pm index 74a8bcdd4..831d7f26c 100644 --- a/FS/FS/cust_bill_pay.pm +++ b/FS/FS/cust_bill_pay.pm @@ -3,11 +3,13 @@ package FS::cust_bill_pay; 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_bill_ApplicationCommon ); +@ISA = qw( FS::cust_main_Mixin FS::cust_bill_ApplicationCommon ); #ask FS::UID to run this stuff for us later FS::UID->install_callback( sub { @@ -120,6 +122,7 @@ sub check { || $self->ut_foreign_key('invnum', 'cust_bill', 'invnum' ) || $self->ut_numbern('_date') || $self->ut_money('amount') + || $self->ut_foreign_keyn('pkgnum', 'cust_pkg', 'pkgnum') ; return $error if $error; @@ -147,6 +150,25 @@ sub cust_pay { 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. + +See L. + +=cut + +sub send_receipt { + my $self = shift; + my $opt = ref($_[0]) ? shift : { @_ }; + $self->cust_pay->send_receipt( + 'cust_bill' => $self->cust_bill, + %$opt, + ); +} + =back =head1 BUGS