Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / SL / DB / MetaSetup / Customer.pm
index 93f63b7..181f6e6 100644 (file)
@@ -11,14 +11,14 @@ __PACKAGE__->meta->setup(
 
   columns => [
     id             => { type => 'integer', not_null => 1, sequence => 'id' },
-    name           => { type => 'varchar', length => 75, not_null => 1 },
+    name           => { type => 'text', not_null => 1 },
     department_1   => { type => 'varchar', length => 75 },
     department_2   => { type => 'varchar', length => 75 },
     street         => { type => 'varchar', length => 75 },
     zipcode        => { type => 'varchar', length => 10 },
     city           => { type => 'varchar', length => 75 },
     country        => { type => 'varchar', length => 75 },
-    contact        => { type => 'varchar', length => 75 },
+    contact        => { type => 'text' },
     phone          => { type => 'varchar', length => 30 },
     fax            => { type => 'varchar', length => 30 },
     homepage       => { type => 'text' },
@@ -33,8 +33,8 @@ __PACKAGE__->meta->setup(
     bcc            => { type => 'text' },
     business_id    => { type => 'integer' },
     taxnumber      => { type => 'text' },
-    account_number => { type => 'varchar', length => 15 },
-    bank_code      => { type => 'varchar', length => 10 },
+    account_number => { type => 'text' },
+    bank_code      => { type => 'text' },
     bank           => { type => 'text' },
     language       => { type => 'varchar', length => 5 },
     datevexport    => { type => 'integer' },
@@ -50,15 +50,31 @@ __PACKAGE__->meta->setup(
     payment_id     => { type => 'integer' },
     taxzone_id     => { type => 'integer', default => '0', not_null => 1 },
     greeting       => { type => 'text' },
-    ustid          => { type => 'varchar', length => 14 },
+    ustid          => { type => 'text' },
     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' ],
 
-  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;