Revision fa04f813
Von Jan Büren vor mehr als 3 Jahren hinzugefügt
SL/Helper/ShippedQty.pm | ||
---|---|---|
220 | 220 |
$obj->{shipped_qty} = $shipped_qty->{$obj->id} //= 0; |
221 | 221 |
$obj->{delivered} = $shipped_qty->{$obj->id} == $obj->qty; |
222 | 222 |
} elsif ('SL::DB::Order' eq ref $obj) { |
223 |
if (defined $obj->{orderitems}) { |
|
224 |
$self->write_to($obj->{orderitems}); |
|
225 |
if ($self->services_deliverable) { |
|
226 |
$obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} } @{ $obj->{orderitems} }; |
|
227 |
} else { |
|
228 |
$obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} && !$_->part->is_service } @{ $obj->{orderitems} }; |
|
229 |
} |
|
223 |
# load all orderitems unless not already loaded |
|
224 |
$obj->orderitems unless (defined $obj->{orderitems}); |
|
225 |
$self->write_to($obj->{orderitems}); |
|
226 |
if ($self->services_deliverable) { |
|
227 |
$obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} } @{ $obj->{orderitems} }; |
|
230 | 228 |
} else { |
231 |
# don't force a load on items. just compute by oe_id directly |
|
232 |
$obj->{delivered} = $self->delivered->{$obj->id}; |
|
229 |
$obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} && !$_->part->is_service } @{ $obj->{orderitems} }; |
|
233 | 230 |
} |
234 | 231 |
} else { |
235 | 232 |
die "unknown reference '@{[ ref $obj ]}' for @{[ __PACKAGE__ ]}::write_to"; |
Auch abrufbar als: Unified diff
1. fix für #480, Im Einkauf wird der Status geliefert falsch im Auftrag gesetzt