From e8e1eb3d12d13e5dbd1b64a879aae0ac02e4d13c 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 --- Payments --- 8) Visit the transactions table, you should have at least 1 invoice from the above instructions: /cgi-bin/koha/members/boraccount.pl?borrowernumber=51 9) On the invoice table row, click "Pay" 10) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 11) Repeat step 1: go back to the transactions table 12) Click the 'details' of the payment row. Notice the fields are all there, repeated fields comma separated. 13) Create a new manual invoice again (step 7) 14) Visit "Make a payment", visit: /cgi-bin/koha/members/pay.pl?borrowernumber=51 15) Click "write off" 16) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 17) Go back to the transactions, visit: /cgi-bin/koha/members/boraccount.pl?borrowernumber=51 18) Click the 'details' of the writeoff row. Notice the additional fields are NOT there. This is a bug not caused by this development. See bug 35080 --- .../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 894e712799..4b1a475f0e 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 @@ -133,16 +132,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 %]