From 2414ab9e96483ee9a690a49850e620d79ecc4033 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 8 Nov 2021 15:31:42 -0300 Subject: [PATCH] Bug 27946: DBIC schema changes [DO NOT PUSH] Signed-off-by: Tomas Cohen Arazi --- 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..7630f3d4a3 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 @ 2021-10-27 16:31:24 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cdyoy7MLvk3m3mepmt0z0A =head2 library diff --git a/Koha/Schema/Result/ArticleRequest.pm b/Koha/Schema/Result/ArticleRequest.pm index ee317ad34f..d602f1c31c 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 @ 2021-10-27 16:31:24 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BXZSJpfb/iXZFpNK0JgUsg # You can replace this text with custom code or comments, and it will be preserved on regeneration -- 2.32.0