X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FInvoice.pm;h=c330084edcd8ecf38552257540afb49a55955e87;hb=07d65516a53475a8f40714da7b4d2f906cb62804;hp=14c11fa7d6b5c48e6d606d80be41ff497f4294f5;hpb=e0ad5757c7f9551f808b55c114ff8892f09689f4;p=kivitendo-erp.git diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 14c11fa7d..c330084ed 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -236,6 +236,22 @@ sub _post_update_allocated { } } +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; + 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'; +} + +sub displayable_state { + my $self = shift; + + return $self->closed ? $::locale->text('closed') : $::locale->text('open'); +} + 1; __END__