Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/DeliveryOrderItem.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'delivery_order_items', |
|
11 |
|
|
12 |
columns => [ |
|
13 |
id => { type => 'integer', not_null => 1, sequence => 'delivery_order_items_id' }, |
|
14 |
delivery_order_id => { type => 'integer', not_null => 1 }, |
|
15 |
parts_id => { type => 'integer', not_null => 1 }, |
|
16 |
description => { type => 'text' }, |
|
17 |
qty => { type => 'numeric', precision => 5, scale => 25 }, |
|
18 |
sellprice => { type => 'numeric', precision => 5, scale => 15 }, |
|
19 |
discount => { type => 'float', precision => 4 }, |
|
20 |
project_id => { type => 'integer' }, |
|
21 |
reqdate => { type => 'date' }, |
|
22 |
serialnumber => { type => 'text' }, |
|
23 |
ordnumber => { type => 'text' }, |
|
24 |
transdate => { type => 'text' }, |
|
25 |
cusordnumber => { type => 'text' }, |
|
26 |
unit => { type => 'varchar', length => 20 }, |
|
27 |
base_qty => { type => 'float', precision => 4 }, |
|
28 |
longdescription => { type => 'text' }, |
|
29 |
lastcost => { type => 'numeric', precision => 5, scale => 15 }, |
|
30 |
price_factor_id => { type => 'integer' }, |
|
31 |
price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, |
|
32 |
marge_price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, |
|
33 |
itime => { type => 'timestamp', default => 'now()' }, |
|
34 |
mtime => { type => 'timestamp' }, |
|
35 |
pricegroup_id => { type => 'integer' }, |
|
36 |
], |
|
37 |
|
|
38 |
primary_key_columns => [ 'id' ], |
|
39 |
|
|
40 |
allow_inline_column_values => 1, |
|
9 |
__PACKAGE__->meta->table('delivery_order_items'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
id => { type => 'integer', not_null => 1, sequence => 'delivery_order_items_id' }, |
|
13 |
delivery_order_id => { type => 'integer', not_null => 1 }, |
|
14 |
parts_id => { type => 'integer', not_null => 1 }, |
|
15 |
description => { type => 'text' }, |
|
16 |
qty => { type => 'numeric', precision => 5, scale => 25 }, |
|
17 |
sellprice => { type => 'numeric', precision => 5, scale => 15 }, |
|
18 |
discount => { type => 'float', precision => 4 }, |
|
19 |
project_id => { type => 'integer' }, |
|
20 |
reqdate => { type => 'date' }, |
|
21 |
serialnumber => { type => 'text' }, |
|
22 |
ordnumber => { type => 'text' }, |
|
23 |
transdate => { type => 'text' }, |
|
24 |
cusordnumber => { type => 'text' }, |
|
25 |
unit => { type => 'varchar', length => 20 }, |
|
26 |
base_qty => { type => 'float', precision => 4 }, |
|
27 |
longdescription => { type => 'text' }, |
|
28 |
lastcost => { type => 'numeric', precision => 5, scale => 15 }, |
|
29 |
price_factor_id => { type => 'integer' }, |
|
30 |
price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, |
|
31 |
marge_price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, |
|
32 |
itime => { type => 'timestamp', default => 'now()' }, |
|
33 |
mtime => { type => 'timestamp' }, |
|
34 |
pricegroup_id => { type => 'integer' }, |
|
35 |
); |
|
41 | 36 |
|
42 |
foreign_keys => [ |
|
43 |
delivery_order => { |
|
44 |
class => 'SL::DB::DeliveryOrder', |
|
45 |
key_columns => { delivery_order_id => 'id' }, |
|
46 |
}, |
|
37 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
47 | 38 |
|
48 |
part => { |
|
49 |
class => 'SL::DB::Part', |
|
50 |
key_columns => { parts_id => 'id' }, |
|
51 |
}, |
|
39 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
52 | 40 |
|
53 |
price_factor_obj => { |
|
54 |
class => 'SL::DB::PriceFactor', |
|
55 |
key_columns => { price_factor_id => 'id' }, |
|
56 |
}, |
|
41 |
__PACKAGE__->meta->foreign_keys( |
|
42 |
delivery_order => { |
|
43 |
class => 'SL::DB::DeliveryOrder', |
|
44 |
key_columns => { delivery_order_id => 'id' }, |
|
45 |
}, |
|
57 | 46 |
|
58 |
pricegroup => {
|
|
59 |
class => 'SL::DB::Pricegroup',
|
|
60 |
key_columns => { pricegroup_id => 'id' },
|
|
61 |
},
|
|
47 |
parts => {
|
|
48 |
class => 'SL::DB::Part',
|
|
49 |
key_columns => { parts_id => 'id' },
|
|
50 |
}, |
|
62 | 51 |
|
63 |
project => { |
|
64 |
class => 'SL::DB::Project', |
|
65 |
key_columns => { project_id => 'id' }, |
|
66 |
}, |
|
67 |
], |
|
52 |
project => { |
|
53 |
class => 'SL::DB::Project', |
|
54 |
key_columns => { project_id => 'id' }, |
|
55 |
}, |
|
68 | 56 |
); |
69 | 57 |
|
58 |
# __PACKAGE__->meta->initialize; |
|
59 |
|
|
70 | 60 |
1; |
71 | 61 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert