Bug 43650: incremental EAN-13 barcodes produce unexpected sequence

When incremental EAN-13 barcodes are selected for autoBarcode and new item
records are created an unexpected sequence of barcode numbers is produced
instead of a sequence where the barcode is incremented by 1 between each item.
This patch fixes that by adding quote marks in the inline JS, thus treating the
barcode as a string rather than an integer :+)

Test plan:
1. have records imported from somewhere but with no items
2. autoBarcode set to incremental EAN-13 barcodes
3. create a number of new items
4. observe that the item barcodes don't follow the expected sequence
5. apply patch
6. delete item records
7. repeat step 3
8. observe that the item barcodes follow the expected sequence

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
nela 2026-09-26 18:25:30 +01:00 committed by Pedro Amorim
parent e1e08a7f5d
commit a86b7a063d
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ if (\$('#' + id).val() == '' || force) {
\$('#' + id).val(prefix + '-' + newNumberStr); \$('#' + id).val(prefix + '-' + newNumberStr);
} }
else if ( autobarcodetype == "EAN13" ) { else if ( autobarcodetype == "EAN13" ) {
\$('#' + id).val(incrementEAN13($nextnum, offset)); \$('#' + id).val(incrementEAN13('$nextnum', offset));
} }
else if ( incremental_barcode ) { else if ( incremental_barcode ) {
\$('#' + id).val($nextnum + offset); \$('#' + id).val($nextnum + offset);