From 1c27e2dcb83164d013614c1036997d7ab0ca6321 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 17 Dec 2024 16:19:18 +0000 Subject: [PATCH] Bug 38457: DBIC Add AdditionalFields to AccountDebitType Sponsored-by: PTFS Europe Signed-off-by: Hannah Dunne-Howrie Signed-off-by: Laura_Escamilla --- Koha/Schema/Result/AccountDebitType.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Koha/Schema/Result/AccountDebitType.pm b/Koha/Schema/Result/AccountDebitType.pm index 127ee82ef80..0d817b9453c 100644 --- a/Koha/Schema/Result/AccountDebitType.pm +++ b/Koha/Schema/Result/AccountDebitType.pm @@ -148,6 +148,22 @@ __PACKAGE__->has_many( # Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-01-10 14:49:18 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9+mMPMSWcc/PwryYNQ2Jqg +__PACKAGE__->has_many( + "additional_field_values", + "Koha::Schema::Result::AdditionalFieldValue", + sub { + my ($args) = @_; + + return { + "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.code" }, + + "$args->{foreign_alias}.field_id" => + { -in => \'(SELECT id FROM additional_fields WHERE tablename="account_debit_types")' }, + }; + }, + { cascade_copy => 0, cascade_delete => 0 }, +); + __PACKAGE__->add_columns( '+archived' => { is_boolean => 1 }, '+is_system' => { is_boolean => 1 }, -- 2.49.0