E-Mail-Journal: verschickte E-Mails speichern
[kivitendo-erp.git] / SL / DB / Default.pm
index 2da27d5..ee9e2c2 100644 (file)
@@ -4,16 +4,18 @@ use strict;
 
 use SL::DB::MetaSetup::Default;
 
+__PACKAGE__->meta->initialize;
+
 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
 __PACKAGE__->meta->make_manager_class;
 
 sub get_default_currency {
-  my $self = _selfify(@_);
-  my @currencies = grep { $_ } split(/:/, $self->curr || '');
-  return $currencies[0] || '';
+  my $self = shift->get;
+  return $self->currency->name || '' if $self->currency_id;
+  return '';
 }
 
-sub _selfify {
+sub get {
   my ($class_or_self) = @_;
   return $class_or_self if ref($class_or_self);
   return SL::DB::Manager::Default->get_all(limit => 1)->[0];