From: Sven Schöling Date: Mon, 9 Jan 2012 14:58:22 +0000 (+0100) Subject: rdbo models: customer und vendor nach de8868c und 4c4939d0. X-Git-Tag: release-2.7.0beta1~82^2~3 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=45a48bed7aaf0e695a92a4c0bb444de715637183;p=kivitendo-erp.git rdbo models: customer und vendor nach de8868c und 4c4939d0. --- diff --git a/SL/DB/Customer.pm b/SL/DB/Customer.pm index f9f890167..2e3fa6856 100644 --- a/SL/DB/Customer.pm +++ b/SL/DB/Customer.pm @@ -26,11 +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' }, - }, ); __PACKAGE__->meta->initialize; diff --git a/SL/DB/MetaSetup/Customer.pm b/SL/DB/MetaSetup/Customer.pm index 00bdb258f..181f6e658 100644 --- a/SL/DB/MetaSetup/Customer.pm +++ b/SL/DB/MetaSetup/Customer.pm @@ -51,14 +51,30 @@ __PACKAGE__->meta->setup( taxzone_id => { type => 'integer', default => '0', not_null => 1 }, greeting => { type => 'text' }, ustid => { type => 'text' }, + direct_debit => { type => 'boolean', default => 'false' }, iban => { type => 'varchar', length => 100 }, bic => { type => 'varchar', length => 100 }, - direct_debit => { type => 'boolean', default => 'false' }, + curr => { type => 'character', length => 3 }, ], primary_key_columns => [ 'id' ], - allow_inline_column_values => 1, + foreign_keys => [ + business => { + class => 'SL::DB::Business', + key_columns => { business_id => 'id' }, + }, + + language_obj => { + class => 'SL::DB::Language', + key_columns => { language_id => 'id' }, + }, + + payment => { + class => 'SL::DB::PaymentTerm', + key_columns => { payment_id => 'id' }, + }, + ], ); 1; diff --git a/SL/DB/MetaSetup/Vendor.pm b/SL/DB/MetaSetup/Vendor.pm index ae71c6293..2fc47cc18 100644 --- a/SL/DB/MetaSetup/Vendor.pm +++ b/SL/DB/MetaSetup/Vendor.pm @@ -54,6 +54,7 @@ __PACKAGE__->meta->setup( direct_debit => { type => 'boolean', default => 'false' }, iban => { type => 'varchar', length => 100 }, bic => { type => 'varchar', length => 100 }, + curr => { type => 'character', length => 3 }, ], primary_key_columns => [ 'id' ],