From 45a48bed7aaf0e695a92a4c0bb444de715637183 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 9 Jan 2012 15:58:22 +0100 Subject: [PATCH] rdbo models: customer und vendor nach de8868c und 4c4939d0. --- SL/DB/Customer.pm | 5 ----- SL/DB/MetaSetup/Customer.pm | 20 ++++++++++++++++++-- SL/DB/MetaSetup/Vendor.pm | 1 + 3 files changed, 19 insertions(+), 7 deletions(-) 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' ], -- 2.20.1