From 5864efd24f0f8446c979a2d4e1defbf063b434fd Mon Sep 17 00:00:00 2001 From: Aldarien Date: Wed, 3 Jun 2020 22:05:19 -0400 Subject: [PATCH] FIX: uf/m2 cuando m2 es 0 --- src/Productos/Bodega.php | 2 +- src/Productos/Oficina.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Productos/Bodega.php b/src/Productos/Bodega.php index 6e47854..1dce587 100644 --- a/src/Productos/Bodega.php +++ b/src/Productos/Bodega.php @@ -13,7 +13,7 @@ class Bodega extends Producto { ]; public function uf_m2() { - return $this->arriendo / $this->superficie; + return $this->arriendo / ($this->superficie ?? 1); } public function getFicha(): array { $properties = [ diff --git a/src/Productos/Oficina.php b/src/Productos/Oficina.php index 3a6f098..a5ca965 100644 --- a/src/Productos/Oficina.php +++ b/src/Productos/Oficina.php @@ -13,7 +13,7 @@ class Oficina extends Producto { ]; public function uf_m2() { - return $this->arriendo / $this->m2; + return $this->arriendo / ($this->m2 ?? 1); } public function privados() { if ($this->privados == 0) {