[Koha-bugs] [Bug 27426] Plugin barcode must keep leading zeros

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jan 13 17:08:04 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27426

--- Comment #1 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 115115
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115115&action=edit
Bug 27426: Keep leading zeros for barcode plugin (incremental)

If autoBarcode is set to incremental, we are generating the next barcode adding
1, but casting to integer.

If you have
"0001"
"0002"
the next barcode will be "3".

Should not we keep the leading zeros and generate "0003" instead?

This patch suggests to keep them.
If this behaviour is not the expected one we could create another
barcode plugin.

Test plan:
Create an item with barcode 0001, another one with 0002
Set autoBarcode=incremental
Create another item and click the barcode input
With this patch the new barcode will be 0003
Without this patch the barcode was cast to int and resulted in 3

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list