X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/f6ed86efee2a0a38b6e88e98fd9d4403fa64ff5e..1e2673bbe853305facd6bf61d7bb45141250136d:/SL/DB/Invoice.pm diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index d734003a1..ae1c596d6 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -198,6 +198,7 @@ sub new_from { } @{ $items }; @items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty}; + @items = grep { $_->qty >=0 } @items if $params{skip_items_negative_qty}; $invoice->invoiceitems(\@items); @@ -318,21 +319,38 @@ sub displayable_state { return $self->closed ? $::locale->text('closed') : $::locale->text('open'); } +sub displayable_type { + my ($self) = @_; + + return t8('AR Transaction') if $self->invoice_type eq 'ar_transaction'; + return t8('Credit Note') if $self->invoice_type eq 'credit_note'; + return t8('Invoice') . "(" . t8('Storno') . ")" if $self->invoice_type eq 'invoice_storno'; + return t8('Credit Note') . "(" . t8('Storno') . ")" if $self->invoice_type eq 'credit_note_storno'; + return t8('Invoice'); +} + sub abbreviation { - my $self = shift; + my ($self) = @_; - return t8('AR Transaction (abbreviation)') if !$self->invoice; - return t8('Credit note (one letter abbreviation)') if $self->type eq 'credit_note' && $self->amount < 0 && !$self->storno; - return t8('Invoice (one letter abbreviation)') . "(" . t8('Storno (one letter abbreviation)') . ")" if $self->type ne 'credit_note' && $self->amount < 0 && $self->storno; - return t8('Credit note (one letter abbreviation)') . "(" . t8('Storno (one letter abbreviation)') . ")" if $self->type eq 'credit_note' && $self->amount > 0 && $self->storno; + return t8('AR Transaction (abbreviation)') if $self->invoice_type eq 'ar_transaction'; + return t8('Credit note (one letter abbreviation)') if $self->invoice_type eq 'credit_note'; + return t8('Invoice (one letter abbreviation)') . "(" . t8('Storno (one letter abbreviation)') . ")" if $self->invoice_type eq 'invoice_storno'; + return t8('Credit note (one letter abbreviation)') . "(" . t8('Storno (one letter abbreviation)') . ")" if $self->invoice_type eq 'credit_note_storno'; return t8('Invoice (one letter abbreviation)'); - } sub date { goto &transdate; } +sub reqdate { + goto &duedate; +} + +sub customervendor { + goto &customer; +} + sub transactions { my ($self) = @_; @@ -377,6 +395,11 @@ missing then the method C will be called on C<$source>. This option can be used to override the sorting, to exclude certain positions or to add additional ones. +=item C + +If trueish then items with a negative quantity are skipped. Items with +a quantity of 0 are not affected by this option. + =item C If trueish then items with a quantity of 0 are skipped.