From: Jan Büren Date: Fri, 26 Nov 2021 10:09:57 +0000 (+0100) Subject: invoice_type: Gutschriften bleiben Gutschriften auch wenn die storniert wurden X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~281 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5a1dbe037515fdd49a2bf2004dcf94f6463db646;p=kivitendo-erp.git invoice_type: Gutschriften bleiben Gutschriften auch wenn die storniert wurden Andernfalls liefert invoice_type den Typ 'Rechnung' was definitiv falsch ist. --- diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index c5c29dd8e..54f5483e8 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -539,7 +539,8 @@ sub invoice_type { my ($self) = @_; return 'ar_transaction' if !$self->invoice; - return 'credit_note' if $self->type eq 'credit_note' && $self->amount < 0 && !$self->storno; + # stornoed credit_notes are still credit notes and not invoices + return 'credit_note' if $self->type eq 'credit_note' && $self->amount < 0; return 'invoice_storno' if $self->type ne 'credit_note' && $self->amount < 0 && $self->storno; return 'credit_note_storno' if $self->type eq 'credit_note' && $self->amount > 0 && $self->storno; return 'invoice';