X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/0845c4b7d7a969d68cd55a15780c0af2fbe4d2db..ad9b15c2da87c6ee98f0990b49c8dff0f09cf581:/SL/DB/OrderItem.pm diff --git a/SL/DB/OrderItem.pm b/SL/DB/OrderItem.pm index 862a215a1..37520977b 100644 --- a/SL/DB/OrderItem.pm +++ b/SL/DB/OrderItem.pm @@ -3,7 +3,6 @@ package SL::DB::OrderItem; use strict; use List::Util qw(sum); -use SL::AM; use SL::DB::MetaSetup::OrderItem; use SL::DB::Manager::OrderItem; @@ -11,7 +10,10 @@ use SL::DB::Helper::CustomVariables ( sub_module => 'orderitems', cvars_alias => 1, overloads => { - parts_id => 'SL::DB::Part', + parts_id => { + class => 'SL::DB::Part', + module => 'IC', + } }, ); @@ -36,6 +38,7 @@ sub shipped_qty { my $d_orders = $self->order->linked_records(direction => 'to', to => 'SL::DB::DeliveryOrder'); my @doi = grep { $_->parts_id == $self->parts_id } map { $_->orderitems } @$d_orders; + require SL::AM; return sum(map { AM->convert_unit($_->unit => $self->unit) * $_->qty } @doi); }