use Net::SSH::ssh_cmd for all job queueing rather than local duplicated ssh subs
[freeside.git] / FS / FS / cust_bill.pm
index 00135af..943c7b3 100644 (file)
@@ -19,6 +19,7 @@ use FS::cust_pay;
 use FS::cust_pkg;
 use FS::cust_credit_bill;
 use FS::cust_pay_batch;
+use FS::cust_bill_event;
 
 @ISA = qw( FS::Record );
 
@@ -251,6 +252,19 @@ sub cust_bill_pkg {
   qsearch( 'cust_bill_pkg', { 'invnum' => $self->invnum } );
 }
 
+=item cust_bill_event
+
+Returns the completed invoice events (see L<FS::cust_bill_event>) for this
+invoice.
+
+=cut
+
+sub cust_bill_event {
+  my $self = shift;
+  qsearch( 'cust_bill_event', { 'invnum' => $self->invnum } );
+}
+
+
 =item cust_main
 
 Returns the customer (see L<FS::cust_main>) for this invoice.
@@ -389,7 +403,9 @@ sub send {
       'Body' => [ $self->print_text ], #( date)
     );
     $message->smtpsend
-      or return "Can't send invoice email to server $smtpmachine!";
+      or return "(customer # ". $self->custnum. ") can't send invoice email".
+                " for ". join(', ', grep { $_ ne 'POST' } @invoicing_list ).
+                " to server $smtpmachine!";
 
   #} elsif ( grep { $_ eq 'POST' } @invoicing_list ) {
   } elsif ( ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list ) {
@@ -864,7 +880,7 @@ sub print_text {
 
 =head1 VERSION
 
-$Id: cust_bill.pm,v 1.16 2002-02-04 16:44:48 ivan Exp $
+$Id: cust_bill.pm,v 1.19 2002-02-12 18:56:16 ivan Exp $
 
 =head1 BUGS
 
@@ -878,7 +894,7 @@ or something similar so the look can be completely customized?)
 
 =head1 SEE ALSO
 
-L<FS::Record>, L<FS::cust_main>, L<FS::cust_bill_pay>, L<FS:;cust_pay>,
+L<FS::Record>, L<FS::cust_main>, L<FS::cust_bill_pay>, L<FS::cust_pay>,
 L<FS::cust_bill_pkg>, L<FS::cust_bill_credit>, schema.html from the base
 documentation.