Bug 16344 - Update Schema
[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_foreign_key: 1
53   is_nullable: 1
54   size: 10
55
56 =head2 listprice
57
58   data_type: 'decimal'
59   is_nullable: 1
60   size: [28,6]
61
62 =head2 datereceived
63
64   data_type: 'date'
65   datetime_undef_if_invalid: 1
66   is_nullable: 1
67
68 =head2 invoiceid
69
70   data_type: 'integer'
71   is_foreign_key: 1
72   is_nullable: 1
73
74 =head2 freight
75
76   data_type: 'decimal'
77   is_nullable: 1
78   size: [28,6]
79
80 =head2 unitprice
81
82   data_type: 'decimal'
83   is_nullable: 1
84   size: [28,6]
85
86 =head2 unitprice_tax_excluded
87
88   data_type: 'decimal'
89   is_nullable: 1
90   size: [28,6]
91
92 =head2 unitprice_tax_included
93
94   data_type: 'decimal'
95   is_nullable: 1
96   size: [28,6]
97
98 =head2 quantityreceived
99
100   data_type: 'smallint'
101   default_value: 0
102   is_nullable: 0
103
104 =head2 datecancellationprinted
105
106   data_type: 'date'
107   datetime_undef_if_invalid: 1
108   is_nullable: 1
109
110 =head2 cancellationreason
111
112   data_type: 'text'
113   is_nullable: 1
114
115 =head2 order_internalnote
116
117   data_type: 'mediumtext'
118   is_nullable: 1
119
120 =head2 order_vendornote
121
122   data_type: 'mediumtext'
123   is_nullable: 1
124
125 =head2 purchaseordernumber
126
127   data_type: 'mediumtext'
128   is_nullable: 1
129
130 =head2 basketno
131
132   data_type: 'integer'
133   is_foreign_key: 1
134   is_nullable: 1
135
136 =head2 timestamp
137
138   data_type: 'timestamp'
139   datetime_undef_if_invalid: 1
140   default_value: current_timestamp
141   is_nullable: 0
142
143 =head2 rrp
144
145   data_type: 'decimal'
146   is_nullable: 1
147   size: [13,2]
148
149 =head2 rrp_tax_excluded
150
151   data_type: 'decimal'
152   is_nullable: 1
153   size: [28,6]
154
155 =head2 rrp_tax_included
156
157   data_type: 'decimal'
158   is_nullable: 1
159   size: [28,6]
160
161 =head2 ecost
162
163   data_type: 'decimal'
164   is_nullable: 1
165   size: [13,2]
166
167 =head2 ecost_tax_excluded
168
169   data_type: 'decimal'
170   is_nullable: 1
171   size: [28,6]
172
173 =head2 ecost_tax_included
174
175   data_type: 'decimal'
176   is_nullable: 1
177   size: [28,6]
178
179 =head2 tax_rate_bak
180
181   data_type: 'decimal'
182   is_nullable: 1
183   size: [6,4]
184
185 =head2 tax_rate_on_ordering
186
187   data_type: 'decimal'
188   is_nullable: 1
189   size: [6,4]
190
191 =head2 tax_rate_on_receiving
192
193   data_type: 'decimal'
194   is_nullable: 1
195   size: [6,4]
196
197 =head2 tax_value_bak
198
199   data_type: 'decimal'
200   is_nullable: 1
201   size: [28,6]
202
203 =head2 tax_value_on_ordering
204
205   data_type: 'decimal'
206   is_nullable: 1
207   size: [28,6]
208
209 =head2 tax_value_on_receiving
210
211   data_type: 'decimal'
212   is_nullable: 1
213   size: [28,6]
214
215 =head2 discount
216
217   data_type: 'float'
218   is_nullable: 1
219   size: [6,4]
220
221 =head2 budget_id
222
223   data_type: 'integer'
224   is_foreign_key: 1
225   is_nullable: 0
226
227 =head2 budgetdate
228
229   data_type: 'date'
230   datetime_undef_if_invalid: 1
231   is_nullable: 1
232
233 =head2 sort1
234
235   data_type: 'varchar'
236   is_nullable: 1
237   size: 80
238
239 =head2 sort2
240
241   data_type: 'varchar'
242   is_nullable: 1
243   size: 80
244
245 =head2 sort1_authcat
246
247   data_type: 'varchar'
248   is_nullable: 1
249   size: 10
250
251 =head2 sort2_authcat
252
253   data_type: 'varchar'
254   is_nullable: 1
255   size: 10
256
257 =head2 uncertainprice
258
259   data_type: 'tinyint'
260   is_nullable: 1
261
262 =head2 claims_count
263
264   data_type: 'integer'
265   default_value: 0
266   is_nullable: 1
267
268 =head2 claimed_date
269
270   data_type: 'date'
271   datetime_undef_if_invalid: 1
272   is_nullable: 1
273
274 =head2 subscriptionid
275
276   data_type: 'integer'
277   is_foreign_key: 1
278   is_nullable: 1
279
280 =head2 parent_ordernumber
281
282   data_type: 'integer'
283   is_nullable: 1
284
285 =head2 orderstatus
286
287   data_type: 'varchar'
288   default_value: 'new'
289   is_nullable: 1
290   size: 16
291
292 =head2 line_item_id
293
294   data_type: 'varchar'
295   is_nullable: 1
296   size: 35
297
298 =head2 suppliers_reference_number
299
300   data_type: 'varchar'
301   is_nullable: 1
302   size: 35
303
304 =head2 suppliers_reference_qualifier
305
306   data_type: 'varchar'
307   is_nullable: 1
308   size: 3
309
310 =head2 suppliers_report
311
312   data_type: 'text'
313   is_nullable: 1
314
315 =cut
316
317 __PACKAGE__->add_columns(
318   "ordernumber",
319   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
320   "biblionumber",
321   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
322   "entrydate",
323   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
324   "quantity",
325   { data_type => "smallint", is_nullable => 1 },
326   "currency",
327   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
328   "listprice",
329   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
330   "datereceived",
331   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
332   "invoiceid",
333   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
334   "freight",
335   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
336   "unitprice",
337   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
338   "unitprice_tax_excluded",
339   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
340   "unitprice_tax_included",
341   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
342   "quantityreceived",
343   { data_type => "smallint", default_value => 0, is_nullable => 0 },
344   "datecancellationprinted",
345   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
346   "cancellationreason",
347   { data_type => "text", is_nullable => 1 },
348   "order_internalnote",
349   { data_type => "mediumtext", is_nullable => 1 },
350   "order_vendornote",
351   { data_type => "mediumtext", is_nullable => 1 },
352   "purchaseordernumber",
353   { data_type => "mediumtext", is_nullable => 1 },
354   "basketno",
355   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
356   "timestamp",
357   {
358     data_type => "timestamp",
359     datetime_undef_if_invalid => 1,
360     default_value => \"current_timestamp",
361     is_nullable => 0,
362   },
363   "rrp",
364   { data_type => "decimal", is_nullable => 1, size => [13, 2] },
365   "rrp_tax_excluded",
366   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
367   "rrp_tax_included",
368   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
369   "ecost",
370   { data_type => "decimal", is_nullable => 1, size => [13, 2] },
371   "ecost_tax_excluded",
372   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
373   "ecost_tax_included",
374   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
375   "tax_rate_bak",
376   { data_type => "decimal", is_nullable => 1, size => [6, 4] },
377   "tax_rate_on_ordering",
378   { data_type => "decimal", is_nullable => 1, size => [6, 4] },
379   "tax_rate_on_receiving",
380   { data_type => "decimal", is_nullable => 1, size => [6, 4] },
381   "tax_value_bak",
382   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
383   "tax_value_on_ordering",
384   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
385   "tax_value_on_receiving",
386   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
387   "discount",
388   { data_type => "float", is_nullable => 1, size => [6, 4] },
389   "budget_id",
390   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
391   "budgetdate",
392   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
393   "sort1",
394   { data_type => "varchar", is_nullable => 1, size => 80 },
395   "sort2",
396   { data_type => "varchar", is_nullable => 1, size => 80 },
397   "sort1_authcat",
398   { data_type => "varchar", is_nullable => 1, size => 10 },
399   "sort2_authcat",
400   { data_type => "varchar", is_nullable => 1, size => 10 },
401   "uncertainprice",
402   { data_type => "tinyint", is_nullable => 1 },
403   "claims_count",
404   { data_type => "integer", default_value => 0, is_nullable => 1 },
405   "claimed_date",
406   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
407   "subscriptionid",
408   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
409   "parent_ordernumber",
410   { data_type => "integer", is_nullable => 1 },
411   "orderstatus",
412   {
413     data_type => "varchar",
414     default_value => "new",
415     is_nullable => 1,
416     size => 16,
417   },
418   "line_item_id",
419   { data_type => "varchar", is_nullable => 1, size => 35 },
420   "suppliers_reference_number",
421   { data_type => "varchar", is_nullable => 1, size => 35 },
422   "suppliers_reference_qualifier",
423   { data_type => "varchar", is_nullable => 1, size => 3 },
424   "suppliers_report",
425   { data_type => "text", is_nullable => 1 },
426 );
427
428 =head1 PRIMARY KEY
429
430 =over 4
431
432 =item * L</ordernumber>
433
434 =back
435
436 =cut
437
438 __PACKAGE__->set_primary_key("ordernumber");
439
440 =head1 RELATIONS
441
442 =head2 aqorder_users
443
444 Type: has_many
445
446 Related object: L<Koha::Schema::Result::AqorderUser>
447
448 =cut
449
450 __PACKAGE__->has_many(
451   "aqorder_users",
452   "Koha::Schema::Result::AqorderUser",
453   { "foreign.ordernumber" => "self.ordernumber" },
454   { cascade_copy => 0, cascade_delete => 0 },
455 );
456
457 =head2 aqorders_items
458
459 Type: has_many
460
461 Related object: L<Koha::Schema::Result::AqordersItem>
462
463 =cut
464
465 __PACKAGE__->has_many(
466   "aqorders_items",
467   "Koha::Schema::Result::AqordersItem",
468   { "foreign.ordernumber" => "self.ordernumber" },
469   { cascade_copy => 0, cascade_delete => 0 },
470 );
471
472 =head2 aqorders_transfers_ordernumber_from
473
474 Type: might_have
475
476 Related object: L<Koha::Schema::Result::AqordersTransfer>
477
478 =cut
479
480 __PACKAGE__->might_have(
481   "aqorders_transfers_ordernumber_from",
482   "Koha::Schema::Result::AqordersTransfer",
483   { "foreign.ordernumber_from" => "self.ordernumber" },
484   { cascade_copy => 0, cascade_delete => 0 },
485 );
486
487 =head2 aqorders_transfers_ordernumber_to
488
489 Type: might_have
490
491 Related object: L<Koha::Schema::Result::AqordersTransfer>
492
493 =cut
494
495 __PACKAGE__->might_have(
496   "aqorders_transfers_ordernumber_to",
497   "Koha::Schema::Result::AqordersTransfer",
498   { "foreign.ordernumber_to" => "self.ordernumber" },
499   { cascade_copy => 0, cascade_delete => 0 },
500 );
501
502 =head2 basketno
503
504 Type: belongs_to
505
506 Related object: L<Koha::Schema::Result::Aqbasket>
507
508 =cut
509
510 __PACKAGE__->belongs_to(
511   "basketno",
512   "Koha::Schema::Result::Aqbasket",
513   { basketno => "basketno" },
514   {
515     is_deferrable => 1,
516     join_type     => "LEFT",
517     on_delete     => "CASCADE",
518     on_update     => "CASCADE",
519   },
520 );
521
522 =head2 biblionumber
523
524 Type: belongs_to
525
526 Related object: L<Koha::Schema::Result::Biblio>
527
528 =cut
529
530 __PACKAGE__->belongs_to(
531   "biblionumber",
532   "Koha::Schema::Result::Biblio",
533   { biblionumber => "biblionumber" },
534   {
535     is_deferrable => 1,
536     join_type     => "LEFT",
537     on_delete     => "SET NULL",
538     on_update     => "CASCADE",
539   },
540 );
541
542 =head2 budget
543
544 Type: belongs_to
545
546 Related object: L<Koha::Schema::Result::Aqbudget>
547
548 =cut
549
550 __PACKAGE__->belongs_to(
551   "budget",
552   "Koha::Schema::Result::Aqbudget",
553   { budget_id => "budget_id" },
554   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
555 );
556
557 =head2 currency
558
559 Type: belongs_to
560
561 Related object: L<Koha::Schema::Result::Currency>
562
563 =cut
564
565 __PACKAGE__->belongs_to(
566   "currency",
567   "Koha::Schema::Result::Currency",
568   { currency => "currency" },
569   {
570     is_deferrable => 1,
571     join_type     => "LEFT",
572     on_delete     => "SET NULL",
573     on_update     => "SET NULL",
574   },
575 );
576
577 =head2 invoiceid
578
579 Type: belongs_to
580
581 Related object: L<Koha::Schema::Result::Aqinvoice>
582
583 =cut
584
585 __PACKAGE__->belongs_to(
586   "invoiceid",
587   "Koha::Schema::Result::Aqinvoice",
588   { invoiceid => "invoiceid" },
589   {
590     is_deferrable => 1,
591     join_type     => "LEFT",
592     on_delete     => "SET NULL",
593     on_update     => "CASCADE",
594   },
595 );
596
597 =head2 subscriptionid
598
599 Type: belongs_to
600
601 Related object: L<Koha::Schema::Result::Subscription>
602
603 =cut
604
605 __PACKAGE__->belongs_to(
606   "subscriptionid",
607   "Koha::Schema::Result::Subscription",
608   { subscriptionid => "subscriptionid" },
609   {
610     is_deferrable => 1,
611     join_type     => "LEFT",
612     on_delete     => "CASCADE",
613     on_update     => "CASCADE",
614   },
615 );
616
617 =head2 borrowernumbers
618
619 Type: many_to_many
620
621 Composing rels: L</aqorder_users> -> borrowernumber
622
623 =cut
624
625 __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber");
626
627
628 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-28 15:05:37
629 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FyZsBWGJ8wsPkFdYUAetmg
630
631
632 # You can replace this text with custom code or comments, and it will be preserved on regeneration
633 1;