Bug 7911 - Greater flexibility in auto barcode number generation
Summary: Greater flexibility in auto barcode number generation
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-06 03:24 UTC by Savitra Sirohi
Modified: 2023-08-04 19:37 UTC (History)
10 users (show)

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


Attachments
Greater flexibility in auto barcode number (5.75 KB, patch)
2012-06-06 12:04 UTC, Amit Gupta
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Savitra Sirohi 2012-04-06 03:24:47 UTC
Currently there are 3 options for barcode numbers generation - incrementing number, branch prefix, year prefix. 

Need greater flexibility:
Prefix by itype
Barcode ranges linked to itype
Comment 1 Ian Walls 2012-04-06 11:07:01 UTC
Having more barcode options is definitely a good thing.  I would recommend, however, we abstract this another level, and create barcode namespaces.  These namespaces would live in their own database table, with a unique code, and the user could create as many as they need.  Each namespace would be composed of several kinds of tokens:

- plain text: universal constants across the entire namespace.  Easy stuff.

- items.*:  meta token to retrieve the code from any of the items database fields.  Most useful for core data like homebranch, itype, ccode, stocknumber, etc

- alternate branch code:  a new field to the branches table that let's libraries specify another identifier code.  This would satisfy bug 7676.

- auto-increment numbers:  token for an integer that auto-increases by a specified value (default 1) for each new material in the namespace.  A length limiter would also need to be applied, as well as whether to zero-pad or not.

- date:  token for the date acquired, formatted using standard d,D,m,M,y,Y syntax

- checksum: a token to calculate a checksum of the rest of the namespace.  the type of checksum calculation would need to be specified (and a plugin for that calculation added to the codebase)

Other tokens as required, but I think this would cover most of our cases.
Comment 2 Amit Gupta 2012-06-06 12:04:46 UTC
Created attachment 9949 [details] [review]
Greater flexibility in auto barcode number


Add option to generate autoBarcode with itemtype as prefix
To Test:
1) Go to More->Adminstration->Global system preferences
2) Choose (generated in the form itemtypecode) under autobarcode option.
3) Create one bibliographic record and add item.
4) Click on barcode field it will generate barcode automatically for ex: BK0001
Comment 3 Marc Véron 2012-06-09 07:09:06 UTC
Would it be possible to resolve Bug 6981 "barcode not incrementing" together with this enhancement?

Problem of Bug 6981 is that numbers do not incrementing correctly after 2345678765345431 (precision problem because representation of integers change to float).
E.g. if you set the value to 2345678765345435 the form will show a value of 2345678765345441

See tests and description in Bug 6981
Comment 4 Jared Camins-Esakov 2013-01-02 02:57:37 UTC
Resetting to ASSGINED as the author set it to "Failed QA."
Comment 5 Iming Chan 2013-06-10 09:15:08 UTC
Could we also add the option of using 14-digit barcodes with Mod 10 check digit?  This barcode style is very common from other ILMS, including our old one!  Perhaps we can specify the start of the patron barcode like "2009400123456?" with the question mark (?) indicates the position of the check digit.
Comment 6 Eric Bégin 2013-10-02 19:33:52 UTC
Which options were implemented so far in the autobarcode ?

Do you still plan to release something for this ?
Comment 7 L N Mishra 2015-12-31 11:27:40 UTC
I have used the attachment of Amit Gupta for generating autobarcode (itype) but it not increment value of bar code when i save new item of same item type .
Comment 8 L N Mishra 2016-03-11 07:22:13 UTC
I have used this code it is generating barcode as item itemtype as prifix but it not work properly. For Example ---->

case 1 : suppose i select item type Book it will generate barcode BK0001 it's good.

case 2: when i add new item and this time i choose item type Computer File then it generate barcode CF0002 which is wrong because if i choose Computer File then new barcode must started with new order i mean CF0001 if it is first item in this this category and if this is second then barcode must be CF0002.

So if there is any solution of this problem kindly share this as soon as possible.
Comment 9 Katrin Fischer 2019-04-28 17:53:28 UTC
Attached patch was reported to have a problem, no action since 2016. Resetting to NEW.
Comment 10 Katrin Fischer 2023-08-04 19:37:28 UTC
Maybe instead of trying to build something configurable for an endless number of use cases, we could implement a plugin hook here instead?