X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/866ed897a3a06f239015f902fbc4eeb380fb4309..b6f8a6b0fe6dae88ce0189c4999d7c1aa96d32a2:/SL/DB/BankTransaction.pm diff --git a/SL/DB/BankTransaction.pm b/SL/DB/BankTransaction.pm index e2ddede4e..0d6895b23 100644 --- a/SL/DB/BankTransaction.pm +++ b/SL/DB/BankTransaction.pm @@ -162,11 +162,12 @@ sub get_agreement_with_invoice { } #check sign - if ( $invoice->is_sales && $self->amount < 0 ) { + if ( $invoice->is_sales && $self->amount < 0 ) { # TODO debit note $agreement += $points{wrong_sign}; $rule_matches .= 'wrong_sign(' . $points{'wrong_sign'} . ') '; } - if ( ! $invoice->is_sales && $self->amount > 0 ) { + if (( !$invoice->is_sales && $invoice->amount > 0 && $self->amount > 0) || + ( !$invoice->is_sales && $invoice->amount < 0 && $self->amount < 0) ) { # credit note $agreement += $points{wrong_sign}; $rule_matches .= 'wrong_sign(' . $points{'wrong_sign'} . ') '; }