Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / SL / DB / Vendor.pm
index d1d972a..1dd9369 100644 (file)
@@ -4,6 +4,10 @@ use strict;
 
 use SL::DB::MetaSetup::Vendor;
 use SL::DB::Helper::TransNumberGenerator;
+use SL::DB::Helper::CustomVariables (
+  module      => 'CT',
+  cvars_alias => 1,
+);
 
 use SL::DB::VC;
 
@@ -13,12 +17,13 @@ __PACKAGE__->meta->add_relationship(
     class        => 'SL::DB::Shipto',
     column_map   => { id      => 'trans_id' },
     manager_args => { sort_by => 'lower(shipto.shiptoname)' },
-    query_args   => [ 'shipto.module' => 'CT' ],
+    query_args   => [ module  => 'CT' ],
   },
-  business => {
-    type         => 'one to one',
-    class        => 'SL::DB::Business',
-    column_map   => { business_id => 'id' },
+  contacts => {
+    type         => 'one to many',
+    class        => 'SL::DB::Contact',
+    column_map   => { id      => 'cp_cv_id' },
+    manager_args => { sort_by => 'lower(contacts.cp_name)' },
   },
 );