Bug 11351 - Add support for SIP2 media types
[koha.git] / Koha / Schema / Result / Aqorder.pm
1 use utf8;
2 package Koha::Schema::Result::Aqorder;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Koha::Schema::Result::Aqorder
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<aqorders>
19
20 =cut
21
22 __PACKAGE__->table("aqorders");
23
24 =head1 ACCESSORS
25
26 =head2 ordernumber
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 biblionumber
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 1
37
38 =head2 entrydate
39
40   data_type: 'date'
41   datetime_undef_if_invalid: 1
42   is_nullable: 1
43
44 =head2 quantity
45
46   data_type: 'smallint'
47   is_nullable: 1
48
49 =head2 currency
50
51   data_type: 'varchar'
52   is_nullable: 1
53   size: 3
54
55 =head2 listprice
56
57   data_type: 'decimal'
58   is_nullable: 1
59   size: [28,6]
60
61 =head2 totalamount
62
63   data_type: 'decimal'
64   is_nullable: 1
65   size: [28,6]
66
67 =head2 datereceived
68
69   data_type: 'date'
70   datetime_undef_if_invalid: 1
71   is_nullable: 1
72
73 =head2 invoiceid
74
75   data_type: 'integer'
76   is_foreign_key: 1
77   is_nullable: 1
78
79 =head2 freight
80
81   data_type: 'decimal'
82   is_nullable: 1
83   size: [28,6]
84
85 =head2 unitprice
86
87   data_type: 'decimal'
88   is_nullable: 1
89   size: [28,6]
90
91 =head2 quantityreceived
92
93   data_type: 'smallint'
94   default_value: 0
95   is_nullable: 0
96
97 =head2 cancelledby
98
99   data_type: 'varchar'
100   is_nullable: 1
101   size: 10
102
103 =head2 datecancellationprinted
104
105   data_type: 'date'
106   datetime_undef_if_invalid: 1
107   is_nullable: 1
108
109 =head2 order_internalnote
110
111   data_type: 'mediumtext'
112   is_nullable: 1
113
114 =head2 order_vendornote
115
116   data_type: 'mediumtext'
117   is_nullable: 1
118
119 =head2 supplierreference
120
121   data_type: 'mediumtext'
122   is_nullable: 1
123
124 =head2 purchaseordernumber
125
126   data_type: 'mediumtext'
127   is_nullable: 1
128
129 =head2 basketno
130
131   data_type: 'integer'
132   is_foreign_key: 1
133   is_nullable: 1
134
135 =head2 timestamp
136
137   data_type: 'timestamp'
138   datetime_undef_if_invalid: 1
139   default_value: current_timestamp
140   is_nullable: 0
141
142 =head2 rrp
143
144   data_type: 'decimal'
145   is_nullable: 1
146   size: [13,2]
147
148 =head2 ecost
149
150   data_type: 'decimal'
151   is_nullable: 1
152   size: [13,2]
153
154 =head2 gstrate
155
156   data_type: 'decimal'
157   is_nullable: 1
158   size: [6,4]
159
160 =head2 discount
161
162   data_type: 'float'
163   is_nullable: 1
164   size: [6,4]
165
166 =head2 budget_id
167
168   data_type: 'integer'
169   is_nullable: 0
170
171 =head2 budgetgroup_id
172
173   data_type: 'integer'
174   is_nullable: 0
175
176 =head2 budgetdate
177
178   data_type: 'date'
179   datetime_undef_if_invalid: 1
180   is_nullable: 1
181
182 =head2 sort1
183
184   data_type: 'varchar'
185   is_nullable: 1
186   size: 80
187
188 =head2 sort2
189
190   data_type: 'varchar'
191   is_nullable: 1
192   size: 80
193
194 =head2 sort1_authcat
195
196   data_type: 'varchar'
197   is_nullable: 1
198   size: 10
199
200 =head2 sort2_authcat
201
202   data_type: 'varchar'
203   is_nullable: 1
204   size: 10
205
206 =head2 uncertainprice
207
208   data_type: 'tinyint'
209   is_nullable: 1
210
211 =head2 claims_count
212
213   data_type: 'integer'
214   default_value: 0
215   is_nullable: 1
216
217 =head2 claimed_date
218
219   data_type: 'date'
220   datetime_undef_if_invalid: 1
221   is_nullable: 1
222
223 =head2 subscriptionid
224
225   data_type: 'integer'
226   is_foreign_key: 1
227   is_nullable: 1
228
229 =head2 parent_ordernumber
230
231   data_type: 'integer'
232   is_nullable: 1
233
234 =head2 orderstatus
235
236   data_type: 'varchar'
237   default_value: 'new'
238   is_nullable: 1
239   size: 16
240
241 =cut
242
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",
283   {
284     data_type => "timestamp",
285     datetime_undef_if_invalid => 1,
286     default_value => \"current_timestamp",
287     is_nullable => 0,
288   },
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",
322   {
323     data_type => "varchar",
324     default_value => "new",
325     is_nullable => 1,
326     size => 16,
327   },
328 );
329
330 =head1 PRIMARY KEY
331
332 =over 4
333
334 =item * L</ordernumber>
335
336 =back
337
338 =cut
339
340 __PACKAGE__->set_primary_key("ordernumber");
341
342 =head1 RELATIONS
343
344 =head2 aqorders_items
345
346 Type: has_many
347
348 Related object: L<Koha::Schema::Result::AqordersItem>
349
350 =cut
351
352 __PACKAGE__->has_many(
353   "aqorders_items",
354   "Koha::Schema::Result::AqordersItem",
355   { "foreign.ordernumber" => "self.ordernumber" },
356   { cascade_copy => 0, cascade_delete => 0 },
357 );
358
359 =head2 aqorders_transfers_ordernumber_from
360
361 Type: might_have
362
363 Related object: L<Koha::Schema::Result::AqordersTransfer>
364
365 =cut
366
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 },
372 );
373
374 =head2 aqorders_transfers_ordernumber_to
375
376 Type: might_have
377
378 Related object: L<Koha::Schema::Result::AqordersTransfer>
379
380 =cut
381
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 },
387 );
388
389 =head2 basketno
390
391 Type: belongs_to
392
393 Related object: L<Koha::Schema::Result::Aqbasket>
394
395 =cut
396
397 __PACKAGE__->belongs_to(
398   "basketno",
399   "Koha::Schema::Result::Aqbasket",
400   { basketno => "basketno" },
401   {
402     is_deferrable => 1,
403     join_type     => "LEFT",
404     on_delete     => "CASCADE",
405     on_update     => "CASCADE",
406   },
407 );
408
409 =head2 biblionumber
410
411 Type: belongs_to
412
413 Related object: L<Koha::Schema::Result::Biblio>
414
415 =cut
416
417 __PACKAGE__->belongs_to(
418   "biblionumber",
419   "Koha::Schema::Result::Biblio",
420   { biblionumber => "biblionumber" },
421   {
422     is_deferrable => 1,
423     join_type     => "LEFT",
424     on_delete     => "CASCADE",
425     on_update     => "CASCADE",
426   },
427 );
428
429 =head2 invoiceid
430
431 Type: belongs_to
432
433 Related object: L<Koha::Schema::Result::Aqinvoice>
434
435 =cut
436
437 __PACKAGE__->belongs_to(
438   "invoiceid",
439   "Koha::Schema::Result::Aqinvoice",
440   { invoiceid => "invoiceid" },
441   {
442     is_deferrable => 1,
443     join_type     => "LEFT",
444     on_delete     => "CASCADE",
445     on_update     => "CASCADE",
446   },
447 );
448
449 =head2 subscriptionid
450
451 Type: belongs_to
452
453 Related object: L<Koha::Schema::Result::Subscription>
454
455 =cut
456
457 __PACKAGE__->belongs_to(
458   "subscriptionid",
459   "Koha::Schema::Result::Subscription",
460   { subscriptionid => "subscriptionid" },
461   {
462     is_deferrable => 1,
463     join_type     => "LEFT",
464     on_delete     => "CASCADE",
465     on_update     => "CASCADE",
466   },
467 );
468
469
470 # Created by DBIx::Class::Schema::Loader v0.07025 @ 2014-04-19 15:25:43
471 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XGQHKw2/pml/kFe89vbvXw
472
473
474 # You can replace this text with custom content, and it will be preserved on regeneration
475 1;