X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FBackgroundJob%2FCreatePeriodicInvoices.pm;h=45a41d012c7216742b7cb05db39861cdebf34f44;hb=28550377f37c6bb63c86cb1460b233b042b29dfc;hp=055dd16f40bf13cfca550256fbe524988a7f2d32;hpb=bdbe2ca0e36dfa79dc45b0259650c001639834a0;p=kivitendo-erp.git diff --git a/SL/BackgroundJob/CreatePeriodicInvoices.pm b/SL/BackgroundJob/CreatePeriodicInvoices.pm index 055dd16f4..45a41d012 100644 --- a/SL/BackgroundJob/CreatePeriodicInvoices.pm +++ b/SL/BackgroundJob/CreatePeriodicInvoices.pm @@ -61,11 +61,14 @@ sub run { push @invoices_to_print, $data if $config->print; push @invoices_to_email, $data if $config->send_email; - # last; + my $inactive_ordnumber = $config->disable_one_time_config; + if ($inactive_ordnumber) { + # disable one time configs and skip eventual invoices + _log_msg("Order " . $inactive_ordnumber . " deavtivated \n"); + push @disabled_orders, $inactive_ordnumber; + last; + } } - # disable one time configs (periodicity is only one time). - my $inactive_ordnumber = $config->disable_one_time_config; - push @disabled_orders, $inactive_ordnumber if $inactive_ordnumber; } foreach my $inv ( @invoices_to_print ) { $self->_print_invoice($inv); } @@ -397,10 +400,13 @@ sub _email_invoice { ); } + my $global_bcc = SL::DB::Default->get->global_bcc; + for my $recipient (@recipients) { my $mail = Mailer->new; $mail->{from} = $data->{config}->email_sender || $::lx_office_conf{periodic_invoices}->{email_from}; $mail->{to} = $recipient; + $mail->{bcc} = $global_bcc; $mail->{subject} = $data->{config}->email_subject; $mail->{message} = $data->{config}->email_body; $mail->{attachments} = [{