Bug 23851 - Auto generate accession number format <branchcode>yymm0001 fails to add branchcode prefix(branchcode) for multiple item addition
Summary: Auto generate accession number format <branchcode>yymm0001 fails to add branc...
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
: 4175 15239 23270 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-21 10:32 UTC by Abhi
Modified: 2019-11-15 10:24 UTC (History)
9 users (show)

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


Attachments
Multiple items added in the catalog, with branchcode missing from barcode prefix (112.36 KB, image/png)
2019-10-21 10:32 UTC, Abhi
Details
Bug 23851: Add the homebranch prefix to the barcode when adding multiple copies of an items (2.16 KB, patch)
2019-10-22 09:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23851: Add the homebranch prefix to the barcode when adding multiple copies of an items (2.21 KB, patch)
2019-11-02 21:49 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23851: Add the homebranch prefix to the barcode when adding multiple copies of an items (2.31 KB, patch)
2019-11-08 11:27 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Abhi 2019-10-21 10:32:33 UTC
Created attachment 94430 [details]
Multiple items added in the catalog, with branchcode missing from barcode prefix

When selected autoBarcode format to <branchcode>yymm0001 and trying to add multiple items from the item addition form the items get added but the barcode (p - Accession Number) field does not contain branch code prefix and only the 0001 segment gets incremented.

This is in case if branchcode is in Char format eg. <BLR>yymm0001
Comment 1 Jonathan Druart 2019-10-22 09:24:58 UTC
Lowering severity.
Comment 2 Jonathan Druart 2019-10-22 09:40:27 UTC
Created attachment 94519 [details] [review]
Bug 23851: Add the homebranch prefix to the barcode when adding multiple copies of an items

See the comment in the code for more information.

Test plan:
- Set autoBarcode to hbyymmincr
- Create an item and click on the barcode field
- A barcode prefixed by the homebranch is generated
- Click the "Add multiple copies of this item" and enter 4
- Save
=> Without this patch only the first item has the homebranch prefix
=> With this patch applied they all have a barcode in the same format
Comment 3 Katrin Fischer 2019-11-02 21:29:06 UTC
*** Bug 23270 has been marked as a duplicate of this bug. ***
Comment 4 Katrin Fischer 2019-11-02 21:48:38 UTC
*** Bug 4175 has been marked as a duplicate of this bug. ***
Comment 5 Katrin Fischer 2019-11-02 21:49:12 UTC
Created attachment 94974 [details] [review]
Bug 23851: Add the homebranch prefix to the barcode when adding multiple copies of an items

See the comment in the code for more information.

Test plan:
- Set autoBarcode to hbyymmincr
- Create an item and click on the barcode field
- A barcode prefixed by the homebranch is generated
- Click the "Add multiple copies of this item" and enter 4
- Save
=> Without this patch only the first item has the homebranch prefix
=> With this patch applied they all have a barcode in the same format

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2019-11-02 21:49:31 UTC
3 bugs for the price of one sign-off... a good deal I'd say :)
Comment 7 Katrin Fischer 2019-11-02 21:56:18 UTC
*** Bug 15239 has been marked as a duplicate of this bug. ***
Comment 8 Marcel de Rooy 2019-11-08 11:27:43 UTC
Created attachment 95208 [details] [review]
Bug 23851: Add the homebranch prefix to the barcode when adding multiple copies of an items

See the comment in the code for more information.

Test plan:
- Set autoBarcode to hbyymmincr
- Create an item and click on the barcode field
- A barcode prefixed by the homebranch is generated
- Click the "Add multiple copies of this item" and enter 4
- Save
=> Without this patch only the first item has the homebranch prefix
=> With this patch applied they all have a barcode in the same format

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2019-11-08 11:28:09 UTC
(In reply to Katrin Fischer from comment #6)
> 3 bugs for the price of one sign-off... a good deal I'd say :)

No good deal, this is horrible code ;)
Comment 10 Martin Renvoize 2019-11-08 12:56:59 UTC
Nice work!

Pushed to master for 19.11.00
Comment 11 Tomás Cohen Arazi 2019-11-08 18:28:49 UTC
Thanks for this fix! It is present in 18.11 also.
Comment 12 Fridolin SOMERS 2019-11-15 10:24:12 UTC
Pushed to 19.05.x for 19.05.05

# This is terribly hacky :'(