From bc88a0d19d2891ea36830ca2dae796975c369d7b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 9 Jan 2012 17:13:29 +0100 Subject: [PATCH] =?utf8?q?L=C3=B6schen=20von=20periodisch=20erzeugten=20Re?= =?utf8?q?chnungen=20fixen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix für Bug 1734. --- SL/IS.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/SL/IS.pm b/SL/IS.pm index 22c25c7ad..56c266ccd 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1413,14 +1413,16 @@ sub delete_invoice { do_query($form, $dbh, qq|UPDATE ar SET storno = 'f', paid = 0 WHERE id = ?|, $invoice_id); } - # delete AR record - do_query($form, $dbh, qq|DELETE FROM ar WHERE id = ?|, @values); - # delete spool files my @spoolfiles = selectall_array_query($form, $dbh, qq|SELECT spoolfile FROM status WHERE trans_id = ?|, @values); - # delete status entries - do_query($form, $dbh, qq|DELETE FROM status WHERE trans_id = ?|, @values); + my @queries = ( + qq|DELETE FROM status WHERE trans_id = ?|, + qq|DELETE FROM periodic_invoices WHERE ar_id = ?|, + qq|DELETE FROM ar WHERE id = ?|, + ); + + map { do_query($form, $dbh, $_, @values) } @queries; my $rc = $dbh->commit; -- 2.20.1