Bug 35044 - Additional fields: Allow for repeatable fields
Summary: Additional fields: Allow for repeatable fields
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Pedro Amorim
QA Contact: Testopia
URL: https://github.com/PTFS-Europe/koha/t...
Keywords: Sandbox
Depends on: 35073 35197
Blocks: 32751 35287 35451 35625
  Show dependency treegraph
 
Reported: 2023-10-12 11:36 UTC by Pedro Amorim
Modified: 2024-04-01 09:15 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 35044: [DONT PUSH] dbic specific (2.52 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: DB changes + atomicupdate file (3.89 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Admin: New additional fields 'repeatable' field (4.68 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Preparation: (19.13 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Order baskets (4.12 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Acquisition orders (4.80 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Invoices (5.68 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions (11.58 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions batch edit (10.90 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Manual invoices, manual credits and accountlines (10.97 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Add tests (4.34 KB, patch)
2023-10-18 14:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Add repetable to REST API spec (829 bytes, patch)
2023-10-31 12:01 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: [DONT PUSH] dbic specific (2.08 KB, patch)
2023-11-06 10:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: DB changes + atomicupdate file (3.89 KB, patch)
2023-11-06 10:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Admin: New additional fields 'repeatable' field (5.03 KB, patch)
2023-11-06 10:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Preparation: (19.13 KB, patch)
2023-11-06 10:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Order baskets (4.12 KB, patch)
2023-11-06 10:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Acquisition orders (4.80 KB, patch)
2023-11-06 10:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Invoices (5.68 KB, patch)
2023-11-06 10:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions (11.64 KB, patch)
2023-11-06 10:58 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions batch edit (10.90 KB, patch)
2023-11-06 10:58 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Manual invoices, manual credits and accountlines (10.06 KB, patch)
2023-11-06 10:58 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Add tests (4.34 KB, patch)
2023-11-06 10:58 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: [DONT PUSH] dbic specific (2.08 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: DB changes + atomicupdate file (3.89 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Admin: New additional fields 'repeatable' field (5.03 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Preparation: (19.13 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Order baskets (4.12 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Acquisition orders (4.84 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Invoices (5.68 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions (11.64 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions batch edit (10.90 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Manual invoices, manual credits and accountlines (10.06 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Add repetable to REST API spec (829 bytes, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Add tests (4.34 KB, patch)
2023-11-13 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: (QA Follow-up) Fix atomicupdate (1.60 KB, patch)
2023-11-27 12:23 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: [DONT PUSH] dbic specific (2.15 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: DB changes + atomicupdate file (3.95 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Admin: New additional fields 'repeatable' field (5.10 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Preparation: (19.20 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Update: Order baskets (4.19 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Update: Acquisition orders (4.91 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Update: Invoices (5.75 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions (11.72 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions batch edit (10.97 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Update: Manual invoices, manual credits and accountlines (10.14 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Add repetable to REST API spec (896 bytes, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: Add tests (4.41 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: (QA Follow-up) Fix atomicupdate (1.67 KB, patch)
2023-12-21 10:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35044: [DONT PUSH] dbic specific (2.15 KB, patch)
2024-04-01 09:14 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: DB changes + atomicupdate file (3.95 KB, patch)
2024-04-01 09:14 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Admin: New additional fields 'repeatable' field (5.11 KB, patch)
2024-04-01 09:14 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Preparation: (19.20 KB, patch)
2024-04-01 09:14 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Order baskets (4.19 KB, patch)
2024-04-01 09:14 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Acquisition orders (6.27 KB, patch)
2024-04-01 09:14 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Invoices (5.76 KB, patch)
2024-04-01 09:14 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions (11.72 KB, patch)
2024-04-01 09:14 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Serial subscriptions batch edit (11.02 KB, patch)
2024-04-01 09:15 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Update: Manual invoices, manual credits and accountlines (10.17 KB, patch)
2024-04-01 09:15 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Add repetable to REST API spec (896 bytes, patch)
2024-04-01 09:15 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: Add tests (4.41 KB, patch)
2024-04-01 09:15 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35044: (QA Follow-up) Fix atomicupdate (1.67 KB, patch)
2024-04-01 09:15 UTC, Pedro Amorim
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2023-10-12 11:36:27 UTC
If the field is an AV field, there should be an option to allow for multiple selection.
Comment 1 Pedro Amorim 2023-10-18 14:48:31 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2023-10-18 14:48:34 UTC Comment hidden (obsolete)
Comment 3 Pedro Amorim 2023-10-18 14:48:37 UTC Comment hidden (obsolete)
Comment 4 Pedro Amorim 2023-10-18 14:48:39 UTC Comment hidden (obsolete)
Comment 5 Pedro Amorim 2023-10-18 14:48:42 UTC Comment hidden (obsolete)
Comment 6 Pedro Amorim 2023-10-18 14:48:45 UTC Comment hidden (obsolete)
Comment 7 Pedro Amorim 2023-10-18 14:48:47 UTC Comment hidden (obsolete)
Comment 8 Pedro Amorim 2023-10-18 14:48:50 UTC Comment hidden (obsolete)
Comment 9 Pedro Amorim 2023-10-18 14:48:53 UTC Comment hidden (obsolete)
Comment 10 Pedro Amorim 2023-10-18 14:48:56 UTC Comment hidden (obsolete)
Comment 11 Pedro Amorim 2023-10-18 14:48:59 UTC Comment hidden (obsolete)
Comment 12 Pedro Amorim 2023-10-31 12:01:48 UTC Comment hidden (obsolete)
Comment 13 Pedro Amorim 2023-11-06 10:57:42 UTC Comment hidden (obsolete)
Comment 14 Pedro Amorim 2023-11-06 10:57:45 UTC Comment hidden (obsolete)
Comment 15 Pedro Amorim 2023-11-06 10:57:47 UTC Comment hidden (obsolete)
Comment 16 Pedro Amorim 2023-11-06 10:57:50 UTC Comment hidden (obsolete)
Comment 17 Pedro Amorim 2023-11-06 10:57:53 UTC Comment hidden (obsolete)
Comment 18 Pedro Amorim 2023-11-06 10:57:56 UTC Comment hidden (obsolete)
Comment 19 Pedro Amorim 2023-11-06 10:57:59 UTC Comment hidden (obsolete)
Comment 20 Pedro Amorim 2023-11-06 10:58:02 UTC Comment hidden (obsolete)
Comment 21 Pedro Amorim 2023-11-06 10:58:06 UTC Comment hidden (obsolete)
Comment 22 Pedro Amorim 2023-11-06 10:58:09 UTC Comment hidden (obsolete)
Comment 23 Pedro Amorim 2023-11-06 10:58:11 UTC Comment hidden (obsolete)
Comment 24 Pedro Amorim 2023-11-06 10:59:06 UTC
Rebased on top of bug 35190
Comment 25 Pedro Amorim 2023-11-13 10:10:04 UTC
Created attachment 158857 [details] [review]
Bug 35044: [DONT PUSH] dbic specific
Comment 26 Pedro Amorim 2023-11-13 10:10:07 UTC
Created attachment 158858 [details] [review]
Bug 35044: DB changes + atomicupdate file

Add the 'repeatable' column to additional_fields
Remove the unique key from additional_field_values
as we will now be allowing for repeated instances of the same
field_id + record_id
Comment 27 Pedro Amorim 2023-11-13 10:10:10 UTC
Created attachment 158859 [details] [review]
Bug 35044: Admin: New additional fields 'repeatable' field

There is now a new 'repeatable' checkbox when configuring
(adding or editing) an additional field for a specific table.
It is also displayed in a column in the additional fields panel
for a given tablename.

MARC fields are not allowed to be repeatable.
Comment 28 Pedro Amorim 2023-11-13 10:10:13 UTC
Created attachment 158860 [details] [review]
Bug 35044: Preparation:

get_additional_field_values_for_template method

New method to be utilized for retrieval of additional fields of any
class that implements it.
This is to be used when additional_fields are needed to be sent to
.tt files for renderering. Both for form entries and read-only 'show' pages.

Template files:

Updated additional-fields-entry.inc:
Now considers entry of repeatable fields.
Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field.
Repeatable AV fields will be shown as checkboxes instead of a dropdown

Update additional-fields-display.inc
When displaying non-editable additional-fields, multiple instances for each field are now considered.
Label now only shows if field has a non-null value in it.
Option to show value_only
Option to set if its to be displayed on a table cell

Update histsearch.tt and filter-orders.inc
Now calls additional-fields-entry.inc with search_form=1 to prevent
repetable "+New" controls from showing on search inputs.

additional-fields-entry.js
New JS asset to be called by template files who require
additional-fields-entry.inc for repeatable fields controls.
This also handles the need for having the marcfield of type
'get' submitted if it is a disabled dropdown (AV marc field)
Comment 29 Pedro Amorim 2023-11-13 10:10:16 UTC
Created attachment 158861 [details] [review]
Bug 35044: Update: Order baskets

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqbasket':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable

1) Add a new basket, visit:
/cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form
2) Fill in name and all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
3) Notice the basket screen shows repeated fields separated by comma.
4) Notice that only non-null additional fields labels are shown.
5) Edit the basket. Notice all fields are shown as expected.

Additional testing:

Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows.
You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable.
Comment 30 Pedro Amorim 2023-11-13 10:10:19 UTC
Created attachment 158862 [details] [review]
Bug 35044: Update: Acquisition orders

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqorders':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c
Attempt to create a repeatable MARC field (get or set). Notice you're unable to.

1) Add a new order for an existing basket, with an existing record, visit:
/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76
2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below.
3) Notice the accounting details now have quantity:1
4) Set the mandatory "Fund" input in accounting details.
5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form.
Comment 31 Pedro Amorim 2023-11-13 10:10:22 UTC
Created attachment 158863 [details] [review]
Bug 35044: Update: Invoices

Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqinvoices':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable

1) Add a new invoice for an existing vendor, visit:
/cgi-bin/koha/acqui/parcels.pl?booksellerid=1
2) Input something in the mandatory "Vendor invoice" field.
3) Fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
4) Search for invoices, visit:
http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
5) Click "Search" on the left column of the page
6) Click the invoice we just created. Verify all the fields show correctly.
7) Go back to the additional fields configuration, set all additional fields as "searchable"
8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
9) Perform some searches using the additional fields values.
Comment 32 Pedro Amorim 2023-11-13 10:10:25 UTC
Created attachment 158864 [details] [review]
Bug 35044: Update: Serial subscriptions

Test plan, k-t-d:

Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c
Attempt to create a repeatable MARC field (get or set). Notice you're unable to.

1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Click Edit -> Edit Subscription, repeat steps 4 and 5
7) Go back to subscription additional fields, set all fields as searchable
8) Visit serials-home:
/cgi-bin/koha/serials/serials-home.pl
9) Click 'Search'
10) Notice the searchable fields now show in their columns, repeated fields separated by comma
11) Perform a search using a repeatable field, verify it all works as expected.

-- Subscription Claims --

Preparation:
1) Define a new claim notice, visit:
/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues
2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'.
3) Set a serial as late, visit our original subscription:
/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1
4) Click "Edit serials" and status -> "Late". Hit "Save".
5) Link the original subscription to the existing vendor, visit:
/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1
6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription.

Claims:
7) Visit claims:
/cgi-bin/koha/serials/claims.pl
8) Click "Ok"
9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated.
Comment 33 Pedro Amorim 2023-11-13 10:10:28 UTC
Created attachment 158865 [details] [review]
Bug 35044: Update: Serial subscriptions batch edit

Test plan, k-t-d:

Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c
Attempt to create a repeatable MARC field (get or set). Notice you're unable to.

1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Repeat steps 1-4 to create a second subscription
7) Visit serials home and hit "Search":
/cgi-bin/koha/serials/serials-home.pl
8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials"
9) Input some values in the additional fields section, click the '+New' and 'Clear' links,  hit 'Save'
10) Verify that both subscriptions now have the new values form the batch edit.
Comment 34 Pedro Amorim 2023-11-13 10:10:31 UTC
Created attachment 158866 [details] [review]
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
Comment 35 Pedro Amorim 2023-11-13 10:10:35 UTC
Created attachment 158867 [details] [review]
Bug 35044: Add repetable to REST API spec
Comment 36 Pedro Amorim 2023-11-13 10:10:38 UTC
Created attachment 158868 [details] [review]
Bug 35044: Add tests

Test plan:
prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t
Comment 37 Pedro Amorim 2023-11-13 10:11:56 UTC
Rebased on bug 34708
Comment 38 Pedro Amorim 2023-11-27 12:23:59 UTC
Created attachment 159268 [details] [review]
Bug 35044: (QA Follow-up) Fix atomicupdate

Was missing bug number and correct filename
Was checking for the wrong unique key name, existing unique key name is 'field_record',
not 'afv_fk'
Comment 39 Martin Renvoize 2023-12-21 10:28:18 UTC
Created attachment 160177 [details] [review]
Bug 35044: [DONT PUSH] dbic specific

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 40 Martin Renvoize 2023-12-21 10:28:21 UTC
Created attachment 160178 [details] [review]
Bug 35044: DB changes + atomicupdate file

Add the 'repeatable' column to additional_fields
Remove the unique key from additional_field_values
as we will now be allowing for repeated instances of the same
field_id + record_id

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 41 Martin Renvoize 2023-12-21 10:28:24 UTC
Created attachment 160179 [details] [review]
Bug 35044: Admin: New additional fields 'repeatable' field

There is now a new 'repeatable' checkbox when configuring
(adding or editing) an additional field for a specific table.
It is also displayed in a column in the additional fields panel
for a given tablename.

MARC fields are not allowed to be repeatable.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 42 Martin Renvoize 2023-12-21 10:28:27 UTC
Created attachment 160180 [details] [review]
Bug 35044: Preparation:

get_additional_field_values_for_template method

New method to be utilized for retrieval of additional fields of any
class that implements it.
This is to be used when additional_fields are needed to be sent to
.tt files for renderering. Both for form entries and read-only 'show' pages.

Template files:

Updated additional-fields-entry.inc:
Now considers entry of repeatable fields.
Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field.
Repeatable AV fields will be shown as checkboxes instead of a dropdown

Update additional-fields-display.inc
When displaying non-editable additional-fields, multiple instances for each field are now considered.
Label now only shows if field has a non-null value in it.
Option to show value_only
Option to set if its to be displayed on a table cell

Update histsearch.tt and filter-orders.inc
Now calls additional-fields-entry.inc with search_form=1 to prevent
repetable "+New" controls from showing on search inputs.

additional-fields-entry.js
New JS asset to be called by template files who require
additional-fields-entry.inc for repeatable fields controls.
This also handles the need for having the marcfield of type
'get' submitted if it is a disabled dropdown (AV marc field)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 43 Martin Renvoize 2023-12-21 10:28:31 UTC
Created attachment 160181 [details] [review]
Bug 35044: Update: Order baskets

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqbasket':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable

1) Add a new basket, visit:
/cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form
2) Fill in name and all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
3) Notice the basket screen shows repeated fields separated by comma.
4) Notice that only non-null additional fields labels are shown.
5) Edit the basket. Notice all fields are shown as expected.

Additional testing:

Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows.
You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 44 Martin Renvoize 2023-12-21 10:28:34 UTC
Created attachment 160182 [details] [review]
Bug 35044: Update: Acquisition orders

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqorders':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c
Attempt to create a repeatable MARC field (get or set). Notice you're unable to.

1) Add a new order for an existing basket, with an existing record, visit:
/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76
2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below.
3) Notice the accounting details now have quantity:1
4) Set the mandatory "Fund" input in accounting details.
5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 45 Martin Renvoize 2023-12-21 10:28:37 UTC
Created attachment 160183 [details] [review]
Bug 35044: Update: Invoices

Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqinvoices':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable

1) Add a new invoice for an existing vendor, visit:
/cgi-bin/koha/acqui/parcels.pl?booksellerid=1
2) Input something in the mandatory "Vendor invoice" field.
3) Fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
4) Search for invoices, visit:
http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
5) Click "Search" on the left column of the page
6) Click the invoice we just created. Verify all the fields show correctly.
7) Go back to the additional fields configuration, set all additional fields as "searchable"
8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
9) Perform some searches using the additional fields values.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 46 Martin Renvoize 2023-12-21 10:28:40 UTC
Created attachment 160184 [details] [review]
Bug 35044: Update: Serial subscriptions

Test plan, k-t-d:

Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c
Attempt to create a repeatable MARC field (get or set). Notice you're unable to.

1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Click Edit -> Edit Subscription, repeat steps 4 and 5
7) Go back to subscription additional fields, set all fields as searchable
8) Visit serials-home:
/cgi-bin/koha/serials/serials-home.pl
9) Click 'Search'
10) Notice the searchable fields now show in their columns, repeated fields separated by comma
11) Perform a search using a repeatable field, verify it all works as expected.

-- Subscription Claims --

Preparation:
1) Define a new claim notice, visit:
/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues
2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'.
3) Set a serial as late, visit our original subscription:
/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1
4) Click "Edit serials" and status -> "Late". Hit "Save".
5) Link the original subscription to the existing vendor, visit:
/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1
6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription.

Claims:
7) Visit claims:
/cgi-bin/koha/serials/claims.pl
8) Click "Ok"
9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 47 Martin Renvoize 2023-12-21 10:28:43 UTC
Created attachment 160185 [details] [review]
Bug 35044: Update: Serial subscriptions batch edit

Test plan, k-t-d:

Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c
Attempt to create a repeatable MARC field (get or set). Notice you're unable to.

1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Repeat steps 1-4 to create a second subscription
7) Visit serials home and hit "Search":
/cgi-bin/koha/serials/serials-home.pl
8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials"
9) Input some values in the additional fields section, click the '+New' and 'Clear' links,  hit 'Save'
10) Verify that both subscriptions now have the new values form the batch edit.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 48 Martin Renvoize 2023-12-21 10:28:47 UTC
Created attachment 160186 [details] [review]
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 <martin.renvoize@ptfs-europe.com>
Comment 49 Martin Renvoize 2023-12-21 10:28:50 UTC
Created attachment 160187 [details] [review]
Bug 35044: Add repetable to REST API spec

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 50 Martin Renvoize 2023-12-21 10:28:53 UTC
Created attachment 160188 [details] [review]
Bug 35044: Add tests

Test plan:
prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 51 Martin Renvoize 2023-12-21 10:28:56 UTC
Created attachment 160189 [details] [review]
Bug 35044: (QA Follow-up) Fix atomicupdate

Was missing bug number and correct filename
Was checking for the wrong unique key name, existing unique key name is 'field_record',
not 'afv_fk'

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 52 Martin Renvoize 2023-12-21 10:33:16 UTC
Tested thoroughly and I'm really happy with the results here.

There's one caveat, which I've already discussed with Pedro and we came to the conclusion it was a feature rather than a bug.  The repeatable implementation is all UI level, there's no check on store to prevent a non-repeatable field being repeated.. this means if you're so inclined you could carefully craft a request to add an additional field value for a field marked non-repeatable.

However, given that you can flick between repeatable/non-repeatable in the UI easily (and that doesn't cleanup existing repeated value's as we felt it least destructive to keep the data around) and you can remove existing repeated value's, but not add new ones to a newly marked non-repeatable field this covers the use cases nicely.

Signing off.
Comment 53 David Nind 2024-03-23 07:29:29 UTC
Patches no longer apply 8-(....

git bz apply 35044

Bug 35044 Depends on bug 35197 (Signed Off)
Follow? [(y)es, (n)o] y

Bug 35197 - Expose additional_field definitions through REST API

159648 - Bug 35197: Add additional_fields REST API endpoint
159649 - Bug 35197: Add tests
159650 - Bug 35197: Field name consistency

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 35197: Add additional_fields REST API endpoint
Applying: Bug 35197: Add tests
Applying: Bug 35197: Field name consistency

Bug 35044 - Additional fields: Allow for repeatable fields

160177 - Bug 35044: [DONT PUSH] dbic specific
160178 - Bug 35044: DB changes + atomicupdate file
160179 - Bug 35044: Admin: New additional fields 'repeatable' field
160180 - Bug 35044: Preparation:
160181 - Bug 35044: Update: Order baskets
160182 - Bug 35044: Update: Acquisition orders
160183 - Bug 35044: Update: Invoices
160184 - Bug 35044: Update: Serial subscriptions
160185 - Bug 35044: Update: Serial subscriptions batch edit
160186 - Bug 35044: Update: Manual invoices, manual credits and accountlines
160187 - Bug 35044: Add repetable to REST API spec
160188 - Bug 35044: Add tests
160189 - Bug 35044: (QA Follow-up) Fix atomicupdate

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 35044: [DONT PUSH] dbic specific
Applying: Bug 35044: DB changes + atomicupdate file
Applying: Bug 35044: Admin: New additional fields 'repeatable' field
Applying: Bug 35044: Preparation:
Applying: Bug 35044: Update: Order baskets
Applying: Bug 35044: Update: Acquisition orders
Using index info to reconstruct a base tree...
M	acqui/addorder.pl
M	acqui/neworderempty.pl
M	koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
Auto-merging acqui/neworderempty.pl
Auto-merging acqui/addorder.pl
CONFLICT (content): Merge conflict in acqui/addorder.pl
error: Failed to merge in the changes.
Patch failed at 0001 Bug 35044: Update: Acquisition orders
Comment 54 Pedro Amorim 2024-04-01 09:14:33 UTC
Created attachment 164162 [details] [review]
Bug 35044: [DONT PUSH] dbic specific

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 55 Pedro Amorim 2024-04-01 09:14:37 UTC
Created attachment 164163 [details] [review]
Bug 35044: DB changes + atomicupdate file

Add the 'repeatable' column to additional_fields
Remove the unique key from additional_field_values
as we will now be allowing for repeated instances of the same
field_id + record_id

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 56 Pedro Amorim 2024-04-01 09:14:40 UTC
Created attachment 164164 [details] [review]
Bug 35044: Admin: New additional fields 'repeatable' field

There is now a new 'repeatable' checkbox when configuring
(adding or editing) an additional field for a specific table.
It is also displayed in a column in the additional fields panel
for a given tablename.

MARC fields are not allowed to be repeatable.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 57 Pedro Amorim 2024-04-01 09:14:43 UTC
Created attachment 164165 [details] [review]
Bug 35044: Preparation:

get_additional_field_values_for_template method

New method to be utilized for retrieval of additional fields of any
class that implements it.
This is to be used when additional_fields are needed to be sent to
.tt files for renderering. Both for form entries and read-only 'show' pages.

Template files:

Updated additional-fields-entry.inc:
Now considers entry of repeatable fields.
Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field.
Repeatable AV fields will be shown as checkboxes instead of a dropdown

Update additional-fields-display.inc
When displaying non-editable additional-fields, multiple instances for each field are now considered.
Label now only shows if field has a non-null value in it.
Option to show value_only
Option to set if its to be displayed on a table cell

Update histsearch.tt and filter-orders.inc
Now calls additional-fields-entry.inc with search_form=1 to prevent
repetable "+New" controls from showing on search inputs.

additional-fields-entry.js
New JS asset to be called by template files who require
additional-fields-entry.inc for repeatable fields controls.
This also handles the need for having the marcfield of type
'get' submitted if it is a disabled dropdown (AV marc field)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 58 Pedro Amorim 2024-04-01 09:14:46 UTC
Created attachment 164166 [details] [review]
Bug 35044: Update: Order baskets

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqbasket':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable

1) Add a new basket, visit:
/cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form
2) Fill in name and all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
3) Notice the basket screen shows repeated fields separated by comma.
4) Notice that only non-null additional fields labels are shown.
5) Edit the basket. Notice all fields are shown as expected.

Additional testing:

Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows.
You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 59 Pedro Amorim 2024-04-01 09:14:50 UTC
Created attachment 164167 [details] [review]
Bug 35044: Update: Acquisition orders

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqorders':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c
Attempt to create a repeatable MARC field (get or set). Notice you're unable to.

1) Add a new order for an existing basket, with an existing record, visit:
/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76
2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below.
3) Notice the accounting details now have quantity:1
4) Set the mandatory "Fund" input in accounting details.
5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 60 Pedro Amorim 2024-04-01 09:14:54 UTC
Created attachment 164168 [details] [review]
Bug 35044: Update: Invoices

Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqinvoices':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable

1) Add a new invoice for an existing vendor, visit:
/cgi-bin/koha/acqui/parcels.pl?booksellerid=1
2) Input something in the mandatory "Vendor invoice" field.
3) Fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
4) Search for invoices, visit:
http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
5) Click "Search" on the left column of the page
6) Click the invoice we just created. Verify all the fields show correctly.
7) Go back to the additional fields configuration, set all additional fields as "searchable"
8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
9) Perform some searches using the additional fields values.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 61 Pedro Amorim 2024-04-01 09:14:57 UTC
Created attachment 164169 [details] [review]
Bug 35044: Update: Serial subscriptions

Test plan, k-t-d:

Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c
Attempt to create a repeatable MARC field (get or set). Notice you're unable to.

1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Click Edit -> Edit Subscription, repeat steps 4 and 5
7) Go back to subscription additional fields, set all fields as searchable
8) Visit serials-home:
/cgi-bin/koha/serials/serials-home.pl
9) Click 'Search'
10) Notice the searchable fields now show in their columns, repeated fields separated by comma
11) Perform a search using a repeatable field, verify it all works as expected.

-- Subscription Claims --

Preparation:
1) Define a new claim notice, visit:
/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues
2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'.
3) Set a serial as late, visit our original subscription:
/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1
4) Click "Edit serials" and status -> "Late". Hit "Save".
5) Link the original subscription to the existing vendor, visit:
/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1
6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription.

Claims:
7) Visit claims:
/cgi-bin/koha/serials/claims.pl
8) Click "Ok"
9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 62 Pedro Amorim 2024-04-01 09:15:01 UTC
Created attachment 164170 [details] [review]
Bug 35044: Update: Serial subscriptions batch edit

Test plan, k-t-d:

Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c
Attempt to create a repeatable MARC field (get or set). Notice you're unable to.

1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links,  hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Repeat steps 1-4 to create a second subscription
7) Visit serials home and hit "Search":
/cgi-bin/koha/serials/serials-home.pl
8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials"
9) Input some values in the additional fields section, click the '+New' and 'Clear' links,  hit 'Save'
10) Verify that both subscriptions now have the new values form the batch edit.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 63 Pedro Amorim 2024-04-01 09:15:04 UTC
Created attachment 164171 [details] [review]
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 <martin.renvoize@ptfs-europe.com>
Comment 64 Pedro Amorim 2024-04-01 09:15:08 UTC
Created attachment 164172 [details] [review]
Bug 35044: Add repetable to REST API spec

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 65 Pedro Amorim 2024-04-01 09:15:13 UTC
Created attachment 164173 [details] [review]
Bug 35044: Add tests

Test plan:
prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 66 Pedro Amorim 2024-04-01 09:15:18 UTC
Created attachment 164174 [details] [review]
Bug 35044: (QA Follow-up) Fix atomicupdate

Was missing bug number and correct filename
Was checking for the wrong unique key name, existing unique key name is 'field_record',
not 'afv_fk'

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>