1 package SL::DB::Manager::DeliveryOrder;
5 use parent qw(SL::DB::Helper::Manager);
7 use SL::DB::Helper::Paginated;
8 use SL::DB::Helper::Sorted;
10 sub object_class { 'SL::DB::DeliveryOrder' }
12 __PACKAGE__->make_manager_methods;
16 my $type = lc(shift || '');
18 return ('!customer_id' => undef) if $type eq 'sales_delivery_order';
19 return ('!vendor_id' => undef) if $type eq 'purchase_delivery_order';
21 die "Unknown type $type";
26 default => [ 'transdate', 1 ],
28 transaction_description => 'FIRST',
29 customer_name => 'FIRST',
30 vendor_name => 'FIRST',
35 customer => 'lower(customer.name)',
36 vendor => 'lower(vendor.name)',
37 globalprojectnumber => 'lower(globalproject.projectnumber)',
39 # Bug in Rose::DB::Object: the next should be
40 # "globalproject.project_type.description". This workaround will
41 # only work if no other table with "project_type" is visible in
43 globalproject_type => 'lower(project_type.description)',
45 map { ( $_ => "lower(delivery_orders.$_)" ) } qw(donumber ordnumber cusordnumber oreqnumber shippingpoint shipvia notes intnotes transaction_description),
49 sub default_objects_per_page { 40 }