Bug 23114

Summary: Inventory: allow to scan barcodes into input field
Product: Koha Reporter: Matthias Meusburger <matthias.meusburger>
Component: ToolsAssignee: Matthias Meusburger <matthias.meusburger>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low CC: cbrannon, david, dcook, eric.begin, fridolin.somers, george, lucas, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Circulation function:
Attachments: Bug 23114 - Inventory: allow to scan barcodes
Bug 23114 - Inventory: allow to scan barcodes
Bug 23114 - Inventory: allow to scan barcodes
Bug 23114: Inventory: allow to scan barcodes
Bug 23114: (QA follow-up) Slightly rephrase message when both barcode options are used

Description Matthias Meusburger 2019-06-13 09:27:07 UTC
Currently, in the inventory tool, the user can upload a file containing barcodes.

It would be nice for the user to be able to scan barcodes as well, like in other tools (batch item modification, for example).
Comment 1 Matthias Meusburger 2019-06-26 13:04:36 UTC
Created attachment 91020 [details] [review]
Bug 23114 - Inventory: allow to scan barcodes

This patch allows the user to scan barcodes in the inventory tool
(in addition to upload a barcode file, like in other tools)

Test plan:
 1) Apply the patch.
 2) Check that you can still upload a barcode file.
 3) Check that you can scan/enter barcodes in the new textarea.
 4) Check that if you both upload a barcode file and enter barcodes,
    you will be prompted to choose only one method.
 5) Check that you can then proceed to the next step by either resetting the
    upload file input or emptying the textarea.
Comment 2 George Williams (NEKLS) 2019-07-19 21:07:27 UTC
I can still upload the barcode file.
I can scan/enter barcodes in the textarea.
I get a warning when I try to upload a file and enter barcodes scanned in the text area.
I can proceed to the next step in both cases.

But once I proceed to the next step, the uploaded file works with the inventory tool as expected.  The scanned barcodes do not - it's as if I uploaded a text file with no data in it.
Comment 3 Eric Bégin 2019-10-04 07:26:39 UTC
Applying: Bug 23114 - Inventory: allow to scan barcodes
Using index info to reconstruct a base tree...
M	tools/inventory.pl
Falling back to patching base and 3-way merge...
Auto-merging tools/inventory.pl
CONFLICT (content): Merge conflict in tools/inventory.pl
Comment 4 Matthias Meusburger 2019-10-04 07:34:42 UTC
Created attachment 93667 [details] [review]
Bug 23114 - Inventory: allow to scan barcodes

This patch allows the user to scan barcodes in the inventory tool
(in addition to upload a barcode file, like in other tools)

Test plan:
 1) Apply the patch.
 2) Check that you can still upload a barcode file.
 3) Check that you can scan/enter barcodes in the new textarea.
 4) Check that if you both upload a barcode file and enter barcodes,
    you will be prompted to choose only one method.
 5) Check that you can then proceed to the next step by either resetting the
    upload file input or emptying the textarea.
Comment 5 Matthias Meusburger 2019-10-04 07:35:04 UTC
Patch rebased.
Comment 6 Eric Bégin 2019-10-04 09:02:49 UTC
When I import the file, I get 2 messages :

[3 items modified : datelastseen set to 10/05/2019]

[Number of potential barcodes read: 3]

I don't get any of those messages using the scanned barcodes.
Comment 7 Matthias Meusburger 2020-03-24 15:27:54 UTC
*** Bug 23755 has been marked as a duplicate of this bug. ***
Comment 8 Matthias Meusburger 2020-06-17 14:57:17 UTC
Thanks for the feedback Eric.

I just tested this again on master, and I get both "datelastseen set to" and "Number of potential barcodes read" messages whether I use file upload or barcode scan.

Could you please test it again, and be more specific about the options you used to make it fail?

Thanks
Comment 9 David Nind 2020-09-25 20:48:08 UTC
Created attachment 110773 [details] [review]
Bug 23114 - Inventory: allow to scan barcodes

This patch allows the user to scan barcodes in the inventory tool
(in addition to upload a barcode file, like in other tools)

Test plan:
 1) Apply the patch.
 2) Check that you can still upload a barcode file.
 3) Check that you can scan/enter barcodes in the new textarea.
 4) Check that if you both upload a barcode file and enter barcodes,
    you will be prompted to choose only one method.
 5) Check that you can then proceed to the next step by either resetting the
    upload file input or emptying the textarea.

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 David Nind 2020-09-25 20:51:19 UTC
(In reply to Matthias Meusburger from comment #8)
> Thanks for the feedback Eric.
> 
> I just tested this again on master, and I get both "datelastseen set to" and
> "Number of potential barcodes read" messages whether I use file upload or
> barcode scan.
> 
> Could you please test it again, and be more specific about the options you
> used to make it fail?
> 
> Thanks

I managed to replicate Eric's behavour - doing a flush_memcached and restart_all (on koha-testing-docker) after applying the patch and clearing the browser cache solved this for me.
Comment 11 Katrin Fischer 2020-09-26 18:37:32 UTC
Created attachment 110793 [details] [review]
Bug 23114: Inventory: allow to scan barcodes

This patch allows the user to scan barcodes in the inventory tool
(in addition to upload a barcode file, like in other tools)

Test plan:
 1) Apply the patch.
 2) Check that you can still upload a barcode file.
 3) Check that you can scan/enter barcodes in the new textarea.
 4) Check that if you both upload a barcode file and enter barcodes,
    you will be prompted to choose only one method.
 5) Check that you can then proceed to the next step by either resetting the
    upload file input or emptying the textarea.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2020-09-26 18:37:36 UTC
Created attachment 110794 [details] [review]
Bug 23114: (QA follow-up) Slightly rephrase message when both barcode options are used

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Jonathan Druart 2020-10-01 09:44:20 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 14 Lucas Gass (lukeg) 2020-10-20 17:55:44 UTC
enhancement will not be backported to 20.05.x