1 package SL::DB::DeliveryOrder;
5 use SL::DB::MetaSetup::DeliveryOrder;
6 use SL::DB::Manager::DeliveryOrder;
9 use List::Util qw(first);
11 __PACKAGE__->meta->add_relationship(orderitems => { type => 'one to many',
12 class => 'SL::DB::DeliveryOrderItem',
13 column_map => { id => 'trans_id' },
14 manager_args => { with_objects => [ 'part' ] }
18 __PACKAGE__->meta->initialize;
26 my $orders = SL::DB::Manager::Order->get_all(
28 ordnumber => $self->ordnumber,
29 @{ $params{query} || [] },
33 return first { $_->is_type('sales_order') } @{ $orders };