From: Moritz Bunkus Date: Mon, 9 Jan 2012 16:13:29 +0000 (+0100) Subject: Löschen von periodisch erzeugten Rechnungen fixen X-Git-Tag: release-2.7.0beta1~83 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=bc88a0d19d2891ea36830ca2dae796975c369d7b;p=kivitendo-erp.git Löschen von periodisch erzeugten Rechnungen fixen Fix für Bug 1734. --- 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;