From 18345d9be2c2273452b05b9562226e48d87abe29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Sat, 23 Mar 2019 14:28:54 +0100 Subject: [PATCH] BankTransaction: save_bt keinen bezahlten rechnungen akzeptieren --- SL/Controller/BankTransaction.pm | 3 +++ 1 file changed, 3 insertions(+) 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 { -- 2.20.1