ef6ed69f5aaee46b54c96f76608c40d3329b5c21
[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   classification_id  => { type => 'integer', default => '0' },
16   description        => { type => 'text' },
17   drawing            => { type => 'text' },
18   ean                => { type => 'text' },
19   formel             => { type => 'text' },
20   gv                 => { type => 'numeric', precision => 15, scale => 5 },
21   has_sernumber      => { type => 'boolean', default => 'false' },
22   id                 => { type => 'integer', not_null => 1, sequence => 'id' },
23   image              => { type => 'text' },
24   itime              => { type => 'timestamp', default => 'now()' },
25   lastcost           => { type => 'numeric', precision => 15, scale => 5 },
26   listprice          => { type => 'numeric', precision => 15, scale => 5 },
27   makemodel          => { type => 'boolean', default => 'false' },
28   microfiche         => { type => 'text' },
29   mtime              => { type => 'timestamp' },
30   not_discountable   => { type => 'boolean', default => 'false' },
31   notes              => { type => 'text' },
32   obsolete           => { type => 'boolean', default => 'false' },
33   onhand             => { type => 'numeric', default => '0', precision => 25, scale => 5 },
34   part_type          => { type => 'enum', check_in => [ 'part', 'service', 'assembly', 'assortment' ], db_type => 'part_type_enum', not_null => 1 },
35   partnumber         => { type => 'text', not_null => 1 },
36   partsgroup_id      => { type => 'integer' },
37   payment_id         => { type => 'integer' },
38   price_factor_id    => { type => 'integer' },
39   priceupdate        => { type => 'date', default => 'now' },
40   rop                => { type => 'float', precision => 4, scale => 4 },
41   sellprice          => { type => 'numeric', precision => 15, scale => 5 },
42   shop               => { type => 'boolean', default => 'false' },
43   stockable          => { type => 'boolean', default => 'false' },
44   unit               => { type => 'varchar', length => 20, not_null => 1 },
45   ve                 => { type => 'integer' },
46   warehouse_id       => { type => 'integer' },
47   weight             => { type => 'float', precision => 4, scale => 4 },
48 );
49
50 __PACKAGE__->meta->primary_key_columns([ 'id' ]);
51
52 __PACKAGE__->meta->unique_keys([ 'partnumber' ]);
53
54 __PACKAGE__->meta->allow_inline_column_values(1);
55
56 __PACKAGE__->meta->foreign_keys(
57   bin => {
58     class       => 'SL::DB::Bin',
59     key_columns => { bin_id => 'id' },
60   },
61
62   buchungsgruppen => {
63     class       => 'SL::DB::Buchungsgruppe',
64     key_columns => { buchungsgruppen_id => 'id' },
65   },
66
67   classification => {
68     class       => 'SL::DB::PartClassification',
69     key_columns => { classification_id => 'id' },
70   },
71
72   partsgroup => {
73     class       => 'SL::DB::PartsGroup',
74     key_columns => { partsgroup_id => 'id' },
75   },
76
77   payment => {
78     class       => 'SL::DB::PaymentTerm',
79     key_columns => { payment_id => 'id' },
80   },
81
82   price_factor => {
83     class       => 'SL::DB::PriceFactor',
84     key_columns => { price_factor_id => 'id' },
85   },
86
87   unit_obj => {
88     class       => 'SL::DB::Unit',
89     key_columns => { unit => 'name' },
90   },
91
92   warehouse => {
93     class       => 'SL::DB::Warehouse',
94     key_columns => { warehouse_id => 'id' },
95   },
96 );
97
98 1;
99 ;