From ad017572f800cd2e3f6fe4cd6f16d3605d47cec9 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 17 Dec 2024 17:05:43 +0000 Subject: [PATCH] Bug 38457: Add additional fields to debit display This patch adds the previously added additional fields to the display in the debit types management page table --- admin/debit_types.pl | 5 +++-- .../prog/en/modules/admin/debit_types.tt | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/admin/debit_types.pl b/admin/debit_types.pl index 925cbc78272..fee74815e77 100755 --- a/admin/debit_types.pl +++ b/admin/debit_types.pl @@ -43,6 +43,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +my @additional_fields = Koha::AdditionalFields->search( { tablename => 'account_debit_types' } )->as_list; +$template->param( additional_fields => \@additional_fields, ); + my $debit_type; if ($code) { $debit_type = Koha::Account::DebitTypes->find($code); @@ -68,13 +71,11 @@ if ( $op eq 'add_form' ) { }; } - my @additional_fields = Koha::AdditionalFields->search( { tablename => 'account_debit_types' } )->as_list; my @additional_field_values = $debit_type ? $debit_type->get_additional_field_values_for_template : (); $template->param( debit_type => $debit_type, branches_loop => \@branches_loop, - additional_fields => \@additional_fields, additional_field_values => @additional_field_values, ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt index f9486e7251e..9be54630ac3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt @@ -172,6 +172,9 @@ System Code Description + [% IF additional_fields.size %] + Additional fields + [% END %] Default amount Available for Library limitations @@ -185,6 +188,17 @@ [% debit_type.is_system | html %] [% debit_type.code | html %] [%- PROCESS debit_type_description debit_type = debit_type -%] + [% IF additional_fields.size %] + + [% IF debit_type.additional_field_values.count > 0 %] + [% FOREACH additional_field IN debit_type.additional_field_values %] +
[% additional_field.field.name | html %]: [% additional_field.value | html %]
+ [% END %] + [% ELSE %] + No additional fields + [% END %] + + [% END %] [% debit_type.default_amount | $Price %] [% IF debit_type.can_be_invoiced && debit_type.can_be_sold %] Invoicing, Sale -- 2.47.1