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);