kivitendo/SL/DB/Manager/DeliveryTerm.pm @ 9bd3c54d
03d3d025 | Bernd Bleßmann | package SL::DB::Manager::DeliveryTerm;
|
||
use strict;
|
||||
use SL::DB::Helper::Manager;
|
||||
use base qw(SL::DB::Helper::Manager);
|
||||
use SL::DB::Helper::Sorted;
|
||||
sub object_class { 'SL::DB::DeliveryTerm' }
|
||||
__PACKAGE__->make_manager_methods;
|
||||
sub _sort_spec {
|
||||
return ( default => [ 'sortkey', 1 ],
|
||||
columns => { SIMPLE => 'ALL',
|
||||
map { ( $_ => "lower(delivery_terms.${_})" ) } qw(description description_long),
|
||||
});
|
||||
}
|
||||
2f5363d2 | Moritz Bunkus | sub get_valid {
|
||
my ($class, $with_this_id) = @_;
|
||||
my @conditions = (obsolete => 0);
|
||||
if ($with_this_id) {
|
||||
@conditions = (
|
||||
or => [
|
||||
id => $with_this_id,
|
||||
@conditions,
|
||||
]);
|
||||
}
|
||||
return $class->get_all_sorted(query => \@conditions);
|
||||
}
|
||||
03d3d025 | Bernd Bleßmann | 1;
|