X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b6f37661d8b244fb55f27f9d77cfab6ed6a165e6..0070a2500fcd59d65a6f39a7a4e8d5eb9ef6cdbd:/SL/Controller/BankTransaction.pm?ds=sidebyside diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index f93bfd79e..52d43e1d6 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -669,7 +669,8 @@ sub save_single_bank_transaction { } else { # use the whole amount of the bank transaction for the invoice, overpay the invoice if necessary - if ( $invoice->is_sales && $invoice->invoice_type eq 'credit_note' ) { + # this catches credit_notes and negative sales invoices + if ( $invoice->is_sales && $invoice->amount < 0 ) { # $invoice->open_amount is negative for credit_notes # $bank_transaction->amount is negative for outgoing transactions # so $amount_of_transaction is negative but needs positive