Lines 444-477
if ($barcode) {
Link Here
|
444 |
} |
444 |
} |
445 |
for my $missing_item ( keys %{$expected_items} ) { |
445 |
for my $missing_item ( keys %{$expected_items} ) { |
446 |
my $bundle_item = $expected_items->{$missing_item}; |
446 |
my $bundle_item = $expected_items->{$missing_item}; |
447 |
$bundle_item->itemlost($BundleLostValue)->store(); |
447 |
# Mark as lost if it's not already lost |
448 |
# Add return_claim record if this is an actual checkin |
448 |
if ( !$bundle_item->itemlost ) { |
449 |
if ($issue) { |
449 |
$bundle_item->itemlost($BundleLostValue)->store(); |
450 |
$bundle_item->_result->create_related( |
450 |
|
451 |
'return_claims', |
451 |
# Add return_claim record if this is an actual checkin |
452 |
{ |
452 |
if ($issue) { |
453 |
issue_id => $issue->issue_id, |
453 |
$bundle_item->_result->create_related( |
454 |
itemnumber => $bundle_item->itemnumber, |
454 |
'return_claims', |
455 |
borrowernumber => $issue->borrowernumber, |
455 |
{ |
456 |
created_by => C4::Context->userenv()->{number}, |
456 |
issue_id => $issue->issue_id, |
457 |
created_on => dt_from_string |
457 |
itemnumber => $bundle_item->itemnumber, |
458 |
} |
458 |
borrowernumber => $issue->borrowernumber, |
459 |
); |
459 |
created_by => C4::Context->userenv()->{number}, |
460 |
} |
460 |
created_on => dt_from_string |
461 |
push @missing_items, $bundle_item; |
461 |
} |
462 |
# NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout |
462 |
); |
463 |
# and thus would not get charged.. it's checked out as part of the bundle. |
463 |
} |
464 |
if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) { |
464 |
push @missing_items, $bundle_item; |
465 |
C4::Accounts::chargelostitem( |
465 |
|
466 |
$issue->borrowernumber, |
466 |
# NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout |
467 |
$bundle_item->itemnumber, |
467 |
# and thus would not get charged.. it's checked out as part of the bundle. |
468 |
$bundle_item->replacementprice, |
468 |
if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) { |
469 |
sprintf( "%s %s %s", |
469 |
C4::Accounts::chargelostitem( |
470 |
$bundle_item->biblio->title || q{}, |
470 |
$issue->borrowernumber, |
471 |
$bundle_item->barcode || q{}, |
471 |
$bundle_item->itemnumber, |
472 |
$bundle_item->itemcallnumber || q{}, |
472 |
$bundle_item->replacementprice, |
473 |
), |
473 |
sprintf( "%s %s %s", |
474 |
); |
474 |
$bundle_item->biblio->title || q{}, |
|
|
475 |
$bundle_item->barcode || q{}, |
476 |
$bundle_item->itemcallnumber || q{}, |
477 |
), |
478 |
); |
479 |
} |
475 |
} |
480 |
} |
476 |
} |
481 |
} |
477 |
$template->param( |
482 |
$template->param( |