From bea6cb13424dde9a7311fe6237467b319d7614e9 Mon Sep 17 00:00:00 2001 From: Damien Date: Thu, 4 Apr 2024 09:19:24 -0400 Subject: [PATCH] [MODORDERS-1079] Renamed some variables to clarify --- .../ProcessInventoryMixedStrategy.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/folio/service/pieces/flows/strategies/ProcessInventoryMixedStrategy.java b/src/main/java/org/folio/service/pieces/flows/strategies/ProcessInventoryMixedStrategy.java index f9c83ea89..c48a9478f 100755 --- a/src/main/java/org/folio/service/pieces/flows/strategies/ProcessInventoryMixedStrategy.java +++ b/src/main/java/org/folio/service/pieces/flows/strategies/ProcessInventoryMixedStrategy.java @@ -80,13 +80,13 @@ private void updateLocationWithHoldingInfo(JsonObject holding, Location location private void updateLocations(CompositePoLine compPOL) { List locations = new ArrayList<>(); for (Location location : compPOL.getLocations()) { - boolean physical = location.getQuantityPhysical() != null && location.getQuantityPhysical() > 0; - boolean electronic = location.getQuantityElectronic() != null && location.getQuantityElectronic() > 0; - boolean physicalUpdate = physical && isHoldingUpdateRequiredForPhysical(compPOL); - boolean electronicUpdate = electronic && isHoldingUpdateRequiredForEresource(compPOL); + boolean physicalResource = location.getQuantityPhysical() != null && location.getQuantityPhysical() > 0; + boolean electronicResource = location.getQuantityElectronic() != null && location.getQuantityElectronic() > 0; + boolean physicalHolding = physicalResource && isHoldingUpdateRequiredForPhysical(compPOL); + boolean electronicHolding = electronicResource && isHoldingUpdateRequiredForEresource(compPOL); Location newLocation = JsonObject.mapFrom(location).mapTo(Location.class); - // Split locations only if one type is getting a holdings update but not the other - if (electronicUpdate && physical && !physicalUpdate) { + // Split locations only if one resource type is getting a holdings update but not the other + if (electronicHolding && physicalResource && !physicalHolding) { Location newElectronicLocation = JsonObject.mapFrom(location).mapTo(Location.class); newElectronicLocation.setQuantityPhysical(null); newElectronicLocation.setLocationId(null); @@ -95,7 +95,7 @@ private void updateLocations(CompositePoLine compPOL) { newLocation.setQuantityElectronic(null); newLocation.setHoldingId(null); newLocation.setQuantity(location.getQuantityPhysical()); - } else if (physicalUpdate && electronic && !electronicUpdate) { + } else if (physicalHolding && electronicResource && !electronicHolding) { Location newPhysicalLocation = JsonObject.mapFrom(location).mapTo(Location.class); newPhysicalLocation.setQuantityElectronic(null); newPhysicalLocation.setLocationId(null); @@ -105,7 +105,7 @@ private void updateLocations(CompositePoLine compPOL) { newLocation.setHoldingId(null); newLocation.setQuantity(location.getQuantityElectronic()); } else { - if (physicalUpdate || electronicUpdate) { + if (physicalHolding || electronicHolding) { newLocation.setLocationId(null); } else { newLocation.setHoldingId(null);