X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FARAP.pm;h=1d044eaade50ffc191e660df824a39cab7bf185a;hb=7ddb43c71b4aed9f23614141349592cb5785a400;hp=4d5c564aa5ac6e390424989d48a511055881fcfc;hpb=5ad7e1ed10430c3e9fbe4e9c9cfcbd409e547251;p=kivitendo-erp.git diff --git a/SL/ARAP.pm b/SL/ARAP.pm index 4d5c564aa..1d044eaad 100644 --- a/SL/ARAP.pm +++ b/SL/ARAP.pm @@ -76,6 +76,10 @@ sub close_orders_if_billed { # said order. Again consider both direct conversions and indirect # conversions via delivery orders. foreach my $oe_id (@oe_ids) { + + # Dont close orders with periodic invoice + next if SL::DB::Manager::PeriodicInvoicesConfig->find_by(oe_id => $oe_id); + # Direct conversions "order -> invoice": @links = RecordLinks->get_links('dbh' => $dbh, 'from_table' => 'oe', @@ -154,7 +158,8 @@ sub close_orders_if_billed { SL::DB->client->with_transaction(sub { my $query = qq|UPDATE oe SET closed = TRUE WHERE id IN (| . join(', ', ('?') x scalar @close_oe_ids) . qq|)|; do_query($form, $dbh, $query, @close_oe_ids); - }); + 1; + }) or do { die SL::DB->client->error }; } $main::lxdebug->leave_sub();