]> wagnertech.de Git - mfinanz.git/blob - SL/DB/Manager/DeliveryTerm.pm
restart apache2 in postinst
[mfinanz.git] / SL / DB / Manager / DeliveryTerm.pm
1 package SL::DB::Manager::DeliveryTerm;
2
3 use strict;
4
5 use SL::DB::Helper::Manager;
6 use base qw(SL::DB::Helper::Manager);
7
8 use SL::DB::Helper::Sorted;
9
10 sub object_class { 'SL::DB::DeliveryTerm' }
11
12 __PACKAGE__->make_manager_methods;
13
14 sub _sort_spec {
15   return ( default => [ 'sortkey', 1 ],
16            columns => { SIMPLE => 'ALL',
17                         map { ( $_ => "lower(delivery_terms.${_})" ) } qw(description description_long),
18                       });
19 }
20
21 sub get_valid {
22   my ($class, $with_this_id) = @_;
23
24   my @conditions = (obsolete => 0);
25
26   if ($with_this_id) {
27     @conditions = (
28       or => [
29         id => $with_this_id,
30         @conditions,
31       ]);
32   }
33
34   return $class->get_all_sorted(query => \@conditions);
35 }
36
37 1;