use HTML::Entities;
use Locale::Country;
use FS::UID qw( datasrc );
-use FS::Record qw( qsearch qsearchs );
use FS::Misc qw( send_email send_fax );
+use FS::Record qw( qsearch qsearchs );
+use FS::cust_main_Mixin;
use FS::cust_main;
use FS::cust_bill_pkg;
use FS::cust_credit;
use FS::cust_bill_pay;
use FS::part_bill_event;
-@ISA = qw( FS::Record );
+@ISA = qw( FS::cust_main_Mixin FS::Record );
$DEBUG = 0;
sub table { 'cust_bill'; }
+sub cust_linked { $_[0]->cust_main_custnum; }
+sub cust_unlinked_msg {
+ my $self = shift;
+ "WARNING: can't find cust_main.custnum ". $self->custnum.
+ ' (cust_bill.invnum '. $self->invnum. ')';
+}
+
=item insert
Adds this invoice to the database ("Posts" the invoice). If there is an error,
my $path = "$FS::UID::conf_dir/conf.$FS::UID::datasrc";
my $file;
- if ( [ -e "$path/logo_". $args{'_template'}. ".png" ] ) {
+ if ( length($args{'_template'})
+ && -e "$path/logo_". $args{'_template'}. ".png"
+ )
+ {
$file = "$path/logo_". $args{'_template'}. ".png";
} else {
$file = "$path/logo.png";
=item send [ TEMPLATENAME [ , AGENTNUM [ , INVOICE_FROM ] ] ]
-Sends this invoice to the destinations configured for this customer: send
-emails or print. See L<FS::cust_main_invoice>.
+Sends this invoice to the destinations configured for this customer: sends
+email, prints and/or faxes. See L<FS::cust_main_invoice>.
TEMPLATENAME, if specified, is the name of a suffix for alternate invoices.