Bug 21937: Add test to show autoBarcode annual increment bug
authorFrédéric Demians <f.demians@tamil.fr>
Mon, 3 Dec 2018 17:27:08 +0000 (18:27 +0100)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 19 Apr 2019 14:32:17 +0000 (14:32 +0000)
This patch show the issue. If the DB contains a barcode (not auto attributed
by Koha) which begin with the year used to generate automatically a new one,
there may be a 'collision'.

prove -v t/db_dependent/Barcodes_ValueBuilder.t

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

t/db_dependent/Barcodes_ValueBuilder.t

index a116b45..7573bbd 100644 (file)
@@ -49,6 +49,12 @@ my $item_2 = $builder->build({
 my $item_3 = $builder->build({
     source => 'Item',
     value => {
+        barcode => '201200345'
+    }
+});
+my $item_4 = $builder->build({
+    source => 'Item',
+    value => {
         barcode => '2012-0034'
     }
 });