Bug 6448 [2/3] Barcodes::EAN13 autoBarcode
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 28 Mar 2012 12:43:35 +0000 (14:43 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Thu, 2 Aug 2012 16:41:44 +0000 (18:41 +0200)
commit28e5427c600a2cfcf20c294713eb625b4b967f3a
tree9cf60d303930bb983177776cb9f8dd50cad305be
parent089b1151f5d9222e7171060b9d352e2a22a1be2b
Bug 6448 [2/3] Barcodes::EAN13 autoBarcode

Implement auto-incrementing EAN-13 barcodes

To make this work, C4::Barcodes::next was modified to call process_tail with
new incremented value so that process_tail can generate correct checksum.
Since process_tail is currenlty not used by any barcodes, this change is safe.

C4::Barcodes is used by addbiblio.pl when adding multiple records, while value_builder
is used in all other cases.

Test scenario:

1. prove t/Barcodes_EAN13.t

2. KOHA_CONF=/etc/koha/sites/fer/koha-conf.xml prove t/db_dependent/Barcodes.t
   this will check C4::Barcode implementataion

3. in systempreference change autoBarcode to incremental EAN-13 barcode

4. edit two items of any biblio assigning barcodes and verify that numbers
   are increasing. Have in mind that last digit is check digit, and it
   doesn't increment, but is calculated from barcode itself. Example with
   checksum in brackets: 000000086275[2], 000000086276[9], 000000086277[6]

5. Add Item and verify that it gets assigned next barcode

6. Add & Duplicate item and verify barcode increase

7. Add Multiple Copies and verify that barcode increase for each copy

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Barcodes.pm
C4/Barcodes/EAN13.pm [new file with mode: 0644]
cataloguing/value_builder/barcode.pl
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
t/Barcodes_EAN13.t [new file with mode: 0755]
t/db_dependent/Barcodes.t