X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/713b399450375fad7df83bd47e0db82ba7b41a95..c2efdba2dfa10e76937e4bdf5a18e5483d0cddb0:/SL/Controller/BankTransaction.pm diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index e77240621..2bf4a9c51 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -101,7 +101,6 @@ sub action_list { @where ], ); - # credit notes have a negative amount, treat differently my $all_open_ar_invoices = SL::DB::Manager::Invoice ->get_all(where => [ or => [ amount => { gt => \'paid' }, and => [ type => 'credit_note', @@ -658,7 +657,7 @@ sub save_single_bank_transaction { # so $amount_of_transaction is negative but needs positive $amount_of_transaction *= -1; - } elsif (!$invoice->is_sales && $invoice->invoice_type eq 'ap_transaction' ) { + } elsif (!$invoice->is_sales && $invoice->invoice_type =~ m/ap_transaction|purchase_invoice/) { # $invoice->open_amount may be negative for ap_transaction but may be positiv for negativ ap_transaction # if $invoice->open_amount is negative $bank_transaction->amount is positve # if $invoice->open_amount is positive $bank_transaction->amount is negative