View | Details | Raw Unified | Return to bug 26340
Collapse All | Expand All

(-)a/labels/label-create-pdf.pl (-13 / +4 lines)
Lines 45-51 my $start_label = $cgi->param('start_label') || 1; Link Here
45
@item_numbers  = $cgi->multi_param('item_number') if $cgi->param('item_number');
45
@item_numbers  = $cgi->multi_param('item_number') if $cgi->param('item_number');
46
my $from = $cgi->param('from') || undef;
46
my $from = $cgi->param('from') || undef;
47
my $to = $cgi->param('to') || undef;
47
my $to = $cgi->param('to') || undef;
48
my $range = $cgi->param('range') || undef;
48
my $barcode_length = $cgi->param('barcode_length');
49
49
50
my $items = undef;
50
my $items = undef;
51
51
Lines 117-134 elsif (@item_numbers) { Link Here
117
    } @item_numbers;
117
    } @item_numbers;
118
}
118
}
119
elsif ($from and $to) {
119
elsif ($from and $to) {
120
    for (my $i = $from; $i <= $to; $i++) {
120
    for my $i ( $from .. $to ) {
121
        my $compare_range = $range - length($i);
121
        my $padding = '0' x ( $barcode_length - length($i) );
122
        if ($compare_range == 0){
122
        push @$items, { item_number => $padding . $i };
123
            push @{$items}, {'item_number' => $i};
124
        } else {
125
            my $a = '';
126
            for (my $j = 1; $j <= $compare_range; $j++){
127
                $a .= '0';
128
            }
129
            $a .= $i;
130
            push @{$items}, {'item_number' => $a};
131
        }
132
    }
123
    }
133
}
124
}
134
else {
125
else {
(-)a/labels/label-print.pl (-4 / +3 lines)
Lines 55-61 my $txt_from = $cgi->param('from') || undef; Link Here
55
my $txt_to = $cgi->param('to') || undef;
55
my $txt_to = $cgi->param('to') || undef;
56
my $from = int($txt_from) || undef;
56
my $from = int($txt_from) || undef;
57
my $to = int($txt_to) || undef;
57
my $to = int($txt_to) || undef;
58
my $range = length($txt_from) || undef;
58
my $barcode_length = length($txt_from) || undef;
59
59
60
my $layouts = undef;
60
my $layouts = undef;
61
my $templates = undef;
61
my $templates = undef;
Lines 127-133 if ($op eq 'export') { Link Here
127
        push (@batches, {create_script   => 'label-create-pdf.pl',
127
        push (@batches, {create_script   => 'label-create-pdf.pl',
128
                 from            => $from,
128
                 from            => $from,
129
                 to              => $to,
129
                 to              => $to,
130
                 range           => $range,
130
                 barcode_length  => $barcode_length,
131
                 template_id     => $template_id,
131
                 template_id     => $template_id,
132
                 layout_id       => $layout_id,
132
                 layout_id       => $layout_id,
133
                 start_label     => $start_label,
133
                 start_label     => $start_label,
Lines 161-167 elsif ($op eq 'none') { Link Here
161
                    referer                     => $referer,
161
                    referer                     => $referer,
162
                    from                        => $from,
162
                    from                        => $from,
163
                    to                          => $to,
163
                    to                          => $to,
164
                    range                       => $range,
164
                    barcode_length              => $barcode_length,
165
                    txt_from                    => $txt_from,
165
                    txt_from                    => $txt_from,
166
                    txt_to                      => $txt_to
166
                    txt_to                      => $txt_to
167
                    );
167
                    );
168
- 

Return to bug 26340