diff --git a/src/main/java/org/folio/circulation/domain/Item.java b/src/main/java/org/folio/circulation/domain/Item.java index 9fa7a7e042..ff6bbbdf9a 100644 --- a/src/main/java/org/folio/circulation/domain/Item.java +++ b/src/main/java/org/folio/circulation/domain/Item.java @@ -357,8 +357,9 @@ public String getFloatDestinationLocationId() { } public boolean canFloatThroughCheckInServicePoint() { - return getLocation() != null && - getLocation().isFloatingCollection() + return getLocation() != null + && getLocation().isFloatingCollection() + && getFloatDestinationLocation() != null && getFloatDestinationLocation().getId() != null; } diff --git a/src/main/java/org/folio/circulation/infrastructure/storage/inventory/ItemRepository.java b/src/main/java/org/folio/circulation/infrastructure/storage/inventory/ItemRepository.java index 9a5cb54d5d..ffe39a8bce 100644 --- a/src/main/java/org/folio/circulation/infrastructure/storage/inventory/ItemRepository.java +++ b/src/main/java/org/folio/circulation/infrastructure/storage/inventory/ItemRepository.java @@ -113,7 +113,7 @@ public CompletableFuture> updateItem(Item item) { if (item.isInStatus(IN_TRANSIT)) { write(updatedItemRepresentation, IN_TRANSIT_DESTINATION_SERVICE_POINT_ID, item.getInTransitDestinationServicePointId()); - } else if (item.canFloatThroughCheckInServicePoint()) { + } else if (item.isInStatus(AVAILABLE) && item.canFloatThroughCheckInServicePoint()) { remove(updatedItemRepresentation, TEMPORARY_LOCATION_ID); write(updatedItemRepresentation, TEMPORARY_LOCATION_ID, item.getFloatDestinationLocationId());