Revision 0f743db7
Von Sven Schöling vor mehr als 7 Jahren hinzugefügt
SL/Helper/ShippedQty.pm | ||
---|---|---|
7 | 7 |
use Scalar::Util qw(blessed); |
8 | 8 |
use SL::DBUtils qw(selectall_hashref_query selectall_as_map); |
9 | 9 |
use List::Util qw(min); |
10 |
use List::MoreUtils qw(any all); |
|
10 |
use List::MoreUtils qw(any all uniq);
|
|
11 | 11 |
use List::UtilsBy qw(partition_by); |
12 | 12 |
use SL::Locale::String qw(t8); |
13 | 13 |
|
... | ... | |
262 | 262 |
|
263 | 263 |
die 'oe_ids not initialized in id mode' if !$self->objects_or_ids; |
264 | 264 |
die 'objects not initialized before accessing ids' if $self->objects_or_ids && !defined $self->objects; |
265 |
die 'objects need to be Order or OrderItem' if any { ref($_) !~ /^SL::DB::Order(?:Item)?$/ } @{ $self->objects }; |
|
265 | 266 |
|
266 |
[ map { $_->id } @{ $self->objects } ]
|
|
267 |
[ uniq map { ref($_) =~ /Item/ ? $_->trans_id : $_->id } @{ $self->objects } ]
|
|
267 | 268 |
} |
268 | 269 |
|
269 | 270 |
sub init_dbh { SL::DB->client->dbh } |
... | ... | |
308 | 309 |
|
309 | 310 |
$helper->calculate($order_object); |
310 | 311 |
$helper->calculate(\@order_objects); |
312 |
$helper->calculate($orderitem_object); |
|
313 |
$helper->calculate(\@orderitem_objects); |
|
311 | 314 |
$helper->calculate($oe_id); |
312 | 315 |
$helper->calculate(\@oe_ids); |
313 | 316 |
|
Auch abrufbar als: Unified diff
Helper::ShippedQty: orderitems korrekt in calculate behandeln