From: Jan Büren Date: Thu, 12 Jul 2018 13:25:51 +0000 (+0200) Subject: save_single_bank_transaction dem caller weniger erlauben X-Git-Tag: release-3.5.4~364 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e271f064e683178749424171b29d04204b92e48d;p=kivitendo-erp.git save_single_bank_transaction dem caller weniger erlauben Als Konsequenz zum beschriebenem Verhalten im POD --- diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 591ee7c9e..6e5c5b4f0 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -555,11 +555,20 @@ sub save_single_bank_transaction { }; } + my $bank_transaction = $data{bank_transaction}; + + # see pod + if (@{ $bank_transaction->linked_invoices } || $bank_transaction->invoice_amount != 0) { + return { + %data, + result => 'error', + message => $::locale->text("Bank transaction with id #1 has already been linked to one or more record and/or some amount is already assigned.", $bank_transaction->id), + }; + } my (@warnings); my $worker = sub { my $bt_id = $data{bank_transaction_id}; - my $bank_transaction = $data{bank_transaction}; my $sign = $bank_transaction->amount < 0 ? -1 : 1; my $amount_of_transaction = $sign * $bank_transaction->amount; my $payment_received = $bank_transaction->amount > 0;