Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[kivitendo-erp.git] / SL / DB / Customer.pm
index 7cdfde6..2e3fa68 100644 (file)
@@ -26,17 +26,6 @@ __PACKAGE__->meta->add_relationship(
     column_map   => { id      => 'cp_cv_id' },
     manager_args => { sort_by => 'lower(contacts.cp_name)' },
   },
-  business => {
-    type         => 'one to one',
-    class        => 'SL::DB::Business',
-    column_map   => { business_id => 'id' },
-  },
-  custom_variables => {
-    type           => 'one to many',
-    class          => 'SL::DB::CustomVariable',
-    column_map     => { id => 'trans_id' },
-    query_args     => [ config_id => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module = 'CT')" ] ],
-  },
 );
 
 __PACKAGE__->meta->initialize;
@@ -56,4 +45,10 @@ sub short_address {
   return join ', ', grep { $_ } $self->street, $self->zipcode, $self->city;
 }
 
+sub displayable_name {
+  my $self = shift;
+
+  return join ' ', grep $_, $self->customernumber, $self->name;
+}
+
 1;