Bug 12558: DBIx::Class schema update 07/2014
[koha.git] / Koha / Schema / Result / Aqorder.pm
blobb47a5692e1ce93849f5225c5e3f2b13b3eed8afe
1 use utf8;
2 package Koha::Schema::Result::Aqorder;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Aqorder
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<aqorders>
20 =cut
22 __PACKAGE__->table("aqorders");
24 =head1 ACCESSORS
26 =head2 ordernumber
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 biblionumber
34 data_type: 'integer'
35 is_foreign_key: 1
36 is_nullable: 1
38 =head2 entrydate
40 data_type: 'date'
41 datetime_undef_if_invalid: 1
42 is_nullable: 1
44 =head2 quantity
46 data_type: 'smallint'
47 is_nullable: 1
49 =head2 currency
51 data_type: 'varchar'
52 is_nullable: 1
53 size: 3
55 =head2 listprice
57 data_type: 'decimal'
58 is_nullable: 1
59 size: [28,6]
61 =head2 totalamount
63 data_type: 'decimal'
64 is_nullable: 1
65 size: [28,6]
67 =head2 datereceived
69 data_type: 'date'
70 datetime_undef_if_invalid: 1
71 is_nullable: 1
73 =head2 invoiceid
75 data_type: 'integer'
76 is_foreign_key: 1
77 is_nullable: 1
79 =head2 freight
81 data_type: 'decimal'
82 is_nullable: 1
83 size: [28,6]
85 =head2 unitprice
87 data_type: 'decimal'
88 is_nullable: 1
89 size: [28,6]
91 =head2 quantityreceived
93 data_type: 'smallint'
94 default_value: 0
95 is_nullable: 0
97 =head2 cancelledby
99 data_type: 'varchar'
100 is_nullable: 1
101 size: 10
103 =head2 datecancellationprinted
105 data_type: 'date'
106 datetime_undef_if_invalid: 1
107 is_nullable: 1
109 =head2 order_internalnote
111 data_type: 'mediumtext'
112 is_nullable: 1
114 =head2 order_vendornote
116 data_type: 'mediumtext'
117 is_nullable: 1
119 =head2 supplierreference
121 data_type: 'mediumtext'
122 is_nullable: 1
124 =head2 purchaseordernumber
126 data_type: 'mediumtext'
127 is_nullable: 1
129 =head2 basketno
131 data_type: 'integer'
132 is_foreign_key: 1
133 is_nullable: 1
135 =head2 timestamp
137 data_type: 'timestamp'
138 datetime_undef_if_invalid: 1
139 default_value: current_timestamp
140 is_nullable: 0
142 =head2 rrp
144 data_type: 'decimal'
145 is_nullable: 1
146 size: [13,2]
148 =head2 ecost
150 data_type: 'decimal'
151 is_nullable: 1
152 size: [13,2]
154 =head2 gstrate
156 data_type: 'decimal'
157 is_nullable: 1
158 size: [6,4]
160 =head2 discount
162 data_type: 'float'
163 is_nullable: 1
164 size: [6,4]
166 =head2 budget_id
168 data_type: 'integer'
169 is_nullable: 0
171 =head2 budgetgroup_id
173 data_type: 'integer'
174 is_nullable: 0
176 =head2 budgetdate
178 data_type: 'date'
179 datetime_undef_if_invalid: 1
180 is_nullable: 1
182 =head2 sort1
184 data_type: 'varchar'
185 is_nullable: 1
186 size: 80
188 =head2 sort2
190 data_type: 'varchar'
191 is_nullable: 1
192 size: 80
194 =head2 sort1_authcat
196 data_type: 'varchar'
197 is_nullable: 1
198 size: 10
200 =head2 sort2_authcat
202 data_type: 'varchar'
203 is_nullable: 1
204 size: 10
206 =head2 uncertainprice
208 data_type: 'tinyint'
209 is_nullable: 1
211 =head2 claims_count
213 data_type: 'integer'
214 default_value: 0
215 is_nullable: 1
217 =head2 claimed_date
219 data_type: 'date'
220 datetime_undef_if_invalid: 1
221 is_nullable: 1
223 =head2 subscriptionid
225 data_type: 'integer'
226 is_foreign_key: 1
227 is_nullable: 1
229 =head2 parent_ordernumber
231 data_type: 'integer'
232 is_nullable: 1
234 =head2 orderstatus
236 data_type: 'varchar'
237 default_value: 'new'
238 is_nullable: 1
239 size: 16
241 =cut
243 __PACKAGE__->add_columns(
244 "ordernumber",
245 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
246 "biblionumber",
247 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
248 "entrydate",
249 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
250 "quantity",
251 { data_type => "smallint", is_nullable => 1 },
252 "currency",
253 { data_type => "varchar", is_nullable => 1, size => 3 },
254 "listprice",
255 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
256 "totalamount",
257 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
258 "datereceived",
259 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
260 "invoiceid",
261 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
262 "freight",
263 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
264 "unitprice",
265 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
266 "quantityreceived",
267 { data_type => "smallint", default_value => 0, is_nullable => 0 },
268 "cancelledby",
269 { data_type => "varchar", is_nullable => 1, size => 10 },
270 "datecancellationprinted",
271 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
272 "order_internalnote",
273 { data_type => "mediumtext", is_nullable => 1 },
274 "order_vendornote",
275 { data_type => "mediumtext", is_nullable => 1 },
276 "supplierreference",
277 { data_type => "mediumtext", is_nullable => 1 },
278 "purchaseordernumber",
279 { data_type => "mediumtext", is_nullable => 1 },
280 "basketno",
281 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
282 "timestamp",
284 data_type => "timestamp",
285 datetime_undef_if_invalid => 1,
286 default_value => \"current_timestamp",
287 is_nullable => 0,
289 "rrp",
290 { data_type => "decimal", is_nullable => 1, size => [13, 2] },
291 "ecost",
292 { data_type => "decimal", is_nullable => 1, size => [13, 2] },
293 "gstrate",
294 { data_type => "decimal", is_nullable => 1, size => [6, 4] },
295 "discount",
296 { data_type => "float", is_nullable => 1, size => [6, 4] },
297 "budget_id",
298 { data_type => "integer", is_nullable => 0 },
299 "budgetgroup_id",
300 { data_type => "integer", is_nullable => 0 },
301 "budgetdate",
302 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
303 "sort1",
304 { data_type => "varchar", is_nullable => 1, size => 80 },
305 "sort2",
306 { data_type => "varchar", is_nullable => 1, size => 80 },
307 "sort1_authcat",
308 { data_type => "varchar", is_nullable => 1, size => 10 },
309 "sort2_authcat",
310 { data_type => "varchar", is_nullable => 1, size => 10 },
311 "uncertainprice",
312 { data_type => "tinyint", is_nullable => 1 },
313 "claims_count",
314 { data_type => "integer", default_value => 0, is_nullable => 1 },
315 "claimed_date",
316 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
317 "subscriptionid",
318 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
319 "parent_ordernumber",
320 { data_type => "integer", is_nullable => 1 },
321 "orderstatus",
323 data_type => "varchar",
324 default_value => "new",
325 is_nullable => 1,
326 size => 16,
330 =head1 PRIMARY KEY
332 =over 4
334 =item * L</ordernumber>
336 =back
338 =cut
340 __PACKAGE__->set_primary_key("ordernumber");
342 =head1 RELATIONS
344 =head2 aqorders_items
346 Type: has_many
348 Related object: L<Koha::Schema::Result::AqordersItem>
350 =cut
352 __PACKAGE__->has_many(
353 "aqorders_items",
354 "Koha::Schema::Result::AqordersItem",
355 { "foreign.ordernumber" => "self.ordernumber" },
356 { cascade_copy => 0, cascade_delete => 0 },
359 =head2 aqorders_transfers_ordernumber_from
361 Type: might_have
363 Related object: L<Koha::Schema::Result::AqordersTransfer>
365 =cut
367 __PACKAGE__->might_have(
368 "aqorders_transfers_ordernumber_from",
369 "Koha::Schema::Result::AqordersTransfer",
370 { "foreign.ordernumber_from" => "self.ordernumber" },
371 { cascade_copy => 0, cascade_delete => 0 },
374 =head2 aqorders_transfers_ordernumber_to
376 Type: might_have
378 Related object: L<Koha::Schema::Result::AqordersTransfer>
380 =cut
382 __PACKAGE__->might_have(
383 "aqorders_transfers_ordernumber_to",
384 "Koha::Schema::Result::AqordersTransfer",
385 { "foreign.ordernumber_to" => "self.ordernumber" },
386 { cascade_copy => 0, cascade_delete => 0 },
389 =head2 basketno
391 Type: belongs_to
393 Related object: L<Koha::Schema::Result::Aqbasket>
395 =cut
397 __PACKAGE__->belongs_to(
398 "basketno",
399 "Koha::Schema::Result::Aqbasket",
400 { basketno => "basketno" },
402 is_deferrable => 1,
403 join_type => "LEFT",
404 on_delete => "CASCADE",
405 on_update => "CASCADE",
409 =head2 biblionumber
411 Type: belongs_to
413 Related object: L<Koha::Schema::Result::Biblio>
415 =cut
417 __PACKAGE__->belongs_to(
418 "biblionumber",
419 "Koha::Schema::Result::Biblio",
420 { biblionumber => "biblionumber" },
422 is_deferrable => 1,
423 join_type => "LEFT",
424 on_delete => "SET NULL",
425 on_update => "CASCADE",
429 =head2 invoiceid
431 Type: belongs_to
433 Related object: L<Koha::Schema::Result::Aqinvoice>
435 =cut
437 __PACKAGE__->belongs_to(
438 "invoiceid",
439 "Koha::Schema::Result::Aqinvoice",
440 { invoiceid => "invoiceid" },
442 is_deferrable => 1,
443 join_type => "LEFT",
444 on_delete => "SET NULL",
445 on_update => "CASCADE",
449 =head2 subscriptionid
451 Type: belongs_to
453 Related object: L<Koha::Schema::Result::Subscription>
455 =cut
457 __PACKAGE__->belongs_to(
458 "subscriptionid",
459 "Koha::Schema::Result::Subscription",
460 { subscriptionid => "subscriptionid" },
462 is_deferrable => 1,
463 join_type => "LEFT",
464 on_delete => "CASCADE",
465 on_update => "CASCADE",
470 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55
471 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u5KHnXS5hMmqpqufIEkPig
474 # You can replace this text with custom content, and it will be preserved on regeneration