Revision 0ff17226
Von Sven Schöling vor etwa 8 Jahren hinzugefügt
SL/DB/OrderItem.pm | ||
---|---|---|
33 | 33 |
sub shipped_qty { |
34 | 34 |
my ($self) = @_; |
35 | 35 |
|
36 |
my $d_orders = $self->order->linked_records(direction => 'to', to => 'SL::DB::DeliveryOrder'); |
|
36 |
my $d_orders = $self->order->linked_records(direction => 'to', to => 'SL::DB::DeliveryOrder', with_objects => [ 'orderitems' ]);
|
|
37 | 37 |
my @doi = grep { $_->parts_id == $self->parts_id } map { $_->orderitems } @$d_orders; |
38 | 38 |
|
39 |
require SL::AM; |
|
40 | 39 |
return sum(map { AM->convert_unit($_->unit => $self->unit) * $_->qty } @doi); |
41 | 40 |
} |
42 | 41 |
|
Auch abrufbar als: Unified diff
LinkedRecords: with_objects erlauben für shipped_qty