From: Jan Büren Date: Tue, 23 Jul 2019 07:04:41 +0000 (+0200) Subject: Kontoauszug rückgängig machen: Nur bei aktuellem Beleg arap.paid neu setzen X-Git-Tag: release-3.5.4~22 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=72b10cee5d0beac5c6169f5d18c074fbdc791395;p=kivitendo-erp.git Kontoauszug rückgängig machen: Nur bei aktuellem Beleg arap.paid neu setzen --- 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' ]);