From: Moritz Bunkus Date: Mon, 8 Dec 2014 12:50:18 +0000 (+0100) Subject: SL::DB::{Invoice,DeliveryOrder}: Items mit neg. qty beim Wandeln optional weglassen X-Git-Tag: release-3.2.0beta~197 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f9fdf190e4050f7eb8009467a47918340a9b975e;p=kivitendo-erp.git SL::DB::{Invoice,DeliveryOrder}: Items mit neg. qty beim Wandeln optional weglassen --- diff --git a/SL/DB/DeliveryOrder.pm b/SL/DB/DeliveryOrder.pm index 824689353..68997416c 100644 --- a/SL/DB/DeliveryOrder.pm +++ b/SL/DB/DeliveryOrder.pm @@ -164,6 +164,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}; $delivery_order->items(\@items); @@ -239,6 +240,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. diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index b6f1becd8..a84324c40 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); @@ -387,6 +388,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.