@@ -, +, @@ blocked without spaces in database: SELECT barcode FROM items WHERE barcode LIKE '%XXXXX%' --- cataloguing/additem.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) --- a/cataloguing/additem.pl +++ a/cataloguing/additem.pl @@ -88,6 +88,18 @@ sub set_item_default_location { $item->store; } +sub _barcodedecode { + my ($record) = @_; + + my ($tagfield, $tagsubfield) = GetMarcFromKohaField('items.barcode'); + my $item_field = $record->field($tagfield); + my $barcode = $item_field->subfield($tagsubfield); + if ($barcode) { + $barcode = barcodedecode($barcode); + $item_field->update($tagsubfield => $barcode); + } +} + # NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code # NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript sub _increment_barcode { @@ -511,6 +523,8 @@ if ($op eq "additem") { $add_duplicate_submit = 1 if ($prefillitem); $justaddeditem = 1; + _barcodedecode($record); + # if autoBarcode is set to 'incremental', calculate barcode... if ( C4::Context->preference('autoBarcode') eq 'incremental' ) { $record = _increment_barcode($record, $frameworkcode); --