From 5f5c199762470733d74c4ca7831669fe73cb65f7 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Fri, 28 Jan 2022 10:22:24 -1000 Subject: [PATCH] Bug 27946: Update DBIC schema Signed-off-by: Fridolin Somers --- Koha/Schema/Result/Accountline.pm | 19 ++++++++++++++-- Koha/Schema/Result/ArticleRequest.pm | 34 ++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm index 47edfcf4e4..1dee4ccf20 100644 --- a/Koha/Schema/Result/Accountline.pm +++ b/Koha/Schema/Result/Accountline.pm @@ -240,6 +240,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 article_requests + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "article_requests", + "Koha::Schema::Result::ArticleRequest", + { "foreign.debit_id" => "self.accountlines_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 borrowernumber Type: belongs_to @@ -381,8 +396,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MBdnk+5gD5TMX/ZOqEf3kA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-01-28 20:21:02 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PjQR7oUkefiDt+eV69jZ3A =head2 library diff --git a/Koha/Schema/Result/ArticleRequest.pm b/Koha/Schema/Result/ArticleRequest.pm index ee317ad34f..f0c3475ffe 100644 --- a/Koha/Schema/Result/ArticleRequest.pm +++ b/Koha/Schema/Result/ArticleRequest.pm @@ -126,6 +126,14 @@ __PACKAGE__->table("article_requests"); optional authorised value AR_CANCELLATION +=head2 debit_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +Debit line with cost for article scan request + =head2 created_on data_type: 'timestamp' @@ -200,6 +208,8 @@ __PACKAGE__->add_columns( { data_type => "mediumtext", is_nullable => 1 }, "cancellation_reason", { data_type => "varchar", is_nullable => 1, size => 80 }, + "debit_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "created_on", { data_type => "timestamp", @@ -281,6 +291,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 debit + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "debit", + "Koha::Schema::Result::Accountline", + { accountlines_id => "debit_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 itemnumber Type: belongs_to @@ -302,8 +332,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-10-15 09:05:08 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:U4C1bwfCj048twrT3yRD6Q +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-01-28 20:21:02 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/mPsUO8VPK6DVIX7Rynk0A # You can replace this text with custom code or comments, and it will be preserved on regeneration -- 2.39.5