Bug 13178: DBIC Schema changes
[koha.git] / Koha / Schema / Result / Aqorder.pm
blobaf849d7882b54037a748d643dd908aafb7a05412
1 use utf8;
2 package Koha::Schema::Result::Aqorder;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Aqorder
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<aqorders>
20 =cut
22 __PACKAGE__->table("aqorders");
24 =head1 ACCESSORS
26 =head2 ordernumber
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 biblionumber
34 data_type: 'integer'
35 is_foreign_key: 1
36 is_nullable: 1
38 =head2 entrydate
40 data_type: 'date'
41 datetime_undef_if_invalid: 1
42 is_nullable: 1
44 =head2 quantity
46 data_type: 'smallint'
47 is_nullable: 1
49 =head2 currency
51 data_type: 'varchar'
52 is_foreign_key: 1
53 is_nullable: 1
54 size: 10
56 =head2 listprice
58 data_type: 'decimal'
59 is_nullable: 1
60 size: [28,6]
62 =head2 datereceived
64 data_type: 'date'
65 datetime_undef_if_invalid: 1
66 is_nullable: 1
68 =head2 invoiceid
70 data_type: 'integer'
71 is_foreign_key: 1
72 is_nullable: 1
74 =head2 freight
76 data_type: 'decimal'
77 is_nullable: 1
78 size: [28,6]
80 =head2 unitprice
82 data_type: 'decimal'
83 is_nullable: 1
84 size: [28,6]
86 =head2 unitprice_tax_excluded
88 data_type: 'decimal'
89 is_nullable: 1
90 size: [28,6]
92 =head2 unitprice_tax_included
94 data_type: 'decimal'
95 is_nullable: 1
96 size: [28,6]
98 =head2 quantityreceived
100 data_type: 'smallint'
101 default_value: 0
102 is_nullable: 0
104 =head2 datecancellationprinted
106 data_type: 'date'
107 datetime_undef_if_invalid: 1
108 is_nullable: 1
110 =head2 cancellationreason
112 data_type: 'text'
113 is_nullable: 1
115 =head2 order_internalnote
117 data_type: 'mediumtext'
118 is_nullable: 1
120 =head2 order_vendornote
122 data_type: 'mediumtext'
123 is_nullable: 1
125 =head2 purchaseordernumber
127 data_type: 'mediumtext'
128 is_nullable: 1
130 =head2 basketno
132 data_type: 'integer'
133 is_foreign_key: 1
134 is_nullable: 1
136 =head2 timestamp
138 data_type: 'timestamp'
139 datetime_undef_if_invalid: 1
140 default_value: current_timestamp
141 is_nullable: 0
143 =head2 rrp
145 data_type: 'decimal'
146 is_nullable: 1
147 size: [13,2]
149 =head2 rrp_tax_excluded
151 data_type: 'decimal'
152 is_nullable: 1
153 size: [28,6]
155 =head2 rrp_tax_included
157 data_type: 'decimal'
158 is_nullable: 1
159 size: [28,6]
161 =head2 ecost
163 data_type: 'decimal'
164 is_nullable: 1
165 size: [13,2]
167 =head2 ecost_tax_excluded
169 data_type: 'decimal'
170 is_nullable: 1
171 size: [28,6]
173 =head2 ecost_tax_included
175 data_type: 'decimal'
176 is_nullable: 1
177 size: [28,6]
179 =head2 tax_rate_bak
181 data_type: 'decimal'
182 is_nullable: 1
183 size: [6,4]
185 =head2 tax_rate_on_ordering
187 data_type: 'decimal'
188 is_nullable: 1
189 size: [6,4]
191 =head2 tax_rate_on_receiving
193 data_type: 'decimal'
194 is_nullable: 1
195 size: [6,4]
197 =head2 tax_value_bak
199 data_type: 'decimal'
200 is_nullable: 1
201 size: [28,6]
203 =head2 tax_value_on_ordering
205 data_type: 'decimal'
206 is_nullable: 1
207 size: [28,6]
209 =head2 tax_value_on_receiving
211 data_type: 'decimal'
212 is_nullable: 1
213 size: [28,6]
215 =head2 discount
217 data_type: 'float'
218 is_nullable: 1
219 size: [6,4]
221 =head2 budget_id
223 data_type: 'integer'
224 is_foreign_key: 1
225 is_nullable: 0
227 =head2 budgetdate
229 data_type: 'date'
230 datetime_undef_if_invalid: 1
231 is_nullable: 1
233 =head2 sort1
235 data_type: 'varchar'
236 is_nullable: 1
237 size: 80
239 =head2 sort2
241 data_type: 'varchar'
242 is_nullable: 1
243 size: 80
245 =head2 sort1_authcat
247 data_type: 'varchar'
248 is_nullable: 1
249 size: 10
251 =head2 sort2_authcat
253 data_type: 'varchar'
254 is_nullable: 1
255 size: 10
257 =head2 uncertainprice
259 data_type: 'tinyint'
260 is_nullable: 1
262 =head2 claims_count
264 data_type: 'integer'
265 default_value: 0
266 is_nullable: 1
268 =head2 claimed_date
270 data_type: 'date'
271 datetime_undef_if_invalid: 1
272 is_nullable: 1
274 =head2 subscriptionid
276 data_type: 'integer'
277 is_foreign_key: 1
278 is_nullable: 1
280 =head2 parent_ordernumber
282 data_type: 'integer'
283 is_nullable: 1
285 =head2 orderstatus
287 data_type: 'varchar'
288 default_value: 'new'
289 is_nullable: 1
290 size: 16
292 =head2 line_item_id
294 data_type: 'varchar'
295 is_nullable: 1
296 size: 35
298 =head2 suppliers_reference_number
300 data_type: 'varchar'
301 is_nullable: 1
302 size: 35
304 =head2 suppliers_reference_qualifier
306 data_type: 'varchar'
307 is_nullable: 1
308 size: 3
310 =head2 suppliers_report
312 data_type: 'text'
313 is_nullable: 1
315 =cut
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",
358 data_type => "timestamp",
359 datetime_undef_if_invalid => 1,
360 default_value => \"current_timestamp",
361 is_nullable => 0,
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",
413 data_type => "varchar",
414 default_value => "new",
415 is_nullable => 1,
416 size => 16,
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 },
428 =head1 PRIMARY KEY
430 =over 4
432 =item * L</ordernumber>
434 =back
436 =cut
438 __PACKAGE__->set_primary_key("ordernumber");
440 =head1 RELATIONS
442 =head2 aqorder_users
444 Type: has_many
446 Related object: L<Koha::Schema::Result::AqorderUser>
448 =cut
450 __PACKAGE__->has_many(
451 "aqorder_users",
452 "Koha::Schema::Result::AqorderUser",
453 { "foreign.ordernumber" => "self.ordernumber" },
454 { cascade_copy => 0, cascade_delete => 0 },
457 =head2 aqorders_items
459 Type: has_many
461 Related object: L<Koha::Schema::Result::AqordersItem>
463 =cut
465 __PACKAGE__->has_many(
466 "aqorders_items",
467 "Koha::Schema::Result::AqordersItem",
468 { "foreign.ordernumber" => "self.ordernumber" },
469 { cascade_copy => 0, cascade_delete => 0 },
472 =head2 aqorders_transfers_ordernumber_from
474 Type: might_have
476 Related object: L<Koha::Schema::Result::AqordersTransfer>
478 =cut
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 },
487 =head2 aqorders_transfers_ordernumber_to
489 Type: might_have
491 Related object: L<Koha::Schema::Result::AqordersTransfer>
493 =cut
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 },
502 =head2 basketno
504 Type: belongs_to
506 Related object: L<Koha::Schema::Result::Aqbasket>
508 =cut
510 __PACKAGE__->belongs_to(
511 "basketno",
512 "Koha::Schema::Result::Aqbasket",
513 { basketno => "basketno" },
515 is_deferrable => 1,
516 join_type => "LEFT",
517 on_delete => "CASCADE",
518 on_update => "CASCADE",
522 =head2 biblionumber
524 Type: belongs_to
526 Related object: L<Koha::Schema::Result::Biblio>
528 =cut
530 __PACKAGE__->belongs_to(
531 "biblionumber",
532 "Koha::Schema::Result::Biblio",
533 { biblionumber => "biblionumber" },
535 is_deferrable => 1,
536 join_type => "LEFT",
537 on_delete => "SET NULL",
538 on_update => "CASCADE",
542 =head2 budget
544 Type: belongs_to
546 Related object: L<Koha::Schema::Result::Aqbudget>
548 =cut
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" },
557 =head2 currency
559 Type: belongs_to
561 Related object: L<Koha::Schema::Result::Currency>
563 =cut
565 __PACKAGE__->belongs_to(
566 "currency",
567 "Koha::Schema::Result::Currency",
568 { currency => "currency" },
570 is_deferrable => 1,
571 join_type => "LEFT",
572 on_delete => "SET NULL",
573 on_update => "SET NULL",
577 =head2 invoiceid
579 Type: belongs_to
581 Related object: L<Koha::Schema::Result::Aqinvoice>
583 =cut
585 __PACKAGE__->belongs_to(
586 "invoiceid",
587 "Koha::Schema::Result::Aqinvoice",
588 { invoiceid => "invoiceid" },
590 is_deferrable => 1,
591 join_type => "LEFT",
592 on_delete => "SET NULL",
593 on_update => "CASCADE",
597 =head2 subscriptionid
599 Type: belongs_to
601 Related object: L<Koha::Schema::Result::Subscription>
603 =cut
605 __PACKAGE__->belongs_to(
606 "subscriptionid",
607 "Koha::Schema::Result::Subscription",
608 { subscriptionid => "subscriptionid" },
610 is_deferrable => 1,
611 join_type => "LEFT",
612 on_delete => "CASCADE",
613 on_update => "CASCADE",
617 =head2 borrowernumbers
619 Type: many_to_many
621 Composing rels: L</aqorder_users> -> borrowernumber
623 =cut
625 __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber");
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
632 # You can replace this text with custom code or comments, and it will be preserved on regeneration