Revision 26dcea15
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/OrderItem.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
|
5 | 5 |
use List::Util qw(sum); |
6 |
use SL::AM; |
|
7 | 6 |
|
8 | 7 |
use SL::DB::MetaSetup::OrderItem; |
9 | 8 |
use SL::DB::Manager::OrderItem; |
... | ... | |
36 | 35 |
my $d_orders = $self->order->linked_records(direction => 'to', to => 'SL::DB::DeliveryOrder'); |
37 | 36 |
my @doi = grep { $_->parts_id == $self->parts_id } map { $_->orderitems } @$d_orders; |
38 | 37 |
|
38 |
require SL::AM; |
|
39 | 39 |
return sum(map { AM->convert_unit($_->unit => $self->unit) * $_->qty } @doi); |
40 | 40 |
} |
41 | 41 |
|
Auch abrufbar als: Unified diff
AM nicht aus SL::DB::Object laden