From 1b032ef45d886922f1fe347ec234c9b0c8c50efd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 7 Apr 2022 10:31:14 +0200 Subject: [PATCH] =?utf8?q?Vorschl=C3=A4ge=20f=C3=BCr=20Kontoausz=C3=BCge?= =?utf8?q?=20verbessern,=20fall:=20remote=5Faccount=5Fnumber?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Treffer sauberer setzen, ist überhaupt eine nicht leere Kontonummer vorhanden? --- SL/DB/BankTransaction.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SL/DB/BankTransaction.pm b/SL/DB/BankTransaction.pm index e8c98cb64..8617a8146 100644 --- a/SL/DB/BankTransaction.pm +++ b/SL/DB/BankTransaction.pm @@ -99,6 +99,17 @@ sub get_agreement_with_invoice { $bank_code = $invoice->vendor->bank_code if ! $invoice->is_sales; $iban = $invoice->vendor->iban if ! $invoice->is_sales; $account_number = $invoice->vendor->account_number if ! $invoice->is_sales; + + # check only valid remote_account_number (with some content) + if ($self->remote_account_number) { + if ($bank_code eq $self->remote_bank_code && $account_number eq $self->remote_account_number) { + $agreement += $points{remote_account_number}; + $rule_matches .= 'remote_account_number(' . $points{'remote_account_number'} . ') '; + } elsif ($iban eq $self->remote_account_number) { # elsif -> do not add twice + $agreement += $points{remote_account_number}; + $rule_matches .= 'remote_account_number(' . $points{'remote_account_number'} . ') '; + } + } if ( $bank_code eq $self->remote_bank_code && $account_number eq $self->remote_account_number ) { $agreement += $points{remote_account_number}; $rule_matches .= 'remote_account_number(' . $points{'remote_account_number'} . ') '; -- 2.20.1