sub init_all_pricegroups {
my ($self) = @_;
- return SL::DB::Manager::Pricegroup->get_all(sort => 'id');
+ return SL::DB::Manager::Pricegroup->get_all_sorted;
}
sub init_settings {
$object->buchungsgruppen_id(undef) if $object->buchungsgruppen_id && !$self->bg_by->{id}->{ $object->buchungsgruppen_id };
# 3. Look up name if supplied.
- if (!$object->buchungsgruppen_id) {
+ if (!$object->buchungsgruppen_id && $entry->{raw_data}->{buchungsgruppe}) {
my $bg = $self->bg_by->{description}->{ $entry->{raw_data}->{buchungsgruppe} };
$object->buchungsgruppen_id($bg->id) if $bg;
}