X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FDB%2FDeliveryOrder.pm;h=9c405f52ab982c1b6e6fc77621c50bc0b12aa35e;hb=44310118d55217b2456a2ceab51b14c0bfb77bbc;hp=06024855fd52f4110c6effac3d931cc9404e0f9b;hpb=6473dcb171ba4e401d001372075ada92cc90e875;p=kivitendo-erp.git diff --git a/SL/DB/DeliveryOrder.pm b/SL/DB/DeliveryOrder.pm index 06024855f..9c405f52a 100644 --- a/SL/DB/DeliveryOrder.pm +++ b/SL/DB/DeliveryOrder.pm @@ -44,6 +44,7 @@ sub _before_save_set_donumber { # methods sub items { goto &orderitems; } +sub add_items { goto &add_orderitems; } sub items_sorted { my ($self) = @_; @@ -163,12 +164,17 @@ 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); return ($delivery_order, $custom_shipto); } +sub customervendor { + $_[0]->is_sales ? $_[0]->customer : $_[0]->vendor; +} + 1; __END__ @@ -238,6 +244,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.