From 8809a4d1a4b4d3e5b3de31af94c0679dabfacc28 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Wed, 17 Jun 2015 22:04:36 +0200 Subject: [PATCH] =?utf8?q?Banktransactions=20-=20beim=20Speichern=20der=20?= =?utf8?q?Rechnung=20Zahlungsart=20pr=C3=BCfen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ob es einem gültigen payment type entspricht. Außerdem korrekte Variablenprüfung, für den Fall, daß kein payment_term gesetzt ist. --- SL/Controller/BankTransaction.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 30875038c..a41957d24 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -24,6 +24,7 @@ use SL::DB::Tax; use SL::DB::Draft; use SL::DB::BankAccount; use SL::Presenter; +use SL::DB::Helper::Payment qw(validate_payment_type); use List::Util qw(max); use Rose::Object::MakeMethods::Generic @@ -373,8 +374,9 @@ sub action_save_invoices { foreach my $invoice (@invoices) { my $payment_type; - if (@{ $skonto_hash->{"$bt_id"} }) { + if ( defined $skonto_hash->{"$bt_id"} ) { $payment_type = shift(@{ $skonto_hash->{"$bt_id"} }); + SL::DB::Helper::Payment->validate_payment_type($payment_type); } else { $payment_type = 'without_skonto'; }; -- 2.20.1