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