From 5cb0680f1689c7d8064f8b7483f764414bc07f7a Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 20 Feb 2025 12:46:01 +0000 Subject: [PATCH] Bug 39177: DBIC Add AdditionalFields to AccountCreditType Sponsored-by: PTFS Europe Signed-off-by: Hannah Dunne-Howrie Signed-off-by: Brendan Gallagher --- Koha/Schema/Result/AccountCreditType.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Koha/Schema/Result/AccountCreditType.pm b/Koha/Schema/Result/AccountCreditType.pm index 2a30f213bb9..b466e29e53a 100644 --- a/Koha/Schema/Result/AccountCreditType.pm +++ b/Koha/Schema/Result/AccountCreditType.pm @@ -134,6 +134,22 @@ __PACKAGE__->add_columns( '+archived' => { is_boolean => 1 } ); +__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_credit_types")' }, + }; + }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 koha_objects_class Missing POD for koha_objects_class. -- 2.49.0