Bug 7992 - new plugin about Automatic Number incrementing inventory. Prefix management from a authorised values list
Summary: new plugin about Automatic Number incrementing inventory. Prefix management f...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-23 07:46 UTC by delaye
Modified: 2013-05-23 06:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 7992: Specific plugin stocknumberam123 improvements (4.34 KB, patch)
2012-05-03 13:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7992: Specific plugin stocknumberam123 improvements (4.32 KB, patch)
2012-06-01 08:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7992: Followup use ajax with jQuery instead of YUI (2.66 KB, patch)
2012-08-14 10:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7992: Followup: Rename the plugin stocknumberam123 with stocknumberAV (2.53 KB, patch)
2012-08-30 13:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7992: New plugin stocknumberamAV (4.79 KB, patch)
2012-08-30 13:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7992: New plugin stocknumberAV (4.79 KB, patch)
2012-08-30 13:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7992: New plugin stocknumberAV (5.55 KB, patch)
2012-08-30 14:12 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description delaye 2012-04-23 07:46:28 UTC
The plugin koha about the Automatic Number incrementing inventory are not perfect
So I suggest a new plugin which offers more opportunities.

Automatic Number incrementing inventory. Prefix management from a authorised values list

1 / Create a list of authorised values(INVENTORY_NUMBER). In which the code is the prefix and the description the last number assigned.

2/A space between the prefix and number.


3 / From a holding record, after indicate the prefix when you click on the plugin -> koha search the last number from authorised values assigned in the list ​​and increment n +1 level meter (description)
Comment 1 Jonathan Druart 2012-05-03 13:24:03 UTC Comment hidden (obsolete)
Comment 2 delaye 2012-05-07 10:30:00 UTC
I tested from a sandbox

I associated the plugin stocknumberam123.pl at 995$a -> stocknumber
I created a list of authorised values INVENTORY
But since the item record i can't update the 995$a , i can't write the prefix and when i want use the plugin no action
Comment 3 Jonathan Druart 2012-06-01 08:48:45 UTC Comment hidden (obsolete)
Comment 4 Frédéric Demians 2012-07-10 04:41:16 UTC
This patch uses YUI to send a asynchronous HTTP request. But YUI is
about to be replaced completly by jQuery + jQuery UI. Could you switch
from YUI to jQuery?
Comment 5 Jonathan Druart 2012-08-14 10:18:17 UTC Comment hidden (obsolete)
Comment 6 Jared Camins-Esakov 2012-08-28 02:32:12 UTC
Could you please provide a test plan for this? I can't quite understand what it is supposed to do.
Comment 7 Jonathan Druart 2012-08-28 08:34:22 UTC
Test plan:
- Link a field with the plugin stocknumber_am123 (eg. 995$j)
- add an authorised value for the category INVENTORY (eg PREFIX) with a value in the description field (eg. 50)
- In the cataloguing module, add a biblio and fill the field with 'PREFIX' and click on the plugin link.
The field must be filled with the string "PREFIX 0000000051"
Comment 8 Jared Camins-Esakov 2012-08-28 12:28:15 UTC
I just tried this with the following configuration:
1. Link plugin to 952$p
2. Create an authorized value in the INVENTORY category called 'PR' with the description '0000087'

When I clicked the plugin, it did not populate the field. Any idea what I might have done wrong? Also, I have a question: what if you have multiple authorized value in the INVENTORY category?
Comment 9 delaye 2012-08-28 13:02:35 UTC
You can specify multiple values ​​(prefix) under the category INVENTORY. Each prefix has his  counter indicates in description field.

it is not necessary to specify in description 0000. Specify 87 instead of 0000087
Comment 10 Katrin Fischer 2012-08-29 17:22:35 UTC
I am wondering if this change will cause problems for people already using the older version of the plugin. Could it make sense to give it a new name?
Comment 11 Jared Camins-Esakov 2012-08-30 01:20:22 UTC
(In reply to comment #9)
> You can specify multiple values ​​(prefix) under the category INVENTORY.
> Each prefix has his  counter indicates in description field.

How do you choose which prefix is being used?

> it is not necessary to specify in description 0000. Specify 87 instead of
> 0000087

The plugin should still work if there are leading 0s, I think, and I don't see any code that tells the plugin to ignore them.
Comment 12 Jonathan Druart 2012-08-30 08:03:22 UTC
(In reply to comment #11)
> How do you choose which prefix is being used?
You have to enter your prefix before to click on the plugin link

> The plugin should still work if there are leading 0s, I think, and I don't
> see any code that tells the plugin to ignore them.
I have just to test and it works. (VA, INVENTORY, new, value = PREFIX, desc = 0000000051, cataloguing, fill PREFIX into 995$j, click on the link, the field is filled with "PREFIX 0000000052")


(In reply to comment #10)
> I am wondering if this change will cause problems for people already using
> the older version of the plugin. Could it make sense to give it a new name?
It is not the same behaviour. This plugin is not here to replace the currently one.
Comment 13 delaye 2012-08-30 08:34:00 UTC
The interest of the new plugin is that it will not search in the database items what is the last stocknumber  but it will control the last stcknumber in authorised values.
This mode of control is different avoids errors increment especially after a data migration where it can be seen that the dialing mode was not consistent. The old plugin can not "fix" while the solution proposed by the authorised values ​​to restart the numbering consistently. And enables simpler and more effective control of the incrementation through the VA

Regarding the name of the plugin I agree to change
Comment 14 delaye 2012-08-30 08:41:43 UTC
i propose  : as new name - > stocknumberAV
AV : authorised values
Comment 15 Jared Camins-Esakov 2012-08-30 10:51:41 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > How do you choose which prefix is being used?
> You have to enter your prefix before to click on the plugin link

Thank you. This is the step I was missing.
Comment 16 Katrin Fischer 2012-08-30 10:53:07 UTC
Hi Stephane - the new name makes sense to me :) I think the descriptions sounds really good and will add some interesting functionality, I was only worried about overwriting an existant script.
Comment 17 Jared Camins-Esakov 2012-08-30 11:58:27 UTC
I just tested it, and it works great. Actually, this is functionality I've been needing. A signoff is yours if you do a follow-up or revised patch changing the name of the plugin.
Comment 18 Jonathan Druart 2012-08-30 13:07:51 UTC Comment hidden (obsolete)
Comment 19 Jared Camins-Esakov 2012-08-30 13:12:32 UTC
The problem here is that we already have a stocknumberam123 plugin, so this revised plugin needs to be called stocknumberAV, and the existing stocknumberam123 needs to be kept. With your permission, I will remove the updatedatabase stanza, and re-add the stocknumberam123 plugin in the third follow-up.
Comment 20 Jared Camins-Esakov 2012-08-30 13:15:44 UTC
To clarify, I meant amending the follow-up that you just attached. We don't want to change the functionality from under the feet of libraries currently using it.
Comment 21 Jonathan Druart 2012-08-30 13:18:10 UTC
Hum, and we will have 3 plugins for stocknumber ? :)
Comment 22 Katrin Fischer 2012-08-30 13:20:53 UTC
Why not? :)
Comment 23 Jonathan Druart 2012-08-30 13:31:16 UTC Comment hidden (obsolete)
Comment 24 Jonathan Druart 2012-08-30 13:33:04 UTC Comment hidden (obsolete)
Comment 25 delaye 2012-08-30 13:50:28 UTC
the plugin stocknumberam123 already installed does not work. probably a mistake. we must keep the plugin  stocknumber then add stocknumberAV related bz7992
and delete the stocknumberam123
Comment 26 Jared Camins-Esakov 2012-08-30 13:58:52 UTC
(In reply to comment #25)
> the plugin stocknumberam123 already installed does not work. probably a
> mistake. we must keep the plugin  stocknumber then add stocknumberAV related
> bz7992
> and delete the stocknumberam123

I'd suggest that removing the plugin should be done on a different bug.
Comment 27 Jared Camins-Esakov 2012-08-30 14:12:15 UTC
Created attachment 11897 [details] [review]
Bug 7992: New plugin stocknumberAV

Bugzilla description (from delaye):
1 / Create a list of authorised values(INVENTORY_NUMBER). In which the
code is the prefix and the description the last number assigned.

2/A space between the prefix and number.

3 / From a holding record, after indicate the prefix when you click on
the plugin -> koha search the last number from authorised values
assigned in the list and increment n +1 level meter

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Works as advertised (see provisos below). Tested the following:
1) INVENTORY category has only authorised value 'PR' => PR prefix filled
   in, everything else gives an error.
2) INVENTORY category has two authorised values, both work.
3) INVENTORY category has no authorised values, nothing is incremented
4) Barcode contains numbers, nothing is changed.
Two potential gotchas (neither of them significant enough to warrant
changing, in my opinion):
1) Prefixes must consist only of uppercase alphabetical characters.
2) Negative numbers are padded with zeros to the left of the negative
   sign.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Comment 28 delaye 2012-08-31 08:37:50 UTC
for information 

There are 3 plugin
stocknumber
stocknumberam123
and
stocknumberAV

What is the difference?

stocknumber : add the branch code (branch connection) as prefix in the inventory number (eg MED_00006).

stocknumberam123 plugin: in the item record you add a prefix of your choice followed by a space then the number is added . There is a control in the database items. 

stocknumberAV: in the item record you add a prefix who was specified authorised value (INVENTORY) then the number is added. There is a control in the authorised values (INVENTORY).
Comment 29 Paul Poulain 2012-10-02 15:20:54 UTC
QA comment
 * 0 side effect risk, cataloguing plugin independant from anything else
 * passes koha-qa.pl
 * documentation included

Passes QA
Comment 30 Paul Poulain 2012-10-02 15:21:46 UTC
Patch pushed to master

Version changed = no reason to put it in 3.8 (but no risk as well, so, chris_c, your choice ;-) )