X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FMassInvoiceCreatePrint.pm;h=626a6633dc4c685e2817969864a88a0ef4f54585;hb=d6fed9b55a11dca1cfd9cd6f43940a945533d318;hp=09812601595ec125c97dcc5dd77c6edd2c0e1abe;hpb=34d2f9da09e77fee134bf138c1fff801b28990ec;p=kivitendo-erp.git diff --git a/SL/Controller/MassInvoiceCreatePrint.pm b/SL/Controller/MassInvoiceCreatePrint.pm index 098126015..626a6633d 100644 --- a/SL/Controller/MassInvoiceCreatePrint.pm +++ b/SL/Controller/MassInvoiceCreatePrint.pm @@ -19,6 +19,7 @@ use SL::Helper::File qw(store_pdf append_general_pdf_attachments doc_storage_ena use SL::Helper::Flash; use SL::Locale::String; use SL::SessionFile; +use SL::ARAP; use SL::System::TaskServer; use Rose::Object::MakeMethods::Generic ( @@ -57,6 +58,7 @@ sub action_create_invoices { } my $db = SL::DB::Invoice->new->db; + my $dbh = $db->dbh; my @invoices; my @already_closed_delivery_orders; @@ -73,6 +75,11 @@ sub action_create_invoices { } else { my $invoice = $delivery_order->convert_to_invoice() || die $db->error; + + ARAP->close_orders_if_billed('dbh' => $dbh, + 'arap_id' => $invoice->id, + 'table' => 'ar',); + push @invoices, $invoice; } }