1 package SL::DB::Manager::Letter;
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::Letter' }
14 __PACKAGE__->make_manager_methods;
15 __PACKAGE__->add_filter_specs(
17 my ($key, $value, $prefix) = @_;
18 __PACKAGE__->is_sales_filter($value, $prefix);
23 my ($class, $value, $prefix) = @_;
25 return () if !defined $value;
26 return ($prefix . 'customer_id' => { gt => 0 }) if $value;
27 return ($prefix . 'vendor_id' => { gt => 0 }) if !$value;
31 return ( columns => { SIMPLE => 'ALL',
32 customer => [ 'lower(customer.name)', ],
34 default => [ 'date', 0 ],
39 sub default_objects_per_page { 30 }