1 package SL::DB::Manager::OrderItem;
5 use SL::DB::Helper::Manager;
6 use base qw(SL::DB::Helper::Manager);
8 use SL::DB::Helper::Filtered;
9 use SL::DB::Helper::Paginated;
10 use SL::DB::Helper::Sorted;
12 sub object_class { 'SL::DB::OrderItem' }
14 __PACKAGE__->make_manager_methods;
15 __PACKAGE__->add_filter_specs(
17 my ($key, $value, $prefix) = @_;
20 $prefix . reqdate => $value,
22 $prefix . reqdate => undef,
23 $prefix . 'order.reqdate' => $value,
31 return ( columns => { delivery_date => [ 'deliverydate', ],
32 description => [ 'lower(orderitems.description)', ],
33 partnumber => [ 'part.partnumber', ],
35 ordnumber => [ 'order.ordnumber' ],
36 customer => [ 'lower(customer.name)', ],
37 position => [ 'trans_id', 'position' ],
38 reqdate => [ 'COALESCE(orderitems.reqdate, order.reqdate)' ],
39 orddate => [ 'order.orddate' ],
40 sellprice => [ 'orderitems.sellprice' ],
41 discount => [ 'orderitems.discount' ],
42 transdate => [ 'orderitems.transdate::date', 'order.reqdate' ],
44 default => [ 'position', 1 ],
49 sub default_objects_per_page { 15 }