From 7f3067575861ed3f4dd35f90450a17eeca71822c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 16 Jan 2023 21:58:45 +0100 Subject: [PATCH] Bug 25655: DBIC changes Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Michaela Sieber --- Koha/Schema/Result/Aqorder.pm | 45 ++++++++++++++++++++++++++++++++-- Koha/Schema/Result/Currency.pm | 19 ++++++++++++-- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/Aqorder.pm b/Koha/Schema/Result/Aqorder.pm index 71c8753817e..88a6d7e5a3e 100644 --- a/Koha/Schema/Result/Aqorder.pm +++ b/Koha/Schema/Result/Aqorder.pm @@ -414,6 +414,23 @@ reports received from suppliers Estimated delivery date +=head2 invoice_unitprice + + data_type: 'decimal' + is_nullable: 1 + size: [28,6] + +the unit price in foreign currency + +=head2 invoice_currency + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + +the currency of the invoice_unitprice + =cut __PACKAGE__->add_columns( @@ -527,6 +544,10 @@ __PACKAGE__->add_columns( { data_type => "mediumtext", is_nullable => 1 }, "estimated_delivery_date", { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + "invoice_unitprice", + { data_type => "decimal", is_nullable => 1, size => [28, 6] }, + "invoice_currency", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, ); =head1 PRIMARY KEY @@ -713,6 +734,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 invoice_currency + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "invoice_currency", + "Koha::Schema::Result::Currency", + { currency => "invoice_currency" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "SET NULL", + }, +); + =head2 invoiceid Type: belongs_to @@ -764,8 +805,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-16 13:56:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M8HvWBKYFNGspSTakU6Qdg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-01-16 20:27:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j+1KthANw+mepqimVi57Ug __PACKAGE__->belongs_to( "basket", diff --git a/Koha/Schema/Result/Currency.pm b/Koha/Schema/Result/Currency.pm index 720fa5ac59c..0574f87b892 100644 --- a/Koha/Schema/Result/Currency.pm +++ b/Koha/Schema/Result/Currency.pm @@ -157,9 +157,24 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 aqorders_invoice_currencies -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-01 14:23:58 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PnJEcCgrM1Edf99phWFdyQ +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "aqorders_invoice_currencies", + "Koha::Schema::Result::Aqorder", + { "foreign.invoice_currency" => "self.currency" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-01-16 20:27:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m6A1v4/u0oxoKG2ridxKgA sub koha_object_class { -- 2.25.1