From 16214530766d9c8a7d6144c379dde9d1c526ba11 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 17 Oct 2023 13:02:22 +0000 Subject: [PATCH] Bug 35044: Update: Manual invoices, manual credits and accountlines Test plan, k-t-d: Preparation: Create additional fields for table 'accountlines:credit', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new manual credit for admin borrower: /cgi-bin/koha/members/mancredit.pl?borrowernumber=51 2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) On the table, click "Details" for the for account line we just created. 5) Notice the additional fields are there, repeated fields are comma separated. 6) Repeat the above test plan, but for accountlines:debit instead, visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit 7) To add a manual invoice, visit: /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51 --- .../en/modules/members/accountline-details.tt | 16 +++------------- .../prog/en/modules/members/mancredit.tt | 1 + .../prog/en/modules/members/maninvoice.tt | 1 + .../prog/en/modules/members/paycollect.tt | 1 + members/accountline-details.pl | 3 +++ members/mancredit.pl | 8 ++++---- members/maninvoice.pl | 8 ++++---- members/paycollect.pl | 16 ++++++++-------- 8 files changed, 25 insertions(+), 29 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt index ef20e355ab..45f0f65473 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt @@ -67,7 +67,6 @@ [% IF accountline %]
- [% af_values = accountline.additional_field_values %] [% IF accountline.credit_type_code %]

Details of credit

[% ELSIF accountline.debit_type_code %] @@ -83,8 +82,8 @@ Due date Return date Note - [% FOREACH value IN af_values %] - [% value.field.name | html %] + [% FOREACH field IN available_additional_fields %] + [% field.name | html %] [% END %] Amount Outstanding @@ -134,16 +133,7 @@ [% accountline.note | html_line_break %] - - [% FOREACH value IN af_values %] - - [% IF value.field.authorised_value_category %] - [% AuthorisedValues.GetByCode( value.field.authorised_value_category, value.value ) | html %] - [% ELSE %] - [% value.value | html %] - [% END %] - - [% END %] + [% INCLUDE 'additional-fields-display.inc' available=available_additional_fields values=additional_field_values value_only=1 is_table_cell=1 %] [% accountline.amount | $Price %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt index 7493987d21..0d8086000b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt @@ -134,6 +134,7 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] + [% Asset.js("js/additional-fields-entry.js") | $raw %]