diff --git a/src/main/java/org/folio/service/orders/OrderRolloverService.java b/src/main/java/org/folio/service/orders/OrderRolloverService.java index b8468f211..89b0a60dc 100644 --- a/src/main/java/org/folio/service/orders/OrderRolloverService.java +++ b/src/main/java/org/folio/service/orders/OrderRolloverService.java @@ -376,7 +376,9 @@ private CurrencyConversion retrieveCurrencyConversion(String systemCurrency, PoL } private MonetaryAmount amountWithConversion(BigDecimal totalInitialAmountEncumbered, PoLineEncumbrancesHolder holder) { - return Money.of(totalInitialAmountEncumbered, holder.getPoLine().getCost().getCurrency()).with(holder.getCurrencyConversion()); + return Money.of(totalInitialAmountEncumbered, holder.getPoLine().getCost().getCurrency()) + .with(holder.getCurrencyConversion()) + .with(Monetary.getDefaultRounding()); } private List buildPoLineEncumbrancesHolders(String systemCurrency, List poLines, diff --git a/src/test/java/org/folio/service/orders/OrderRolloverServiceTest.java b/src/test/java/org/folio/service/orders/OrderRolloverServiceTest.java index c068c6e84..7045b37c3 100644 --- a/src/test/java/org/folio/service/orders/OrderRolloverServiceTest.java +++ b/src/test/java/org/folio/service/orders/OrderRolloverServiceTest.java @@ -528,12 +528,9 @@ void shouldUpdateOrderLinesCostAndEncumbranceLinksWithExchangeRateAndPolCurrency assertThat(fundDistributionOngoing2.getEncumbrance(), equalTo(currEncumbrId2)); assertThat(fundDistributionOngoing3.getEncumbrance(), equalTo(currEncumbrId3)); - assertThat(BigDecimal.valueOf(costOneTime.getPoLineEstimatedPrice()).setScale(2, RoundingMode.HALF_EVEN), - equalTo(new BigDecimal("24.99").setScale(2, RoundingMode.HALF_EVEN))); - assertThat(BigDecimal.valueOf(costOngoing2.getPoLineEstimatedPrice()).setScale(2, RoundingMode.HALF_EVEN), - equalTo(new BigDecimal("24.99").setScale(2, RoundingMode.HALF_EVEN))); - assertThat(BigDecimal.valueOf(costOngoing3.getPoLineEstimatedPrice()).setScale(2, RoundingMode.HALF_EVEN), - equalTo(new BigDecimal("24.99").setScale(2, RoundingMode.HALF_EVEN))); + assertThat(BigDecimal.valueOf(costOneTime.getPoLineEstimatedPrice()), equalTo(new BigDecimal("24.99"))); + assertThat(BigDecimal.valueOf(costOngoing2.getPoLineEstimatedPrice()), equalTo(new BigDecimal("24.99"))); + assertThat(BigDecimal.valueOf(costOngoing3.getPoLineEstimatedPrice()), equalTo(new BigDecimal("24.99"))); assertThat(costOneTime.getFyroAdjustmentAmount(), equalTo(0.0d)); assertThat(costOngoing2.getFyroAdjustmentAmount(), equalTo(0.0d));