From 20392548f2e8ed92478542893df9852d6987e031 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 16 Aug 2016 11:36:58 +0200 Subject: [PATCH] =?utf8?q?Bankeinzug:=20bei=20=C3=9Cberzahlung=20eine=20Wa?= =?utf8?q?rnung=20ausgeben?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Eine Überzahlung ist oftmals OK oder unvermeidbar, sollte aber von der BenutzerIn begutachtet werden. --- SL/Controller/BankTransaction.pm | 7 +++++++ locale/de/all | 1 + 2 files changed, 8 insertions(+) diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 9f08263f8..8f4bffd5c 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -524,6 +524,7 @@ sub save_single_bank_transaction { payment_type => $payment_type, transdate => $bank_transaction->transdate->to_kivitendo); } else { # use the whole amount of the bank transaction for the invoice, overpay the invoice if necessary + my $overpaid_amount = $amount_of_transaction - $invoice->open_amount; $invoice->pay_invoice(chart_id => $bank_transaction->local_bank_account->chart_id, trans_id => $invoice->id, amount => $amount_of_transaction, @@ -531,6 +532,12 @@ sub save_single_bank_transaction { transdate => $bank_transaction->transdate->to_kivitendo); $bank_transaction->invoice_amount($bank_transaction->amount); $amount_of_transaction = 0; + + push @warnings, { + %data, + result => 'warning', + message => $::locale->text('Invoice #1 was overpaid by #2.', $invoice->invnumber, $::form->format_amount(\%::myconfig, $overpaid_amount, 2)), + }; } # Record a record link from the bank transaction to the invoice diff --git a/locale/de/all b/locale/de/all index 1d5897ae2..9c09cb809 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1503,6 +1503,7 @@ $self->{texts} = { 'Invnumber' => 'Rechnungsnummer', 'Invnumber missing!' => 'Rechnungsnummer fehlt!', 'Invoice' => 'Rechnung', + 'Invoice #1 was overpaid by #2.' => 'Rechnung #1 wurde um #2 überzahlt.', 'Invoice (one letter abbreviation)' => 'R', 'Invoice Date' => 'Rechnungsdatum', 'Invoice Date missing!' => 'Rechnungsdatum fehlt!', -- 2.20.1