X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/34d2f9da09e77fee134bf138c1fff801b28990ec..53593baa211863fbf66540cf1bcc36c8fb37257f:/SL/Controller/MassInvoiceCreatePrint.pm 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; } }