Lines 139-144
$template->param(branchloop => \@branch_loop,
Link Here
|
139 |
datelastseen => $datelastseen, |
139 |
datelastseen => $datelastseen, |
140 |
); |
140 |
); |
141 |
my @brcditems; |
141 |
my @brcditems; |
|
|
142 |
my @errorloop; |
142 |
if ($uploadbarcodes && length($uploadbarcodes)>0){ |
143 |
if ($uploadbarcodes && length($uploadbarcodes)>0){ |
143 |
my $dbh=C4::Context->dbh; |
144 |
my $dbh=C4::Context->dbh; |
144 |
my $date = format_date_in_iso($input->param('setdate')) || C4::Dates->today('iso'); |
145 |
my $date = format_date_in_iso($input->param('setdate')) || C4::Dates->today('iso'); |
Lines 147-153
if ($uploadbarcodes && length($uploadbarcodes)>0){
Link Here
|
147 |
my $qonloan = $dbh->prepare($strsth); |
148 |
my $qonloan = $dbh->prepare($strsth); |
148 |
$strsth="select * from items where items.barcode =? and items.wthdrawn = 1"; |
149 |
$strsth="select * from items where items.barcode =? and items.wthdrawn = 1"; |
149 |
my $qwthdrawn = $dbh->prepare($strsth); |
150 |
my $qwthdrawn = $dbh->prepare($strsth); |
150 |
my @errorloop; |
|
|
151 |
my $count=0; |
151 |
my $count=0; |
152 |
while (my $barcode=<$uploadbarcodes>){ |
152 |
while (my $barcode=<$uploadbarcodes>){ |
153 |
$barcode =~ s/\r?\n$//; |
153 |
$barcode =~ s/\r?\n$//; |
Lines 225-233
if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){
Link Here
|
225 |
); |
225 |
); |
226 |
$csv->combine(qw / title author barcode itemnumber homebranch location itemcallnumber notforloan lost damaged /); |
226 |
$csv->combine(qw / title author barcode itemnumber homebranch location itemcallnumber notforloan lost damaged /); |
227 |
print $csv->string, "\n"; |
227 |
print $csv->string, "\n"; |
|
|
228 |
my @keys = qw / title author barcode itemnumber homebranch location itemcallnumber notforloan lost damaged /; |
228 |
for my $re (@$res){ |
229 |
for my $re (@$res){ |
229 |
my @line; |
230 |
my @line; |
230 |
for my $key ( qw / title author barcode itemnumber homebranch location itemcallnumber notforloan itemlost damaged / ) { |
231 |
for my $key (@keys) { |
231 |
given ( $key ) { |
232 |
given ( $key ) { |
232 |
when ( /notforloan/ ) { |
233 |
when ( /notforloan/ ) { |
233 |
push @line, GetAuthorisedValueDesc('', '', $re->{$key}, '', '', 'NOT_LOAN', ''); |
234 |
push @line, GetAuthorisedValueDesc('', '', $re->{$key}, '', '', 'NOT_LOAN', ''); |
Lines 248-253
if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){
Link Here
|
248 |
$csv->combine(@line); |
249 |
$csv->combine(@line); |
249 |
print $csv->string, "\n"; |
250 |
print $csv->string, "\n"; |
250 |
} |
251 |
} |
|
|
252 |
# Adding not found barcodes |
253 |
foreach my $error (@errorloop) { |
254 |
my @line; |
255 |
if ($error->{'ERR_BARCODE'}) { |
256 |
push @line, map { $_ eq 'barcode' ? $error->{'barcode'} : ''} @keys; |
257 |
push @line, "barcode not found"; |
258 |
$csv->combine(@line); |
259 |
print $csv->string, "\n"; |
260 |
} |
261 |
} |
262 |
|
251 |
exit; |
263 |
exit; |
252 |
} |
264 |
} |
253 |
|
265 |
|
254 |
- |
|
|