@@ -, +, @@ --- Koha/Schema/Result/Accountline.pm | 19 ++++++++++++++-- Koha/Schema/Result/ArticleRequest.pm | 34 ++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 4 deletions(-) --- a/Koha/Schema/Result/Accountline.pm +++ a/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 --- a/Koha/Schema/Result/ArticleRequest.pm +++ a/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 --