Lines 503-516
sub barcode {
Link Here
|
503 |
$params{'barcode_data'} = _get_label_item($self->{'item_number'}, 1) if !$params{'barcode_data'}; |
503 |
$params{'barcode_data'} = _get_label_item($self->{'item_number'}, 1) if !$params{'barcode_data'}; |
504 |
$params{'barcode_type'} = $self->{'barcode_type'} if !$params{'barcode_type'}; |
504 |
$params{'barcode_type'} = $self->{'barcode_type'} if !$params{'barcode_type'}; |
505 |
|
505 |
|
506 |
my $enableBarcodePadding = C4::Context->preference("BarcodePaddingEnable"); |
|
|
507 |
my $paddingCharacter = C4::Context->preference("BarcodePaddingCharacter") || 0; |
506 |
my $paddingCharacter = C4::Context->preference("BarcodePaddingCharacter") || 0; |
508 |
my $paddingLength = C4::Context->preference("BarcodePaddingLength") || 0; |
507 |
my $paddingLength = C4::Context->preference("BarcodePaddingLength") || 0; |
509 |
|
508 |
|
510 |
if (length($paddingCharacter) > 1) { |
509 |
if (length($paddingCharacter) > 1) { |
511 |
$paddingCharacter = substr $paddingCharacter, 0, 1; |
510 |
$paddingCharacter = substr $paddingCharacter, 0, 1; |
512 |
} |
511 |
} |
513 |
if ($enableBarcodePadding and length($params{'barcode_data'}) < $paddingLength) { |
512 |
if (length($params{'barcode_data'}) < $paddingLength) { |
514 |
$params{'barcode_data'} = ($paddingCharacter x ($paddingLength - length($params{'barcode_data'}))) . $params{'barcode_data'}; |
513 |
$params{'barcode_data'} = ($paddingCharacter x ($paddingLength - length($params{'barcode_data'}))) . $params{'barcode_data'}; |
515 |
} |
514 |
} |
516 |
|
515 |
|