1 # This file has been auto-generated. Do not modify it; it will be overwritten
2 # by rose_auto_create_model.pl automatically.
7 use parent qw(SL::DB::Object);
9 __PACKAGE__->meta->table('parts');
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 },
49 __PACKAGE__->meta->primary_key_columns([ 'id' ]);
51 __PACKAGE__->meta->unique_keys([ 'partnumber' ]);
53 __PACKAGE__->meta->allow_inline_column_values(1);
55 __PACKAGE__->meta->foreign_keys(
57 class => 'SL::DB::Bin',
58 key_columns => { bin_id => 'id' },
62 class => 'SL::DB::Buchungsgruppe',
63 key_columns => { buchungsgruppen_id => 'id' },
67 class => 'SL::DB::PartsGroup',
68 key_columns => { partsgroup_id => 'id' },
72 class => 'SL::DB::PaymentTerm',
73 key_columns => { payment_id => 'id' },
77 class => 'SL::DB::PriceFactor',
78 key_columns => { price_factor_id => 'id' },
82 class => 'SL::DB::Unit',
83 key_columns => { unit => 'name' },
87 class => 'SL::DB::Warehouse',
88 key_columns => { warehouse_id => 'id' },