From: Moritz Bunkus Date: Mon, 24 Feb 2014 09:12:40 +0000 (+0100) Subject: SL::DB::Invoice->new_from: neue Option skip_items_zero_qty X-Git-Tag: release-3.2.0beta~491^2~4 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=fff57e55bed689ab673bf72937bfd71eab26a293;p=kivitendo-erp.git SL::DB::Invoice->new_from: neue Option skip_items_zero_qty …für Konsistenz mit DeliveryOrder->new_from. --- diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 987ab72a7..8a4f4ec8e 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -177,6 +177,8 @@ sub new_from { } @{ $items }; + @items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty}; + $invoice->invoiceitems(\@items); return $invoice; @@ -335,6 +337,10 @@ 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 quantity of 0 are skipped. + =item C An optional hash reference. If it exists then it is passed to C