2 package Koha::Schema::Result::Aqorder;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::Aqorder
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<aqorders>
22 __PACKAGE__->table("aqorders");
41 datetime_undef_if_invalid: 1
65 datetime_undef_if_invalid: 1
86 =head2 unitprice_tax_excluded
92 =head2 unitprice_tax_included
98 =head2 quantityreceived
100 data_type: 'smallint'
110 =head2 datecancellationprinted
113 datetime_undef_if_invalid: 1
116 =head2 cancellationreason
118 data_type: 'mediumtext'
121 =head2 order_internalnote
123 data_type: 'longtext'
126 =head2 order_vendornote
128 data_type: 'longtext'
131 =head2 purchaseordernumber
133 data_type: 'longtext'
144 data_type: 'timestamp'
145 datetime_undef_if_invalid: 1
146 default_value: current_timestamp
155 =head2 replacementprice
161 =head2 rrp_tax_excluded
167 =head2 rrp_tax_included
179 =head2 ecost_tax_excluded
185 =head2 ecost_tax_included
197 =head2 tax_rate_on_ordering
203 =head2 tax_rate_on_receiving
215 =head2 tax_value_on_ordering
221 =head2 tax_value_on_receiving
242 datetime_undef_if_invalid: 1
269 =head2 uncertainprice
283 datetime_undef_if_invalid: 1
286 =head2 subscriptionid
292 =head2 parent_ordernumber
310 =head2 suppliers_reference_number
316 =head2 suppliers_reference_qualifier
322 =head2 suppliers_report
324 data_type: 'mediumtext'
329 __PACKAGE__->add_columns(
331 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
333 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
335 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
337 { data_type => "smallint", is_nullable => 1 },
339 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
341 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
343 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
345 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
347 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
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] },
355 { data_type => "smallint", default_value => 0, is_nullable => 0 },
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 },
365 { data_type => "longtext", is_nullable => 1 },
366 "purchaseordernumber",
367 { data_type => "longtext", is_nullable => 1 },
369 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
372 data_type => "timestamp",
373 datetime_undef_if_invalid => 1,
374 default_value => \"current_timestamp",
378 { data_type => "decimal", is_nullable => 1, size => [13, 2] },
380 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
382 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
384 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
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] },
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] },
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] },
404 { data_type => "float", is_nullable => 1, size => [6, 4] },
406 { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
408 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
410 { data_type => "varchar", is_nullable => 1, size => 80 },
412 { data_type => "varchar", is_nullable => 1, size => 80 },
414 { data_type => "varchar", is_nullable => 1, size => 10 },
416 { data_type => "varchar", is_nullable => 1, size => 10 },
418 { data_type => "tinyint", is_nullable => 1 },
420 { data_type => "integer", default_value => 0, is_nullable => 1 },
422 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
424 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
425 "parent_ordernumber",
426 { data_type => "integer", is_nullable => 1 },
429 data_type => "varchar",
430 default_value => "new",
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 },
441 { data_type => "mediumtext", is_nullable => 1 },
448 =item * L</ordernumber>
454 __PACKAGE__->set_primary_key("ordernumber");
462 Related object: L<Koha::Schema::Result::AqorderUser>
466 __PACKAGE__->has_many(
468 "Koha::Schema::Result::AqorderUser",
469 { "foreign.ordernumber" => "self.ordernumber" },
470 { cascade_copy => 0, cascade_delete => 0 },
473 =head2 aqorders_items
477 Related object: L<Koha::Schema::Result::AqordersItem>
481 __PACKAGE__->has_many(
483 "Koha::Schema::Result::AqordersItem",
484 { "foreign.ordernumber" => "self.ordernumber" },
485 { cascade_copy => 0, cascade_delete => 0 },
488 =head2 aqorders_transfers_ordernumber_from
492 Related object: L<Koha::Schema::Result::AqordersTransfer>
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 },
503 =head2 aqorders_transfers_ordernumber_to
507 Related object: L<Koha::Schema::Result::AqordersTransfer>
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 },
522 Related object: L<Koha::Schema::Result::Aqbasket>
526 __PACKAGE__->belongs_to(
528 "Koha::Schema::Result::Aqbasket",
529 { basketno => "basketno" },
533 on_delete => "CASCADE",
534 on_update => "CASCADE",
542 Related object: L<Koha::Schema::Result::Biblio>
546 __PACKAGE__->belongs_to(
548 "Koha::Schema::Result::Biblio",
549 { biblionumber => "biblionumber" },
553 on_delete => "SET NULL",
554 on_update => "CASCADE",
562 Related object: L<Koha::Schema::Result::Aqbudget>
566 __PACKAGE__->belongs_to(
568 "Koha::Schema::Result::Aqbudget",
569 { budget_id => "budget_id" },
570 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
577 Related object: L<Koha::Schema::Result::Borrower>
581 __PACKAGE__->belongs_to(
583 "Koha::Schema::Result::Borrower",
584 { borrowernumber => "created_by" },
588 on_delete => "SET NULL",
589 on_update => "CASCADE",
597 Related object: L<Koha::Schema::Result::Currency>
601 __PACKAGE__->belongs_to(
603 "Koha::Schema::Result::Currency",
604 { currency => "currency" },
608 on_delete => "SET NULL",
609 on_update => "SET NULL",
617 Related object: L<Koha::Schema::Result::Aqinvoice>
621 __PACKAGE__->belongs_to(
623 "Koha::Schema::Result::Aqinvoice",
624 { invoiceid => "invoiceid" },
628 on_delete => "SET NULL",
629 on_update => "CASCADE",
633 =head2 subscriptionid
637 Related object: L<Koha::Schema::Result::Subscription>
641 __PACKAGE__->belongs_to(
643 "Koha::Schema::Result::Subscription",
644 { subscriptionid => "subscriptionid" },
648 on_delete => "CASCADE",
649 on_update => "CASCADE",
653 =head2 borrowernumbers
657 Composing rels: L</aqorder_users> -> borrowernumber
661 __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber");
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
667 __PACKAGE__->belongs_to(
669 "Koha::Schema::Result::Aqbasket",
670 { "foreign.basketno" => "self.basketno" },
674 on_delete => "CASCADE",
675 on_update => "CASCADE",
679 __PACKAGE__->belongs_to(
681 "Koha::Schema::Result::Biblio",
682 { 'foreign.biblionumber' => "self.biblionumber" },
686 on_delete => "SET NULL",
687 on_update => "CASCADE",
691 __PACKAGE__->belongs_to(
693 "Koha::Schema::Result::Aqbudget",
694 { "foreign.budget_id" => "self.budget_id" },
695 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
698 __PACKAGE__->belongs_to(
700 "Koha::Schema::Result::Aqinvoice",
701 { "foreign.invoiceid" => "self.invoiceid" },
705 on_delete => "SET NULL",
706 on_update => "CASCADE",
710 __PACKAGE__->belongs_to(
712 "Koha::Schema::Result::Subscription",
713 { "foreign.subscriptionid" => "self.subscriptionid" },
717 on_delete => "CASCADE",
718 on_update => "CASCADE",
722 sub koha_objects_class {
723 'Koha::Acquisition::Orders';
726 sub koha_object_class {
727 'Koha::Acquisition::Order';
730 __PACKAGE__->add_columns(
731 '+uncertainprice' => { is_boolean => 1 }