Lines 575-582
if ($op eq "additem") {
Link Here
|
575 |
# Getting a new barcode (if it is not the first iteration or the barcode we tried already exists) |
575 |
# Getting a new barcode (if it is not the first iteration or the barcode we tried already exists) |
576 |
$barcodevalue = $barcodeobj->next_value($oldbarcode) if ($i > 0 || $exist_itemnumber); |
576 |
$barcodevalue = $barcodeobj->next_value($oldbarcode) if ($i > 0 || $exist_itemnumber); |
577 |
|
577 |
|
578 |
# Putting it into the record |
578 |
# if no barcode then let's generate the error "no_next_barcode", |
579 |
if ($barcodevalue) { |
579 |
# OR if barcode still the same after 'next_value', let's use this same error to prevent infinite loop: |
|
|
580 |
if(! $barcodevalue or $barcodevalue eq $oldbarcode) { |
581 |
push @errors, "no_next_barcode"; |
582 |
$itemrecord = $record; |
583 |
last; |
584 |
} |
585 |
# Putting it into the record |
586 |
else { |
580 |
if ( C4::Context->preference("autoBarcode") eq 'hbyymmincr' && $i > 0 ) { # The first copy already contains the homebranch prefix |
587 |
if ( C4::Context->preference("autoBarcode") eq 'hbyymmincr' && $i > 0 ) { # The first copy already contains the homebranch prefix |
581 |
# This is terribly hacky but the easiest way to fix the way hbyymmincr is working |
588 |
# This is terribly hacky but the easiest way to fix the way hbyymmincr is working |
582 |
# Contrary to what one might think, the barcode plugin does not prefix the returned string with the homebranch |
589 |
# Contrary to what one might think, the barcode plugin does not prefix the returned string with the homebranch |
Lines 614-620
if ($op eq "additem") {
Link Here
|
614 |
# Preparing the next iteration |
621 |
# Preparing the next iteration |
615 |
$oldbarcode = $barcodevalue; |
622 |
$oldbarcode = $barcodevalue; |
616 |
} |
623 |
} |
617 |
undef($itemrecord); |
624 |
undef($itemrecord) if ! @errors; |
618 |
} |
625 |
} |
619 |
} |
626 |
} |
620 |
if ($frameworkcode eq 'FA' && $fa_circborrowernumber){ |
627 |
if ($frameworkcode eq 'FA' && $fa_circborrowernumber){ |
621 |
- |
|
|