From a7ef20bb741fc376e1064bad00d5d589429ae08b Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 27 Sep 2025 22:12:52 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20for:=20-=20Individuelle=20Repackingkosten?= =?UTF-8?q?=20d=C3=BCrfen=20Null=20sein=20#14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PreCalculationCheckService.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/avatic/lcc/service/precalculation/PreCalculationCheckService.java b/src/main/java/de/avatic/lcc/service/precalculation/PreCalculationCheckService.java index eca5c7e..38316de 100644 --- a/src/main/java/de/avatic/lcc/service/precalculation/PreCalculationCheckService.java +++ b/src/main/java/de/avatic/lcc/service/precalculation/PreCalculationCheckService.java @@ -118,16 +118,16 @@ public class PreCalculationCheckService { throw new PremiseValidationError("In destination " + node.getName() + ": destination geo location not set. Please contact your administrator."); } - if (destination.getDisposalCost() != null && destination.getDisposalCost().compareTo(BigDecimal.ZERO) == 0) { - throw new PremiseValidationError("In destination " + node.getName() + ": disposal costs entered as zero."); + if (destination.getDisposalCost() != null && destination.getDisposalCost().compareTo(BigDecimal.ZERO) < 0) { + throw new PremiseValidationError("In destination " + node.getName() + ": disposal costs are not set or entered value is less than zero."); } - if (destination.getHandlingCost() != null && destination.getHandlingCost().compareTo(BigDecimal.ZERO) == 0) { - throw new PremiseValidationError("In destination " + node.getName() + ": handling costs entered as zero."); + if (destination.getHandlingCost() != null && destination.getHandlingCost().compareTo(BigDecimal.ZERO) < 0) { + throw new PremiseValidationError("In destination " + node.getName() + ": handling costs are not set or entered value is less than zero."); } - if (destination.getRepackingCost() != null && destination.getRepackingCost().compareTo(BigDecimal.ZERO) == 0) { - throw new PremiseValidationError("In destination " + node.getName() + ": repackaging costs enstered as zero."); + if (destination.getRepackingCost() != null && destination.getRepackingCost().compareTo(BigDecimal.ZERO) < 0) { + throw new PremiseValidationError("In destination " + node.getName() + ": repackaging costs are not set or entered value is less than zero."); } } @@ -158,11 +158,11 @@ public class PreCalculationCheckService { private void packagingCheck(Premise premise) { if (premise.getHuMixable() == null) { - throw new PremiseValidationError("Mixable not set. Please contact administrator"); + throw new PremiseValidationError("Mixable not set. Please contact administrator."); } if (premise.getHuStackable() == null) { - throw new PremiseValidationError("Stackable not set. Please contact administrator"); + throw new PremiseValidationError("Stackable not set. Please contact administrator."); } if (premise.getHuStackable() == false && premise.getHuMixable() == true) { @@ -190,11 +190,11 @@ public class PreCalculationCheckService { } if (premise.getHuDisplayedWeightUnit() == null) { - throw new PremiseValidationError("Packaging weight unit not set. Please contact administrator"); + throw new PremiseValidationError("Packaging weight unit not set. Please contact administrator."); } if (premise.getHuDisplayedDimensionUnit() == null) { - throw new PremiseValidationError("Packaging dimension unit not set. Please contact administrator"); + throw new PremiseValidationError("Packaging dimension unit not set. Please contact administrator."); } var hu = dimensionTransformer.toDimensionEntity(premise).withTolerance(DIMENSION_TOLERANCE);