X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FVendor.pm;h=23886eaef871f4465481a610ec5891b67cb9c74e;hb=d81f55cefa8921fe0fc245dda721df0766502ad4;hp=d1d972a1586e881f250f5c8e6223cbbdfc2fc952;hpb=f87763cd84d89aafc4c4110ba42d041b02ce4371;p=kivitendo-erp.git diff --git a/SL/DB/Vendor.pm b/SL/DB/Vendor.pm index d1d972a15..23886eaef 100644 --- a/SL/DB/Vendor.pm +++ b/SL/DB/Vendor.pm @@ -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)' }, }, ); @@ -34,4 +39,7 @@ sub _before_save_set_vendornumber { return 1; } +sub is_customer { 0 }; +sub is_vendor { 1 }; + 1;