]> git.koha-community.org Git - koha.git/blob - Koha/Schema/Result/Aqorder.pm
Bug 22887: Schema changes
[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 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 replacementprice
156
157   data_type: 'decimal'
158   is_nullable: 1
159   size: [28,6]
160
161 =head2 rrp_tax_excluded
162
163   data_type: 'decimal'
164   is_nullable: 1
165   size: [28,6]
166
167 =head2 rrp_tax_included
168
169   data_type: 'decimal'
170   is_nullable: 1
171   size: [28,6]
172
173 =head2 ecost
174
175   data_type: 'decimal'
176   is_nullable: 1
177   size: [13,2]
178
179 =head2 ecost_tax_excluded
180
181   data_type: 'decimal'
182   is_nullable: 1
183   size: [28,6]
184
185 =head2 ecost_tax_included
186
187   data_type: 'decimal'
188   is_nullable: 1
189   size: [28,6]
190
191 =head2 tax_rate_bak
192
193   data_type: 'decimal'
194   is_nullable: 1
195   size: [6,4]
196
197 =head2 tax_rate_on_ordering
198
199   data_type: 'decimal'
200   is_nullable: 1
201   size: [6,4]
202
203 =head2 tax_rate_on_receiving
204
205   data_type: 'decimal'
206   is_nullable: 1
207   size: [6,4]
208
209 =head2 tax_value_bak
210
211   data_type: 'decimal'
212   is_nullable: 1
213   size: [28,6]
214
215 =head2 tax_value_on_ordering
216
217   data_type: 'decimal'
218   is_nullable: 1
219   size: [28,6]
220
221 =head2 tax_value_on_receiving
222
223   data_type: 'decimal'
224   is_nullable: 1
225   size: [28,6]
226
227 =head2 discount
228
229   data_type: 'float'
230   is_nullable: 1
231   size: [6,4]
232
233 =head2 budget_id
234
235   data_type: 'integer'
236   is_foreign_key: 1
237   is_nullable: 0
238
239 =head2 budgetdate
240
241   data_type: 'date'
242   datetime_undef_if_invalid: 1
243   is_nullable: 1
244
245 =head2 sort1
246
247   data_type: 'varchar'
248   is_nullable: 1
249   size: 80
250
251 =head2 sort2
252
253   data_type: 'varchar'
254   is_nullable: 1
255   size: 80
256
257 =head2 sort1_authcat
258
259   data_type: 'varchar'
260   is_nullable: 1
261   size: 10
262
263 =head2 sort2_authcat
264
265   data_type: 'varchar'
266   is_nullable: 1
267   size: 10
268
269 =head2 uncertainprice
270
271   data_type: 'tinyint'
272   is_nullable: 1
273
274 =head2 claims_count
275
276   data_type: 'integer'
277   default_value: 0
278   is_nullable: 1
279
280 =head2 claimed_date
281
282   data_type: 'date'
283   datetime_undef_if_invalid: 1
284   is_nullable: 1
285
286 =head2 subscriptionid
287
288   data_type: 'integer'
289   is_foreign_key: 1
290   is_nullable: 1
291
292 =head2 parent_ordernumber
293
294   data_type: 'integer'
295   is_nullable: 1
296
297 =head2 orderstatus
298
299   data_type: 'varchar'
300   default_value: 'new'
301   is_nullable: 1
302   size: 16
303
304 =head2 line_item_id
305
306   data_type: 'varchar'
307   is_nullable: 1
308   size: 35
309
310 =head2 suppliers_reference_number
311
312   data_type: 'varchar'
313   is_nullable: 1
314   size: 35
315
316 =head2 suppliers_reference_qualifier
317
318   data_type: 'varchar'
319   is_nullable: 1
320   size: 3
321
322 =head2 suppliers_report
323
324   data_type: 'mediumtext'
325   is_nullable: 1
326
327 =cut
328
329 __PACKAGE__->add_columns(
330   "ordernumber",
331   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
332   "biblionumber",
333   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
334   "entrydate",
335   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
336   "quantity",
337   { data_type => "smallint", is_nullable => 1 },
338   "currency",
339   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
340   "listprice",
341   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
342   "datereceived",
343   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
344   "invoiceid",
345   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
346   "freight",
347   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
348   "unitprice",
349   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
350   "unitprice_tax_excluded",
351   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
352   "unitprice_tax_included",
353   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
354   "quantityreceived",
355   { data_type => "smallint", default_value => 0, is_nullable => 0 },
356   "created_by",
357   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
358   "datecancellationprinted",
359   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
360   "cancellationreason",
361   { data_type => "mediumtext", is_nullable => 1 },
362   "order_internalnote",
363   { data_type => "longtext", is_nullable => 1 },
364   "order_vendornote",
365   { data_type => "longtext", is_nullable => 1 },
366   "purchaseordernumber",
367   { data_type => "longtext", is_nullable => 1 },
368   "basketno",
369   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
370   "timestamp",
371   {
372     data_type => "timestamp",
373     datetime_undef_if_invalid => 1,
374     default_value => \"current_timestamp",
375     is_nullable => 0,
376   },
377   "rrp",
378   { data_type => "decimal", is_nullable => 1, size => [13, 2] },
379   "replacementprice",
380   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
381   "rrp_tax_excluded",
382   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
383   "rrp_tax_included",
384   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
385   "ecost",
386   { data_type => "decimal", is_nullable => 1, size => [13, 2] },
387   "ecost_tax_excluded",
388   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
389   "ecost_tax_included",
390   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
391   "tax_rate_bak",
392   { data_type => "decimal", is_nullable => 1, size => [6, 4] },
393   "tax_rate_on_ordering",
394   { data_type => "decimal", is_nullable => 1, size => [6, 4] },
395   "tax_rate_on_receiving",
396   { data_type => "decimal", is_nullable => 1, size => [6, 4] },
397   "tax_value_bak",
398   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
399   "tax_value_on_ordering",
400   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
401   "tax_value_on_receiving",
402   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
403   "discount",
404   { data_type => "float", is_nullable => 1, size => [6, 4] },
405   "budget_id",
406   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
407   "budgetdate",
408   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
409   "sort1",
410   { data_type => "varchar", is_nullable => 1, size => 80 },
411   "sort2",
412   { data_type => "varchar", is_nullable => 1, size => 80 },
413   "sort1_authcat",
414   { data_type => "varchar", is_nullable => 1, size => 10 },
415   "sort2_authcat",
416   { data_type => "varchar", is_nullable => 1, size => 10 },
417   "uncertainprice",
418   { data_type => "tinyint", is_nullable => 1 },
419   "claims_count",
420   { data_type => "integer", default_value => 0, is_nullable => 1 },
421   "claimed_date",
422   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
423   "subscriptionid",
424   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
425   "parent_ordernumber",
426   { data_type => "integer", is_nullable => 1 },
427   "orderstatus",
428   {
429     data_type => "varchar",
430     default_value => "new",
431     is_nullable => 1,
432     size => 16,
433   },
434   "line_item_id",
435   { data_type => "varchar", is_nullable => 1, size => 35 },
436   "suppliers_reference_number",
437   { data_type => "varchar", is_nullable => 1, size => 35 },
438   "suppliers_reference_qualifier",
439   { data_type => "varchar", is_nullable => 1, size => 3 },
440   "suppliers_report",
441   { data_type => "mediumtext", is_nullable => 1 },
442 );
443
444 =head1 PRIMARY KEY
445
446 =over 4
447
448 =item * L</ordernumber>
449
450 =back
451
452 =cut
453
454 __PACKAGE__->set_primary_key("ordernumber");
455
456 =head1 RELATIONS
457
458 =head2 aqorder_users
459
460 Type: has_many
461
462 Related object: L<Koha::Schema::Result::AqorderUser>
463
464 =cut
465
466 __PACKAGE__->has_many(
467   "aqorder_users",
468   "Koha::Schema::Result::AqorderUser",
469   { "foreign.ordernumber" => "self.ordernumber" },
470   { cascade_copy => 0, cascade_delete => 0 },
471 );
472
473 =head2 aqorders_items
474
475 Type: has_many
476
477 Related object: L<Koha::Schema::Result::AqordersItem>
478
479 =cut
480
481 __PACKAGE__->has_many(
482   "aqorders_items",
483   "Koha::Schema::Result::AqordersItem",
484   { "foreign.ordernumber" => "self.ordernumber" },
485   { cascade_copy => 0, cascade_delete => 0 },
486 );
487
488 =head2 aqorders_transfers_ordernumber_from
489
490 Type: might_have
491
492 Related object: L<Koha::Schema::Result::AqordersTransfer>
493
494 =cut
495
496 __PACKAGE__->might_have(
497   "aqorders_transfers_ordernumber_from",
498   "Koha::Schema::Result::AqordersTransfer",
499   { "foreign.ordernumber_from" => "self.ordernumber" },
500   { cascade_copy => 0, cascade_delete => 0 },
501 );
502
503 =head2 aqorders_transfers_ordernumber_to
504
505 Type: might_have
506
507 Related object: L<Koha::Schema::Result::AqordersTransfer>
508
509 =cut
510
511 __PACKAGE__->might_have(
512   "aqorders_transfers_ordernumber_to",
513   "Koha::Schema::Result::AqordersTransfer",
514   { "foreign.ordernumber_to" => "self.ordernumber" },
515   { cascade_copy => 0, cascade_delete => 0 },
516 );
517
518 =head2 basketno
519
520 Type: belongs_to
521
522 Related object: L<Koha::Schema::Result::Aqbasket>
523
524 =cut
525
526 __PACKAGE__->belongs_to(
527   "basketno",
528   "Koha::Schema::Result::Aqbasket",
529   { basketno => "basketno" },
530   {
531     is_deferrable => 1,
532     join_type     => "LEFT",
533     on_delete     => "CASCADE",
534     on_update     => "CASCADE",
535   },
536 );
537
538 =head2 biblionumber
539
540 Type: belongs_to
541
542 Related object: L<Koha::Schema::Result::Biblio>
543
544 =cut
545
546 __PACKAGE__->belongs_to(
547   "biblionumber",
548   "Koha::Schema::Result::Biblio",
549   { biblionumber => "biblionumber" },
550   {
551     is_deferrable => 1,
552     join_type     => "LEFT",
553     on_delete     => "SET NULL",
554     on_update     => "CASCADE",
555   },
556 );
557
558 =head2 budget
559
560 Type: belongs_to
561
562 Related object: L<Koha::Schema::Result::Aqbudget>
563
564 =cut
565
566 __PACKAGE__->belongs_to(
567   "budget",
568   "Koha::Schema::Result::Aqbudget",
569   { budget_id => "budget_id" },
570   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
571 );
572
573 =head2 created_by
574
575 Type: belongs_to
576
577 Related object: L<Koha::Schema::Result::Borrower>
578
579 =cut
580
581 __PACKAGE__->belongs_to(
582   "created_by",
583   "Koha::Schema::Result::Borrower",
584   { borrowernumber => "created_by" },
585   {
586     is_deferrable => 1,
587     join_type     => "LEFT",
588     on_delete     => "SET NULL",
589     on_update     => "CASCADE",
590   },
591 );
592
593 =head2 currency
594
595 Type: belongs_to
596
597 Related object: L<Koha::Schema::Result::Currency>
598
599 =cut
600
601 __PACKAGE__->belongs_to(
602   "currency",
603   "Koha::Schema::Result::Currency",
604   { currency => "currency" },
605   {
606     is_deferrable => 1,
607     join_type     => "LEFT",
608     on_delete     => "SET NULL",
609     on_update     => "SET NULL",
610   },
611 );
612
613 =head2 invoiceid
614
615 Type: belongs_to
616
617 Related object: L<Koha::Schema::Result::Aqinvoice>
618
619 =cut
620
621 __PACKAGE__->belongs_to(
622   "invoiceid",
623   "Koha::Schema::Result::Aqinvoice",
624   { invoiceid => "invoiceid" },
625   {
626     is_deferrable => 1,
627     join_type     => "LEFT",
628     on_delete     => "SET NULL",
629     on_update     => "CASCADE",
630   },
631 );
632
633 =head2 subscriptionid
634
635 Type: belongs_to
636
637 Related object: L<Koha::Schema::Result::Subscription>
638
639 =cut
640
641 __PACKAGE__->belongs_to(
642   "subscriptionid",
643   "Koha::Schema::Result::Subscription",
644   { subscriptionid => "subscriptionid" },
645   {
646     is_deferrable => 1,
647     join_type     => "LEFT",
648     on_delete     => "CASCADE",
649     on_update     => "CASCADE",
650   },
651 );
652
653 =head2 borrowernumbers
654
655 Type: many_to_many
656
657 Composing rels: L</aqorder_users> -> borrowernumber
658
659 =cut
660
661 __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber");
662
663
664 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-08-31 11:51:37
665 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GQEXetlivZm7buQohl8m4A
666
667 __PACKAGE__->belongs_to(
668   "basket",
669   "Koha::Schema::Result::Aqbasket",
670   { "foreign.basketno" => "self.basketno" },
671   {
672     is_deferrable => 1,
673     join_type     => "LEFT",
674     on_delete     => "CASCADE",
675     on_update     => "CASCADE",
676   },
677 );
678
679 __PACKAGE__->belongs_to(
680   "biblio",
681   "Koha::Schema::Result::Biblio",
682   { 'foreign.biblionumber' => "self.biblionumber" },
683   {
684     is_deferrable => 1,
685     join_type     => "LEFT",
686     on_delete     => "SET NULL",
687     on_update     => "CASCADE",
688   },
689 );
690
691 __PACKAGE__->belongs_to(
692   "fund",
693   "Koha::Schema::Result::Aqbudget",
694   { "foreign.budget_id" => "self.budget_id" },
695   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
696 );
697
698 __PACKAGE__->belongs_to(
699   "invoice",
700   "Koha::Schema::Result::Aqinvoice",
701   { "foreign.invoiceid" => "self.invoiceid" },
702   {
703     is_deferrable => 1,
704     join_type     => "LEFT",
705     on_delete     => "SET NULL",
706     on_update     => "CASCADE",
707   },
708 );
709
710 __PACKAGE__->belongs_to(
711   "subscription",
712   "Koha::Schema::Result::Subscription",
713   { "foreign.subscriptionid" => "self.subscriptionid" },
714   {
715     is_deferrable => 1,
716     join_type     => "LEFT",
717     on_delete     => "CASCADE",
718     on_update     => "CASCADE",
719   },
720 );
721
722 sub koha_objects_class {
723     'Koha::Acquisition::Orders';
724 }
725
726 sub koha_object_class {
727     'Koha::Acquisition::Order';
728 }
729
730 __PACKAGE__->add_columns(
731     '+uncertainprice' => { is_boolean => 1 }
732 );
733
734 1;