Bug 15042: Barcode hbyymmincr does not work when receiving serials
authorMagnus Enger <magnus@libriotech.no>
Wed, 21 Oct 2015 11:11:28 +0000 (13:11 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 22 Oct 2015 13:38:50 +0000 (10:38 -0300)
To test:
- Set autoBarcode = <branchcode>yymm0001
- Make sure you have a serial that is set to "create an item record
  when receiving this serial"
- Receive an issue
- Click in the barcode field - nothing happens
- Apply patch and reload page
- Receive an issue
- Click in the barcode field - a barcode conforming to the
  hbyymmincr setting appears

Patch works as advertised.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

C4/Barcodes/ValueBuilder.pm

index c8cfe59..81747de 100644 (file)
@@ -62,6 +62,9 @@ sub get_barcode {
     my $scr = "
         var form = document.getElementById('f');
         if ( !form ) {
+            form = document.getElementById('serials_edit');
+        }
+        if ( !form ) {
             form = document.getElementById('Aform');
         }
         for (i=0 ; i<form.field_value.length ; i++) {