Lines 404-437
if ($barcode) {
Link Here
|
404 |
} |
404 |
} |
405 |
for my $missing_item ( keys %{$expected_items} ) { |
405 |
for my $missing_item ( keys %{$expected_items} ) { |
406 |
my $bundle_item = $expected_items->{$missing_item}; |
406 |
my $bundle_item = $expected_items->{$missing_item}; |
407 |
$bundle_item->itemlost($BundleLostValue)->store(); |
407 |
# Mark as lost if it's not already lost |
408 |
# Add return_claim record if this is an actual checkin |
408 |
if ( !$bundle_item->itemlost ) { |
409 |
if ($issue) { |
409 |
$bundle_item->itemlost($BundleLostValue)->store(); |
410 |
$bundle_item->_result->create_related( |
410 |
|
411 |
'return_claims', |
411 |
# Add return_claim record if this is an actual checkin |
412 |
{ |
412 |
if ($issue) { |
413 |
issue_id => $issue->issue_id, |
413 |
$bundle_item->_result->create_related( |
414 |
itemnumber => $bundle_item->itemnumber, |
414 |
'return_claims', |
415 |
borrowernumber => $issue->borrowernumber, |
415 |
{ |
416 |
created_by => C4::Context->userenv()->{number}, |
416 |
issue_id => $issue->issue_id, |
417 |
created_on => dt_from_string |
417 |
itemnumber => $bundle_item->itemnumber, |
418 |
} |
418 |
borrowernumber => $issue->borrowernumber, |
419 |
); |
419 |
created_by => C4::Context->userenv()->{number}, |
420 |
} |
420 |
created_on => dt_from_string |
421 |
push @missing_items, $bundle_item; |
421 |
} |
422 |
# NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout |
422 |
); |
423 |
# and thus would not get charged.. it's checked out as part of the bundle. |
423 |
} |
424 |
if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) { |
424 |
push @missing_items, $bundle_item; |
425 |
C4::Accounts::chargelostitem( |
425 |
|
426 |
$issue->borrowernumber, |
426 |
# NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout |
427 |
$bundle_item->itemnumber, |
427 |
# and thus would not get charged.. it's checked out as part of the bundle. |
428 |
$bundle_item->replacementprice, |
428 |
if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) { |
429 |
sprintf( "%s %s %s", |
429 |
C4::Accounts::chargelostitem( |
430 |
$bundle_item->biblio->title || q{}, |
430 |
$issue->borrowernumber, |
431 |
$bundle_item->barcode || q{}, |
431 |
$bundle_item->itemnumber, |
432 |
$bundle_item->itemcallnumber || q{}, |
432 |
$bundle_item->replacementprice, |
433 |
), |
433 |
sprintf( "%s %s %s", |
434 |
); |
434 |
$bundle_item->biblio->title || q{}, |
|
|
435 |
$bundle_item->barcode || q{}, |
436 |
$bundle_item->itemcallnumber || q{}, |
437 |
), |
438 |
); |
439 |
} |
435 |
} |
440 |
} |
436 |
} |
441 |
} |
437 |
$template->param( |
442 |
$template->param( |