+=item dest - if set (to POST, EMAIL or FAX), only sends spools invoices if the customer has the corresponding invoice destinations set (see L<FS::cust_main_invoice>).
+
+=back
=cut
sub spool_csv {
my($self, %opt) = @_;
=cut
sub spool_csv {
my($self, %opt) = @_;
+ if ( $opt{'dest'} ) {
+ my %invoicing_list = map { /^(POST|FAX)$/ or $1 = 'EMAIL'; $1 => 1 }
+ $self->cust_main->invoicing_list;
+ return unless $invoicing_list{$opt{'dest'}};
+ }
+
#create file(s)
my $spooldir = "/usr/local/etc/freeside/export.". datasrc. "/cust_bill";
#create file(s)
my $spooldir = "/usr/local/etc/freeside/export.". datasrc. "/cust_bill";