Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/DeliveryOrder.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'delivery_orders', |
|
11 |
|
|
12 |
columns => [ |
|
13 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
|
14 |
donumber => { type => 'text', not_null => 1 }, |
|
15 |
ordnumber => { type => 'text' }, |
|
16 |
transdate => { type => 'date', default => 'now()' }, |
|
17 |
vendor_id => { type => 'integer' }, |
|
18 |
customer_id => { type => 'integer' }, |
|
19 |
reqdate => { type => 'date' }, |
|
20 |
shippingpoint => { type => 'text' }, |
|
21 |
notes => { type => 'text' }, |
|
22 |
intnotes => { type => 'text' }, |
|
23 |
employee_id => { type => 'integer' }, |
|
24 |
closed => { type => 'boolean', default => 'false' }, |
|
25 |
delivered => { type => 'boolean', default => 'false' }, |
|
26 |
cusordnumber => { type => 'text' }, |
|
27 |
oreqnumber => { type => 'text' }, |
|
28 |
department_id => { type => 'integer' }, |
|
29 |
shipvia => { type => 'text' }, |
|
30 |
cp_id => { type => 'integer' }, |
|
31 |
language_id => { type => 'integer' }, |
|
32 |
shipto_id => { type => 'integer' }, |
|
33 |
globalproject_id => { type => 'integer' }, |
|
34 |
salesman_id => { type => 'integer' }, |
|
35 |
transaction_description => { type => 'text' }, |
|
36 |
is_sales => { type => 'boolean' }, |
|
37 |
itime => { type => 'timestamp', default => 'now()' }, |
|
38 |
mtime => { type => 'timestamp' }, |
|
39 |
taxzone_id => { type => 'integer' }, |
|
40 |
taxincluded => { type => 'boolean' }, |
|
41 |
terms => { type => 'integer' }, |
|
42 |
currency_id => { type => 'integer', not_null => 1 }, |
|
43 |
], |
|
44 |
|
|
45 |
primary_key_columns => [ 'id' ], |
|
46 |
|
|
47 |
allow_inline_column_values => 1, |
|
48 |
|
|
49 |
foreign_keys => [ |
|
50 |
contact => { |
|
51 |
class => 'SL::DB::Contact', |
|
52 |
key_columns => { cp_id => 'cp_id' }, |
|
53 |
}, |
|
54 |
|
|
55 |
currency => { |
|
56 |
class => 'SL::DB::Currency', |
|
57 |
key_columns => { currency_id => 'id' }, |
|
58 |
}, |
|
59 |
|
|
60 |
customer => { |
|
61 |
class => 'SL::DB::Customer', |
|
62 |
key_columns => { customer_id => 'id' }, |
|
63 |
}, |
|
9 |
__PACKAGE__->meta->table('delivery_orders'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
|
13 |
donumber => { type => 'text', not_null => 1 }, |
|
14 |
ordnumber => { type => 'text' }, |
|
15 |
transdate => { type => 'date', default => 'now()' }, |
|
16 |
vendor_id => { type => 'integer' }, |
|
17 |
customer_id => { type => 'integer' }, |
|
18 |
reqdate => { type => 'date' }, |
|
19 |
shippingpoint => { type => 'text' }, |
|
20 |
notes => { type => 'text' }, |
|
21 |
intnotes => { type => 'text' }, |
|
22 |
employee_id => { type => 'integer' }, |
|
23 |
closed => { type => 'boolean', default => 'false' }, |
|
24 |
delivered => { type => 'boolean', default => 'false' }, |
|
25 |
cusordnumber => { type => 'text' }, |
|
26 |
oreqnumber => { type => 'text' }, |
|
27 |
department_id => { type => 'integer' }, |
|
28 |
shipvia => { type => 'text' }, |
|
29 |
cp_id => { type => 'integer' }, |
|
30 |
language_id => { type => 'integer' }, |
|
31 |
shipto_id => { type => 'integer' }, |
|
32 |
globalproject_id => { type => 'integer' }, |
|
33 |
salesman_id => { type => 'integer' }, |
|
34 |
transaction_description => { type => 'text' }, |
|
35 |
is_sales => { type => 'boolean' }, |
|
36 |
itime => { type => 'timestamp', default => 'now()' }, |
|
37 |
mtime => { type => 'timestamp' }, |
|
38 |
taxzone_id => { type => 'integer' }, |
|
39 |
taxincluded => { type => 'boolean' }, |
|
40 |
terms => { type => 'integer' }, |
|
41 |
currency_id => { type => 'integer', not_null => 1 }, |
|
42 |
); |
|
64 | 43 |
|
65 |
department => { |
|
66 |
class => 'SL::DB::Department', |
|
67 |
key_columns => { department_id => 'id' }, |
|
68 |
}, |
|
44 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
69 | 45 |
|
70 |
employee => { |
|
71 |
class => 'SL::DB::Employee', |
|
72 |
key_columns => { employee_id => 'id' }, |
|
73 |
}, |
|
46 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
74 | 47 |
|
75 |
globalproject => { |
|
76 |
class => 'SL::DB::Project', |
|
77 |
key_columns => { globalproject_id => 'id' }, |
|
78 |
}, |
|
48 |
__PACKAGE__->meta->foreign_keys( |
|
49 |
contact => { |
|
50 |
class => 'SL::DB::Contact', |
|
51 |
key_columns => { cp_id => 'cp_id' }, |
|
52 |
}, |
|
79 | 53 |
|
80 |
language => {
|
|
81 |
class => 'SL::DB::Language',
|
|
82 |
key_columns => { language_id => 'id' },
|
|
83 |
},
|
|
54 |
currency => {
|
|
55 |
class => 'SL::DB::Currency',
|
|
56 |
key_columns => { currency_id => 'id' },
|
|
57 |
}, |
|
84 | 58 |
|
85 |
salesman => {
|
|
86 |
class => 'SL::DB::Employee',
|
|
87 |
key_columns => { salesman_id => 'id' },
|
|
88 |
},
|
|
59 |
customer => {
|
|
60 |
class => 'SL::DB::Customer',
|
|
61 |
key_columns => { customer_id => 'id' },
|
|
62 |
}, |
|
89 | 63 |
|
90 |
shipto => {
|
|
91 |
class => 'SL::DB::Shipto',
|
|
92 |
key_columns => { shipto_id => 'shipto_id' },
|
|
93 |
},
|
|
64 |
globalproject => {
|
|
65 |
class => 'SL::DB::Project',
|
|
66 |
key_columns => { globalproject_id => 'id' },
|
|
67 |
}, |
|
94 | 68 |
|
95 |
vendor => { |
|
96 |
class => 'SL::DB::Vendor', |
|
97 |
key_columns => { vendor_id => 'id' }, |
|
98 |
}, |
|
99 |
], |
|
69 |
vendor => { |
|
70 |
class => 'SL::DB::Vendor', |
|
71 |
key_columns => { vendor_id => 'id' }, |
|
72 |
}, |
|
100 | 73 |
); |
101 | 74 |
|
75 |
# __PACKAGE__->meta->initialize; |
|
76 |
|
|
102 | 77 |
1; |
103 | 78 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert