]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/Invoice.pm
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[mfinanz.git] / SL / DB / Invoice.pm
index 82cf66b5e2ce00de33ef6422443ec79016b4820b..8bfc918e83bc6bb239ffd58cf2b1823c138f7327 100644 (file)
@@ -203,6 +203,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};
 
@@ -411,6 +412,12 @@ a quantity of 0 are not affected by this option.
 
 If trueish then items with a quantity of 0 are skipped.
 
+=item C<item_filter>
+
+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<attributes>
 
 An optional hash reference. If it exists then it is passed to C<new>