X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FMassInvoiceCreatePrint.pm;h=b7212c780b88f55deb02fb85b654441e35ac6893;hb=ee56f1b20ab915671ded297f593c0e2e245bad70;hp=c65d3b5ec2ebdebf2df7bd84204654697ecbb165;hpb=f08036d731f13eb80ac63b951b1c9da77693867a;p=kivitendo-erp.git diff --git a/SL/Controller/MassInvoiceCreatePrint.pm b/SL/Controller/MassInvoiceCreatePrint.pm index c65d3b5ec..b7212c780 100644 --- a/SL/Controller/MassInvoiceCreatePrint.pm +++ b/SL/Controller/MassInvoiceCreatePrint.pm @@ -56,9 +56,9 @@ sub action_create_invoices { } my $db = SL::DB::Invoice->new->db; + my @invoices; - if (!$db->do_transaction(sub { - my @invoices; + if (!$db->with_transaction(sub { foreach my $id (@sales_delivery_order_ids) { my $delivery_order = SL::DB::DeliveryOrder->new(id => $id)->load; @@ -66,17 +66,17 @@ sub action_create_invoices { push @invoices, $invoice; } - my $key = sprintf('%d-%d', Time::HiRes::gettimeofday()); - $::auth->set_session_value("MassInvoiceCreatePrint::ids-${key}" => [ map { $_->id } @invoices ]); - - flash_later('info', t8('The invoices have been created. They\'re pre-selected below.')); - $self->redirect_to(action => 'list_invoices', ids => $key); - 1; })) { $::lxdebug->message(LXDebug::WARN(), "Error: " . $db->error); $::form->error($db->error); } + + my $key = sprintf('%d-%d', Time::HiRes::gettimeofday()); + $::auth->set_session_value("MassInvoiceCreatePrint::ids-${key}" => [ map { $_->id } @invoices ]); + + flash_later('info', t8('The invoices have been created. They\'re pre-selected below.')); + $self->redirect_to(action => 'list_invoices', ids => $key); } sub action_list_invoices {