Bug 32819

Summary: Fix cataloguing/value_builder/stocknumberam123.pl
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: CatalogingAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: arthur.suzuki, david, lucas, m.de.rooy, wainuiwitikapark
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04,22.05.11,21.11.19
Bug Depends on:    
Bug Blocks: 30975    
Attachments: Bug 32819: Fix cataloguing/value_builder/stocknumberam123.pl
Bug 32819: Fix cataloguing/value_builder/stocknumberam123.pl
Bug 32819: Fix cataloguing/value_builder/stocknumberam123.pl

Description Julian Maurice 2023-02-03 11:41:00 UTC
This is part of the refactoring happening in bug 30975
Comment 1 Julian Maurice 2023-02-03 11:42:03 UTC
Created attachment 146077 [details] [review]
Bug 32819: Fix cataloguing/value_builder/stocknumberam123.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before
Comment 2 David Nind 2023-02-08 19:45:24 UTC
Created attachment 146409 [details] [review]
Bug 32819: Fix cataloguing/value_builder/stocknumberam123.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2023-02-08 19:52:30 UTC
Testing notes (using KTD):

1. Added stocknumberam123.pl as a plugin to 952$i for the BKS framework (MARC21).
2. Adding an inventory number with a prefix:
   2.1 Add "PREFIX 0009678570" to an item for a record
   2.3 Add "PREFIX" to another item for a different record
   2.4 Click the three dots
   ==> Incremented and PREFIX 0009678571 added to the item
3. Adding a numerical inventory number:
   3.1 Add 0009000000 to an item for a record
   3.2 For another item for another record without a 952$i value, click the three dots
   ==> Number incremented and 0009000001 added to the item


Description of plugin
~~~~~~~~~~~~~~~~~~~~~

This plugin is specific to AM123 but could be used as a base for similar operations.
It is used for stocknumber computation.
 
If the user send an empty string, we return a simple incremented stocknumber.
If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented.
In this case, a stocknumber has this form : "PREFIX 0009678570".
- PREFIX is an upercase word
- a space separator
- 10 digits, with leading 0s if needed
Comment 4 Nick Clemens (kidclamp) 2023-03-03 19:08:00 UTC
Created attachment 147725 [details] [review]
Bug 32819: Fix cataloguing/value_builder/stocknumberam123.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi 2023-03-06 12:49:06 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 6 Jacob O'Mara 2023-03-07 18:28:08 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 7 Lucas Gass 2023-03-10 17:26:29 UTC
Backported to 22.05.x for upcoming 22.05.11
Comment 8 Arthur Suzuki 2023-03-29 14:37:11 UTC
applied to 21.11 for 21.11.19
Comment 9 wainuiwitikapark 2023-04-27 05:43:22 UTC
Not backported to 21.05.x