65cd85da24e15a03d3b6862d0c01808a78eb4063
[kivitendo-erp.git] / SL / DB / MetaSetup / Part.pm
1 # This file has been auto-generated. Do not modify it; it will be overwritten
2 # by rose_auto_create_model.pl automatically.
3 package SL::DB::Part;
4
5 use strict;
6
7 use parent qw(SL::DB::Object);
8
9 __PACKAGE__->meta->table('parts');
10
11 __PACKAGE__->meta->columns(
12   bin_id             => { type => 'integer' },
13   bom                => { type => 'boolean', default => 'false' },
14   buchungsgruppen_id => { type => 'integer' },
15   description        => { type => 'text' },
16   drawing            => { type => 'text' },
17   ean                => { type => 'text' },
18   formel             => { type => 'text' },
19   gv                 => { type => 'numeric', precision => 15, scale => 5 },
20   has_sernumber      => { type => 'boolean', default => 'false' },
21   id                 => { type => 'integer', not_null => 1, sequence => 'id' },
22   image              => { type => 'text' },
23   itime              => { type => 'timestamp', default => 'now()' },
24   lastcost           => { type => 'numeric', precision => 15, scale => 5 },
25   listprice          => { type => 'numeric', precision => 15, scale => 5 },
26   makemodel          => { type => 'boolean', default => 'false' },
27   microfiche         => { type => 'text' },
28   mtime              => { type => 'timestamp' },
29   not_discountable   => { type => 'boolean', default => 'false' },
30   notes              => { type => 'text' },
31   obsolete           => { type => 'boolean', default => 'false' },
32   onhand             => { type => 'numeric', default => '0', precision => 25, scale => 5 },
33   part_type          => { type => 'enum', check_in => [ 'part', 'service', 'assembly', 'assortment' ], db_type => 'part_type_enum', not_null => 1 },
34   partnumber         => { type => 'text', not_null => 1 },
35   partsgroup_id      => { type => 'integer' },
36   payment_id         => { type => 'integer' },
37   price_factor_id    => { type => 'integer' },
38   priceupdate        => { type => 'date', default => 'now' },
39   rop                => { type => 'float', scale => 4 },
40   sellprice          => { type => 'numeric', precision => 15, scale => 5 },
41   shop               => { type => 'boolean', default => 'false' },
42   stockable          => { type => 'boolean', default => 'false' },
43   unit               => { type => 'varchar', length => 20, not_null => 1 },
44   ve                 => { type => 'integer' },
45   warehouse_id       => { type => 'integer' },
46   weight             => { type => 'float', scale => 4 },
47 );
48
49 __PACKAGE__->meta->primary_key_columns([ 'id' ]);
50
51 __PACKAGE__->meta->unique_keys([ 'partnumber' ]);
52
53 __PACKAGE__->meta->allow_inline_column_values(1);
54
55 __PACKAGE__->meta->foreign_keys(
56   bin => {
57     class       => 'SL::DB::Bin',
58     key_columns => { bin_id => 'id' },
59   },
60
61   buchungsgruppen => {
62     class       => 'SL::DB::Buchungsgruppe',
63     key_columns => { buchungsgruppen_id => 'id' },
64   },
65
66   partsgroup => {
67     class       => 'SL::DB::PartsGroup',
68     key_columns => { partsgroup_id => 'id' },
69   },
70
71   payment => {
72     class       => 'SL::DB::PaymentTerm',
73     key_columns => { payment_id => 'id' },
74   },
75
76   price_factor => {
77     class       => 'SL::DB::PriceFactor',
78     key_columns => { price_factor_id => 'id' },
79   },
80
81   unit_obj => {
82     class       => 'SL::DB::Unit',
83     key_columns => { unit => 'name' },
84   },
85
86   warehouse => {
87     class       => 'SL::DB::Warehouse',
88     key_columns => { warehouse_id => 'id' },
89   },
90 );
91
92 1;
93 ;