negativ_ap_transaction sollte keine Strafpunkte mehr fürs
Vorzeichen erhalten. TODO: Verkaufs-Gutschriften prüfen
}
#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'} . ') ';
}
);
my ($agreement, $rule_matches) = $bt->get_agreement_with_invoice($invoice);
- is($agreement, 15, "points for negative ap transaction ok");
+ is($agreement, 16, "points for negative ap transaction ok");
$::form->{invoice_ids} = {
$bt->id => [ $invoice->id ]