Lines 452-471
subtest "Test cr_item_field" => sub {
Link Here
|
452 |
$server->{account}->{seen_on_item_information} = ''; |
452 |
$server->{account}->{seen_on_item_information} = ''; |
453 |
$msg->handle_item_information( $server ); |
453 |
$msg->handle_item_information( $server ); |
454 |
$item_object->get_from_storage; |
454 |
$item_object->get_from_storage; |
455 |
is( $item_object->datelastseen, "1900-01-01", "datelastseen remains unchanged" ); |
455 |
my $stored_date = "1900-01-01 00:00:00"; |
|
|
456 |
is( $item_object->datelastseen, $stored_date, "datelastseen remains unchanged" ); |
456 |
|
457 |
|
457 |
$item_object->update({ itemlost => 1, datelastseen => '1900-01-01' }); |
458 |
$item_object->update({ itemlost => 1, datelastseen => '1900-01-01' }); |
458 |
$server->{account}->{seen_on_item_information} = 'keep_lost'; |
459 |
$server->{account}->{seen_on_item_information} = 'keep_lost'; |
459 |
$msg->handle_item_information( $server ); |
460 |
$msg->handle_item_information( $server ); |
460 |
$item_object = Koha::Items->find( $item_object->id ); |
461 |
$item_object = Koha::Items->find( $item_object->id ); |
461 |
isnt( $item_object->datelastseen, "1900-01-01", "datelastseen updated" ); |
462 |
isnt( $item_object->datelastseen, $stored_date, "datelastseen updated" ); |
462 |
is( $item_object->itemlost, 1, "item remains lost" ); |
463 |
is( $item_object->itemlost, 1, "item remains lost" ); |
463 |
|
464 |
|
464 |
$item_object->update({ itemlost => 1, datelastseen => '1900-01-01' }); |
465 |
$item_object->update({ itemlost => 1, datelastseen => '1900-01-01' }); |
465 |
$server->{account}->{seen_on_item_information} = 'mark_found'; |
466 |
$server->{account}->{seen_on_item_information} = 'mark_found'; |
466 |
$msg->handle_item_information( $server ); |
467 |
$msg->handle_item_information( $server ); |
467 |
$item_object = Koha::Items->find( $item_object->id ); |
468 |
$item_object = Koha::Items->find( $item_object->id ); |
468 |
isnt( $item_object->datelastseen, "1900-01-01", "datelastseen updated" ); |
469 |
isnt( $item_object->datelastseen, $stored_date, "datelastseen updated" ); |
469 |
is( $item_object->itemlost, 0, "item is no longer lost" ); |
470 |
is( $item_object->itemlost, 0, "item is no longer lost" ); |
470 |
|
471 |
|
471 |
my $itype = $item_object->itype; |
472 |
my $itype = $item_object->itype; |
472 |
- |
|
|