Bug 12601: (RM followup) DBIx updates
[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 datecancellationprinted
98
99   data_type: 'date'
100   datetime_undef_if_invalid: 1
101   is_nullable: 1
102
103 =head2 cancellationreason
104
105   data_type: 'text'
106   is_nullable: 1
107
108 =head2 order_internalnote
109
110   data_type: 'mediumtext'
111   is_nullable: 1
112
113 =head2 order_vendornote
114
115   data_type: 'mediumtext'
116   is_nullable: 1
117
118 =head2 supplierreference
119
120   data_type: 'mediumtext'
121   is_nullable: 1
122
123 =head2 purchaseordernumber
124
125   data_type: 'mediumtext'
126   is_nullable: 1
127
128 =head2 basketno
129
130   data_type: 'integer'
131   is_foreign_key: 1
132   is_nullable: 1
133
134 =head2 timestamp
135
136   data_type: 'timestamp'
137   datetime_undef_if_invalid: 1
138   default_value: current_timestamp
139   is_nullable: 0
140
141 =head2 rrp
142
143   data_type: 'decimal'
144   is_nullable: 1
145   size: [13,2]
146
147 =head2 ecost
148
149   data_type: 'decimal'
150   is_nullable: 1
151   size: [13,2]
152
153 =head2 gstrate
154
155   data_type: 'decimal'
156   is_nullable: 1
157   size: [6,4]
158
159 =head2 discount
160
161   data_type: 'float'
162   is_nullable: 1
163   size: [6,4]
164
165 =head2 budget_id
166
167   data_type: 'integer'
168   is_foreign_key: 1
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   "datecancellationprinted",
269   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
270   "cancellationreason",
271   { data_type => "text", 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_foreign_key => 1, 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     => "SET NULL",
425     on_update     => "CASCADE",
426   },
427 );
428
429 =head2 budget
430
431 Type: belongs_to
432
433 Related object: L<Koha::Schema::Result::Aqbudget>
434
435 =cut
436
437 __PACKAGE__->belongs_to(
438   "budget",
439   "Koha::Schema::Result::Aqbudget",
440   { budget_id => "budget_id" },
441   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
442 );
443
444 =head2 invoiceid
445
446 Type: belongs_to
447
448 Related object: L<Koha::Schema::Result::Aqinvoice>
449
450 =cut
451
452 __PACKAGE__->belongs_to(
453   "invoiceid",
454   "Koha::Schema::Result::Aqinvoice",
455   { invoiceid => "invoiceid" },
456   {
457     is_deferrable => 1,
458     join_type     => "LEFT",
459     on_delete     => "SET NULL",
460     on_update     => "CASCADE",
461   },
462 );
463
464 =head2 subscriptionid
465
466 Type: belongs_to
467
468 Related object: L<Koha::Schema::Result::Subscription>
469
470 =cut
471
472 __PACKAGE__->belongs_to(
473   "subscriptionid",
474   "Koha::Schema::Result::Subscription",
475   { subscriptionid => "subscriptionid" },
476   {
477     is_deferrable => 1,
478     join_type     => "LEFT",
479     on_delete     => "CASCADE",
480     on_update     => "CASCADE",
481   },
482 );
483
484
485 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-02-05 15:20:11
486 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MfXZ8f2Md6X+C1fVU8TtOg
487
488
489 # You can replace this text with custom content, and it will be preserved on regeneration
490 1;