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