Lines 436-466
sub renew {
Link Here
|
436 |
return $trans; |
436 |
return $trans; |
437 |
} |
437 |
} |
438 |
|
438 |
|
439 |
# Previously: renewing a title, rather than an item (sort of) |
439 |
my $j = 0; |
440 |
# This is gross, but in a real ILS it would be better |
440 |
my $count = scalar @{$patron->{items}}; |
441 |
|
441 |
foreach my $i (@{$patron->{items}}) { |
442 |
# if (defined($title_id)) { |
442 |
unless (defined $i->{barcode}) { # FIXME: using data instead of objects may violate the abstraction layer |
443 |
# foreach my $i (@{$patron->{items}}) { |
443 |
syslog("LOG_ERR", "No barcode for item %s of %s: $item_id", $j+1, $count); |
444 |
# $item = new ILS::Item $i; |
444 |
next; |
445 |
# last if ($title_id eq $item->title_id); |
445 |
} |
446 |
# $item = undef; |
446 |
syslog("LOG_DEBUG", "checking item %s of %s: $item_id vs. %s", ++$j, $count, $i->{barcode}); |
447 |
# } |
447 |
if ($i->{barcode} eq $item_id) { |
448 |
# } else { |
448 |
# We have it checked out |
449 |
my $j = 0; |
449 |
$item = C4::SIP::ILS::Item->new( $item_id ); |
450 |
my $count = scalar @{$patron->{items}}; |
450 |
last; |
451 |
foreach my $i (@{$patron->{items}}) { |
451 |
} |
452 |
unless (defined $i->{barcode}) { # FIXME: using data instead of objects may violate the abstraction layer |
452 |
} |
453 |
syslog("LOG_ERR", "No barcode for item %s of %s: $item_id", $j+1, $count); |
|
|
454 |
next; |
455 |
} |
456 |
syslog("LOG_DEBUG", "checking item %s of %s: $item_id vs. %s", ++$j, $count, $i->{barcode}); |
457 |
if ($i->{barcode} eq $item_id) { |
458 |
# We have it checked out |
459 |
$item = C4::SIP::ILS::Item->new( $item_id ); |
460 |
last; |
461 |
} |
462 |
} |
463 |
# } |
464 |
|
453 |
|
465 |
$trans->item($item); |
454 |
$trans->item($item); |
466 |
|
455 |
|