From 72b10cee5d0beac5c6169f5d18c074fbdc791395 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 23 Jul 2019 09:04:41 +0200 Subject: [PATCH] =?utf8?q?Kontoauszug=20r=C3=BCckg=C3=A4ngig=20machen:=20N?= =?utf8?q?ur=20bei=20aktuellem=20Beleg=20arap.paid=20neu=20setzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/BankTransaction.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 86ff35eba..98639ff0f 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -791,9 +791,10 @@ sub action_unlink_bank_transaction { my $query = qq|UPDATE $type SET paid = (SELECT COALESCE(abs(sum(amount)),0) FROM acc_trans WHERE trans_id = ? - AND chart_link ilike '%paid%')|; + AND chart_link ilike '%paid%') + WHERE id = ?|; - die if (do_query($::form, $bank_transaction->db->dbh, $query, $trans_id) == -1); + die if (do_query($::form, $bank_transaction->db->dbh, $query, $trans_id, $trans_id) == -1); } # 4. and delete all (if any) record links my $rl = SL::DB::Manager::RecordLink->delete_all(where => [ from_id => $bt_id, from_table => 'bank_transactions' ]); -- 2.20.1