projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Lieferscheine benötigen auch Preisquellen
[kivitendo-erp.git]
/
SL
/
DB
/
DeliveryOrder.pm
diff --git
a/SL/DB/DeliveryOrder.pm
b/SL/DB/DeliveryOrder.pm
index
0602485
..
9c405f5
100644
(file)
--- a/
SL/DB/DeliveryOrder.pm
+++ b/
SL/DB/DeliveryOrder.pm
@@
-44,6
+44,7
@@
sub _before_save_set_donumber {
# methods
sub items { goto &orderitems; }
# methods
sub items { goto &orderitems; }
+sub add_items { goto &add_orderitems; }
sub items_sorted {
my ($self) = @_;
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 };
@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);
}
$delivery_order->items(\@items);
return ($delivery_order, $custom_shipto);
}
+sub customervendor {
+ $_[0]->is_sales ? $_[0]->customer : $_[0]->vendor;
+}
+
1;
__END__
1;
__END__
@@
-238,6
+244,11
@@
missing then the method C<items_sorted> will be called on
C<$source>. This option can be used to override the sorting, to
exclude certain positions or to add additional ones.
C<$source>. This option can be used to override the sorting, to
exclude certain positions or to add additional ones.
+=item C<skip_items_negative_qty>
+
+If trueish then items with a negative quantity are skipped. Items with
+a quantity of 0 are not affected by this option.
+
=item C<skip_items_zero_qty>
If trueish then items with a quantity of 0 are skipped.
=item C<skip_items_zero_qty>
If trueish then items with a quantity of 0 are skipped.