Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/PaymentTerm.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'payment_terms', |
|
11 |
|
|
12 |
columns => [ |
|
13 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
|
14 |
description => { type => 'text' }, |
|
15 |
description_long => { type => 'text' }, |
|
16 |
terms_netto => { type => 'integer' }, |
|
17 |
terms_skonto => { type => 'integer' }, |
|
18 |
percent_skonto => { type => 'float', precision => 4 }, |
|
19 |
itime => { type => 'timestamp', default => 'now()' }, |
|
20 |
mtime => { type => 'timestamp' }, |
|
21 |
ranking => { type => 'integer' }, |
|
22 |
sortkey => { type => 'integer', not_null => 1 }, |
|
23 |
], |
|
24 |
|
|
25 |
primary_key_columns => [ 'id' ], |
|
26 |
|
|
27 |
allow_inline_column_values => 1, |
|
9 |
__PACKAGE__->meta->table('payment_terms'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
|
13 |
description => { type => 'text' }, |
|
14 |
description_long => { type => 'text' }, |
|
15 |
terms_netto => { type => 'integer' }, |
|
16 |
terms_skonto => { type => 'integer' }, |
|
17 |
percent_skonto => { type => 'float', precision => 4 }, |
|
18 |
itime => { type => 'timestamp', default => 'now()' }, |
|
19 |
mtime => { type => 'timestamp' }, |
|
20 |
ranking => { type => 'integer' }, |
|
21 |
sortkey => { type => 'integer', not_null => 1 }, |
|
22 |
); |
|
23 |
|
|
24 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
25 |
|
|
26 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
27 |
|
|
28 |
__PACKAGE__->meta->relationships( |
|
29 |
ap => { |
|
30 |
class => 'SL::DB::PurchaseInvoice', |
|
31 |
column_map => { id => 'payment_id' }, |
|
32 |
type => 'one to many', |
|
33 |
}, |
|
34 |
|
|
35 |
ar => { |
|
36 |
class => 'SL::DB::Invoice', |
|
37 |
column_map => { id => 'payment_id' }, |
|
38 |
type => 'one to many', |
|
39 |
}, |
|
40 |
|
|
41 |
customer => { |
|
42 |
class => 'SL::DB::Customer', |
|
43 |
column_map => { id => 'payment_id' }, |
|
44 |
type => 'one to many', |
|
45 |
}, |
|
46 |
|
|
47 |
oe => { |
|
48 |
class => 'SL::DB::Order', |
|
49 |
column_map => { id => 'payment_id' }, |
|
50 |
type => 'one to many', |
|
51 |
}, |
|
52 |
|
|
53 |
parts => { |
|
54 |
class => 'SL::DB::Part', |
|
55 |
column_map => { id => 'payment_id' }, |
|
56 |
type => 'one to many', |
|
57 |
}, |
|
28 | 58 |
); |
29 | 59 |
|
60 |
# __PACKAGE__->meta->initialize; |
|
61 |
|
|
30 | 62 |
1; |
31 | 63 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert