Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/Invoice.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'ar', |
|
11 |
|
|
12 |
columns => [ |
|
13 |
id => { type => 'integer', not_null => 1, sequence => 'glid' }, |
|
14 |
invnumber => { type => 'text', not_null => 1 }, |
|
15 |
transdate => { type => 'date', default => 'now' }, |
|
16 |
gldate => { type => 'date', default => 'now' }, |
|
17 |
customer_id => { type => 'integer' }, |
|
18 |
taxincluded => { type => 'boolean' }, |
|
19 |
amount => { type => 'numeric', precision => 5, scale => 15 }, |
|
20 |
netamount => { type => 'numeric', precision => 5, scale => 15 }, |
|
21 |
paid => { type => 'numeric', precision => 5, scale => 15 }, |
|
22 |
datepaid => { type => 'date' }, |
|
23 |
duedate => { type => 'date' }, |
|
24 |
deliverydate => { type => 'date' }, |
|
25 |
invoice => { type => 'boolean', default => 'false' }, |
|
26 |
shippingpoint => { type => 'text' }, |
|
27 |
terms => { type => 'integer', default => '0' }, |
|
28 |
notes => { type => 'text' }, |
|
29 |
ordnumber => { type => 'text' }, |
|
30 |
employee_id => { type => 'integer' }, |
|
31 |
quonumber => { type => 'text' }, |
|
32 |
cusordnumber => { type => 'text' }, |
|
33 |
intnotes => { type => 'text' }, |
|
34 |
department_id => { type => 'integer' }, |
|
35 |
shipvia => { type => 'text' }, |
|
36 |
itime => { type => 'timestamp', default => 'now()' }, |
|
37 |
mtime => { type => 'timestamp' }, |
|
38 |
cp_id => { type => 'integer' }, |
|
39 |
language_id => { type => 'integer' }, |
|
40 |
payment_id => { type => 'integer' }, |
|
41 |
delivery_customer_id => { type => 'integer' }, |
|
42 |
delivery_vendor_id => { type => 'integer' }, |
|
43 |
storno => { type => 'boolean', default => 'false' }, |
|
44 |
taxzone_id => { type => 'integer' }, |
|
45 |
shipto_id => { type => 'integer' }, |
|
46 |
type => { type => 'text' }, |
|
47 |
dunning_config_id => { type => 'integer' }, |
|
48 |
orddate => { type => 'date' }, |
|
49 |
quodate => { type => 'date' }, |
|
50 |
globalproject_id => { type => 'integer' }, |
|
51 |
salesman_id => { type => 'integer' }, |
|
52 |
transaction_description => { type => 'text' }, |
|
53 |
storno_id => { type => 'integer' }, |
|
54 |
marge_total => { type => 'numeric', precision => 5, scale => 15 }, |
|
55 |
marge_percent => { type => 'numeric', precision => 5, scale => 15 }, |
|
56 |
donumber => { type => 'text' }, |
|
57 |
invnumber_for_credit_note => { type => 'text' }, |
|
58 |
direct_debit => { type => 'boolean', default => 'false' }, |
|
59 |
currency_id => { type => 'integer', not_null => 1 }, |
|
60 |
], |
|
61 |
|
|
62 |
primary_key_columns => [ 'id' ], |
|
63 |
|
|
64 |
allow_inline_column_values => 1, |
|
65 |
|
|
66 |
foreign_keys => [ |
|
67 |
contact => { |
|
68 |
class => 'SL::DB::Contact', |
|
69 |
key_columns => { cp_id => 'cp_id' }, |
|
70 |
}, |
|
71 |
|
|
72 |
currency => { |
|
73 |
class => 'SL::DB::Currency', |
|
74 |
key_columns => { currency_id => 'id' }, |
|
75 |
}, |
|
76 |
|
|
77 |
customer => { |
|
78 |
class => 'SL::DB::Customer', |
|
79 |
key_columns => { customer_id => 'id' }, |
|
80 |
}, |
|
81 |
|
|
82 |
department => { |
|
83 |
class => 'SL::DB::Department', |
|
84 |
key_columns => { department_id => 'id' }, |
|
85 |
}, |
|
86 |
|
|
87 |
dunning_config => { |
|
88 |
class => 'SL::DB::DunningConfig', |
|
89 |
key_columns => { dunning_config_id => 'id' }, |
|
90 |
}, |
|
91 |
|
|
92 |
employee => { |
|
93 |
class => 'SL::DB::Employee', |
|
94 |
key_columns => { employee_id => 'id' }, |
|
95 |
}, |
|
9 |
__PACKAGE__->meta->table('ar'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
id => { type => 'integer', not_null => 1, sequence => 'glid' }, |
|
13 |
invnumber => { type => 'text', not_null => 1 }, |
|
14 |
transdate => { type => 'date', default => 'now' }, |
|
15 |
gldate => { type => 'date', default => 'now' }, |
|
16 |
customer_id => { type => 'integer' }, |
|
17 |
taxincluded => { type => 'boolean' }, |
|
18 |
amount => { type => 'numeric', precision => 5, scale => 15 }, |
|
19 |
netamount => { type => 'numeric', precision => 5, scale => 15 }, |
|
20 |
paid => { type => 'numeric', precision => 5, scale => 15 }, |
|
21 |
datepaid => { type => 'date' }, |
|
22 |
duedate => { type => 'date' }, |
|
23 |
deliverydate => { type => 'date' }, |
|
24 |
invoice => { type => 'boolean', default => 'false' }, |
|
25 |
shippingpoint => { type => 'text' }, |
|
26 |
terms => { type => 'integer', default => '0' }, |
|
27 |
notes => { type => 'text' }, |
|
28 |
ordnumber => { type => 'text' }, |
|
29 |
employee_id => { type => 'integer' }, |
|
30 |
quonumber => { type => 'text' }, |
|
31 |
cusordnumber => { type => 'text' }, |
|
32 |
intnotes => { type => 'text' }, |
|
33 |
department_id => { type => 'integer' }, |
|
34 |
shipvia => { type => 'text' }, |
|
35 |
itime => { type => 'timestamp', default => 'now()' }, |
|
36 |
mtime => { type => 'timestamp' }, |
|
37 |
cp_id => { type => 'integer' }, |
|
38 |
language_id => { type => 'integer' }, |
|
39 |
payment_id => { type => 'integer' }, |
|
40 |
delivery_customer_id => { type => 'integer' }, |
|
41 |
delivery_vendor_id => { type => 'integer' }, |
|
42 |
storno => { type => 'boolean', default => 'false' }, |
|
43 |
taxzone_id => { type => 'integer' }, |
|
44 |
shipto_id => { type => 'integer' }, |
|
45 |
type => { type => 'text' }, |
|
46 |
dunning_config_id => { type => 'integer' }, |
|
47 |
orddate => { type => 'date' }, |
|
48 |
quodate => { type => 'date' }, |
|
49 |
globalproject_id => { type => 'integer' }, |
|
50 |
salesman_id => { type => 'integer' }, |
|
51 |
transaction_description => { type => 'text' }, |
|
52 |
storno_id => { type => 'integer' }, |
|
53 |
marge_total => { type => 'numeric', precision => 5, scale => 15 }, |
|
54 |
marge_percent => { type => 'numeric', precision => 5, scale => 15 }, |
|
55 |
donumber => { type => 'text' }, |
|
56 |
invnumber_for_credit_note => { type => 'text' }, |
|
57 |
direct_debit => { type => 'boolean', default => 'false' }, |
|
58 |
currency_id => { type => 'integer', not_null => 1 }, |
|
59 |
); |
|
96 | 60 |
|
97 |
globalproject => { |
|
98 |
class => 'SL::DB::Project', |
|
99 |
key_columns => { globalproject_id => 'id' }, |
|
100 |
}, |
|
61 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
101 | 62 |
|
102 |
language => { |
|
103 |
class => 'SL::DB::Language', |
|
104 |
key_columns => { language_id => 'id' }, |
|
105 |
}, |
|
63 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
106 | 64 |
|
107 |
payment_terms => { |
|
108 |
class => 'SL::DB::PaymentTerm', |
|
109 |
key_columns => { payment_id => 'id' }, |
|
110 |
}, |
|
65 |
__PACKAGE__->meta->foreign_keys( |
|
66 |
contact => { |
|
67 |
class => 'SL::DB::Contact', |
|
68 |
key_columns => { cp_id => 'cp_id' }, |
|
69 |
}, |
|
111 | 70 |
|
112 |
salesman => {
|
|
113 |
class => 'SL::DB::Employee',
|
|
114 |
key_columns => { salesman_id => 'id' },
|
|
115 |
},
|
|
71 |
customer => {
|
|
72 |
class => 'SL::DB::Customer',
|
|
73 |
key_columns => { customer_id => 'id' },
|
|
74 |
}, |
|
116 | 75 |
|
117 |
shipto => {
|
|
118 |
class => 'SL::DB::Shipto',
|
|
119 |
key_columns => { shipto_id => 'shipto_id' },
|
|
120 |
},
|
|
76 |
globalproject => {
|
|
77 |
class => 'SL::DB::Project',
|
|
78 |
key_columns => { globalproject_id => 'id' },
|
|
79 |
}, |
|
121 | 80 |
|
122 |
storno_obj => { |
|
123 |
class => 'SL::DB::Invoice', |
|
124 |
key_columns => { storno_id => 'id' }, |
|
125 |
}, |
|
126 |
], |
|
81 |
storno_obj => { |
|
82 |
class => 'SL::DB::Invoice', |
|
83 |
key_columns => { storno_id => 'id' }, |
|
84 |
}, |
|
127 | 85 |
); |
128 | 86 |
|
87 |
# __PACKAGE__->meta->initialize; |
|
88 |
|
|
129 | 89 |
1; |
130 | 90 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert