estados)) { $this->estados = $this->runFactory('estados'); } return $this->estados ?? []; } public function jsonSerialize(): mixed { return array_merge(parent::jsonSerialize(), [ 'venta_id' => $this->venta->id, 'index' => $this->index, 'proporcion' => $this->proporcion, 'emisor' => [ 'rut' => $this->emisorRut, 'nombre' => $this->emisorNombre, 'direccion' => $this->emisorDireccion ], 'receptor' => [ 'rut' => $this->receptorRut, 'nombre' => $this->receptorNombre, 'direccion' => $this->receptorDireccion, 'comuna' => $this->receptorComuna ], 'fecha' => $this->fecha->format('Y-m-d'), 'unidades' => $this->unidades, 'detalle' => [ 'base' => $this->detalleBase, 'terreno' => $this->detalleTerreno, 'neto' => $this->detalleNeto, 'iva' => $this->detalleIva, 'bruto' => $this->detalleBruto, 'descuento' => $this->detalleDescuento, 'total' => $this->detalleTotal ], 'total' => [ 'neto' => $this->totalNeto, 'exento' => $this->totalExento, 'iva' => $this->totalIva, 'total' => $this->totalTotal ], 'uf' => [ 'fecha' => $this->fechaUF->format('Y-m-d'), 'valor' => $this->valorUF ], 'estados' => $this->estados() ]); } }