Revision db7a2e79
Von Sven Schöling vor mehr als 8 Jahren hinzugefügt
SL/DB/Manager/Letter.pm | ||
---|---|---|
12 | 12 |
sub object_class { 'SL::DB::Letter' } |
13 | 13 |
|
14 | 14 |
__PACKAGE__->make_manager_methods; |
15 |
__PACKAGE__->add_filter_specs( |
|
16 |
is_sales => sub { |
|
17 |
my ($key, $value, $prefix) = @_; |
|
18 |
__PACKAGE__->is_sales_filter($value, $prefix); |
|
19 |
}, |
|
20 |
); |
|
21 |
|
|
22 |
sub is_sales_filter { |
|
23 |
my ($class, $value, $prefix) = @_; |
|
24 |
|
|
25 |
return () if !defined $value; |
|
26 |
return ($prefix . 'customer_id' => { gt => 0 }) if $value; |
|
27 |
return ($prefix . 'vendor_id' => { gt => 0 }) if !$value; |
|
28 |
} |
|
15 | 29 |
|
16 | 30 |
sub _sort_spec { |
17 | 31 |
return ( columns => { SIMPLE => 'ALL', |
Auch abrufbar als: Unified diff
Briefe: Lieferantenbriefe