Revision 9c2d09b8
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
SL/DB/DeliveryOrder.pm | ||
---|---|---|
262 | 262 |
my $delivery_order; |
263 | 263 |
|
264 | 264 |
if ($params{related_order}) { |
265 |
$delivery_order = SL::DB::DeliveryOrder->new_from($params{related_order}, items => \@items, %params); |
|
265 |
# collect suitable items in related order |
|
266 |
my @items_to_use; |
|
267 |
foreach my $item (@items) { |
|
268 |
my $item_to_use = first {$item->parts_id == $_->parts_id} @{ $params{related_order}->items_sorted }; |
|
269 |
|
|
270 |
die "no suitable item found in related order" if !$item_to_use; |
|
271 |
|
|
272 |
my %new_attributes; |
|
273 |
$new_attributes{$_} = $item->$_ for qw(qty unit_obj longdescription); |
|
274 |
$item_to_use->assign_attributes(%new_attributes); |
|
275 |
push @items_to_use, $item_to_use; |
|
276 |
} |
|
277 |
$delivery_order = SL::DB::DeliveryOrder->new_from($params{related_order}, items => \@items_to_use, %params); |
|
266 | 278 |
|
267 | 279 |
} else { |
268 | 280 |
my %args = ( |
Auch abrufbar als: Unified diff
Zeiterfassung: Konvertierung: Position aus zugehörigem Auftrag