From 0c0724aacf4c8ccb61a975d6aa554babb30e90fc Mon Sep 17 00:00:00 2001 From: Aldarien Date: Thu, 4 Jun 2020 11:49:03 -0400 Subject: [PATCH] Formateo de los gastos comunes --- src/Productos/Oficina.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Productos/Oficina.php b/src/Productos/Oficina.php index e9cc539..dedec60 100644 --- a/src/Productos/Oficina.php +++ b/src/Productos/Oficina.php @@ -2,6 +2,7 @@ namespace ProVM\KI\Productos; use ProVM\KI\Producto; +use ProVM\Common\Implementation\Model; class Oficina extends Producto { protected $properties = [ @@ -21,6 +22,13 @@ class Oficina extends Producto { } return 'privados ' . $this->privados; } + public function map($data): Model { + parent::map($data); + if (strpos($this->gastos, '.') === false) { + $this->gastos = number_format($data->gastos, 0, ',', '.'); + } + return $this; + } public function getFicha(): array { $properties = [ [