From 223205cf9db90f85a2763aebb7fc8697e9c960ce Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 4 Dec 2020 16:54:40 +0100 Subject: [PATCH] Fix volume calcution, depends on surface not surface_units surface_unit can be 0 for m2 --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 0e9841201de..7d1d326cabb 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -854,7 +854,7 @@ class Product extends CommonObject $this->surface = $this->length * $this->width; $this->surface_units = measuring_units_squared($this->length_units); } - if (empty($this->volume) && !empty($this->surface_units) && !empty($this->height) && $this->length_units == $this->height_units) { + if (empty($this->volume) && !empty($this->surface) && !empty($this->height) && $this->length_units == $this->height_units) { $this->volume = $this->surface * $this->height; $this->volume_units = measuring_units_cubed($this->height_units); }