X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/9ba3a010bca395410803067324c1924cabf956b4..8ae2bc4fb4c72f3ac907a3e47c0cbd5da23f62c5:/SL/DB/Invoice.pm diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 14c11fa7d..c66584135 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__ @@ -301,8 +317,7 @@ and recorded in C. =item 6. Items in C are updated according to their allocation status (regarding for costs of goold sold). Will only be done if -Lx-Office is not configured to use Einnahmenüberschussrechnungen -(see config/lx_office.conf, section "system", variable "eur"). +kivitendo is not configured to use Einnahmenüberschussrechnungen. =item 7. The invoice and its items are saved.