From fff57e55bed689ab673bf72937bfd71eab26a293 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 24 Feb 2014 10:12:40 +0100 Subject: [PATCH] SL::DB::Invoice->new_from: neue Option skip_items_zero_qty MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit …für Konsistenz mit DeliveryOrder->new_from. --- SL/DB/Invoice.pm | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.20.1