From 0d8baf96060ff423746cd259d05b4574b0ef2b55 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 Signed-off-by: Martin Renvoize --- .../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 548937f3d0..558a9d5066 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 @@ -68,7 +68,6 @@ [% IF accountline %]
- [% af_values = accountline.additional_field_values %] [% IF accountline.credit_type_code %]

Details of credit

[% ELSIF accountline.debit_type_code %] @@ -84,8 +83,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 @@ -135,16 +134,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 4370a043ed..f8f9eb3168 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt @@ -136,6 +136,7 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] + [% Asset.js("js/additional-fields-entry.js") | $raw %]