]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/MetaSetup/Part.pm
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[mfinanz.git] / SL / DB / MetaSetup / Part.pm
index f80ad78e963b3ecc6ca3ebd737f15b0101b10f7b..ddc3f6fbece679d48afced739c5206a94d9870c1 100644 (file)
@@ -26,7 +26,6 @@ __PACKAGE__->meta->setup(
     inventory_accno_id => { type => 'integer' },
     income_accno_id    => { type => 'integer' },
     expense_accno_id   => { type => 'integer' },
-    bin                => { type => 'text' },
     shop               => { type => 'boolean', default => 'false' },
     obsolete           => { type => 'boolean', default => 'false' },
     bom                => { type => 'boolean', default => 'false' },
@@ -48,11 +47,50 @@ __PACKAGE__->meta->setup(
     onhand             => { type => 'numeric', default => '0', precision => 5, scale => 25 },
     stockable          => { type => 'boolean', default => 'false' },
     has_sernumber      => { type => 'boolean', default => 'false' },
+    warehouse_id       => { type => 'integer' },
+    bin_id             => { type => 'integer' },
   ],
 
   primary_key_columns => [ 'id' ],
 
   allow_inline_column_values => 1,
+
+  foreign_keys => [
+    bin => {
+      class       => 'SL::DB::Bin',
+      key_columns => { bin_id => 'id' },
+    },
+
+    buchungsgruppen => {
+      class       => 'SL::DB::Buchungsgruppe',
+      key_columns => { buchungsgruppen_id => 'id' },
+    },
+
+    partsgroup => {
+      class       => 'SL::DB::PartsGroup',
+      key_columns => { partsgroup_id => 'id' },
+    },
+
+    payment => {
+      class       => 'SL::DB::PaymentTerm',
+      key_columns => { payment_id => 'id' },
+    },
+
+    price_factor => {
+      class       => 'SL::DB::PriceFactor',
+      key_columns => { price_factor_id => 'id' },
+    },
+
+    unit_obj => {
+      class       => 'SL::DB::Unit',
+      key_columns => { unit => 'name' },
+    },
+
+    warehouse => {
+      class       => 'SL::DB::Warehouse',
+      key_columns => { warehouse_id => 'id' },
+    },
+  ],
 );
 
 1;