X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/464f44accd46ed0b2e1f7e2459f53337a6720a7f..a7ca8ba215c2a039e97c27bc3c637712fca837e9:/SL/DB/Invoice.pm diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 82cf66b5e..239280b2a 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -77,6 +77,7 @@ sub _before_save_set_invnumber { sub items { goto &invoiceitems; } sub add_items { goto &add_invoiceitems; } +sub record_number { goto &invnumber; }; sub is_sales { # For compatibility with Order, DeliveryOrder @@ -203,6 +204,7 @@ sub new_from { $current_invoice_item; } @{ $items }; + @items = grep { $params{item_filter}->($_) } @items if $params{item_filter}; @items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty}; @items = grep { $_->qty >=0 } @items if $params{skip_items_negative_qty}; @@ -335,6 +337,10 @@ sub displayable_type { return t8('Invoice'); } +sub displayable_name { + join ' ', grep $_, map $_[0]->$_, qw(displayable_type record_number); +}; + sub abbreviation { my ($self) = @_; @@ -411,6 +417,12 @@ a quantity of 0 are not affected by this option. If trueish then items with a quantity of 0 are skipped. +=item C + +An optional code reference that is called for each item with the item +as its sole parameter. Items for which the code reference returns a +falsish value will be skipped. + =item C An optional hash reference. If it exists then it is passed to C