From: Jan Büren Date: Sat, 23 Mar 2019 13:28:54 +0000 (+0100) Subject: BankTransaction: save_bt keinen bezahlten rechnungen akzeptieren X-Git-Tag: release-3.5.4~86 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=18345d9be2c2273452b05b9562226e48d87abe29;p=kivitendo-erp.git BankTransaction: save_bt keinen bezahlten rechnungen akzeptieren --- diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index a937451c4..9793b33c8 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -616,6 +616,9 @@ sub save_single_bank_transaction { my $memo = ($data{memos} // [])->[$n_invoices]; $n_invoices++ ; + # safety check invoice open + croak("Invoice closed. Cannot proceed.") unless ($invoice->open_amount); + if ( ($payment_sent && $bank_transaction->not_assigned_amount >= 0) || ($payment_received && $bank_transaction->not_assigned_amount <= 0)) { return {