From 5a1dbe037515fdd49a2bf2004dcf94f6463db646 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 26 Nov 2021 11:09:57 +0100 Subject: [PATCH] invoice_type: Gutschriften bleiben Gutschriften auch wenn die storniert wurden Andernfalls liefert invoice_type den Typ 'Rechnung' was definitiv falsch ist. --- SL/DB/Invoice.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'; -- 2.20.1