diff --git a/app/resources/views/ventas/facturacion/show.blade.php b/app/resources/views/ventas/facturacion/show.blade.php index 2bd334c..171bbfa 100644 --- a/app/resources/views/ventas/facturacion/show.blade.php +++ b/app/resources/views/ventas/facturacion/show.blade.php @@ -244,6 +244,9 @@ return { price: (id, value) => { const idx = this.unidades.findIndex(unidad => unidad.pu_id === id) + if (idx === -1) { + return + } const old_value = this.unidades[idx].precio if (old_value === parseFloat(value)) { return diff --git a/app/resources/views/ventas/propiedades/edit.blade.php b/app/resources/views/ventas/propiedades/edit.blade.php index 31ebaa6..11c1788 100644 --- a/app/resources/views/ventas/propiedades/edit.blade.php +++ b/app/resources/views/ventas/propiedades/edit.blade.php @@ -2,12 +2,18 @@ @section('page_content')
Tipo | Unidad | +Valor | |||||||
---|---|---|---|---|---|---|---|---|---|
{{ucwords($unidad->proyectoTipoUnidad->tipoUnidad->descripcion)}} | {{$unidad->descripcion}} | +
+
+
+
+ UF
+ |
- | @@ -54,51 +66,132 @@ @push('page_scripts') @endpush diff --git a/app/resources/views/ventas/show/propiedad.blade.php b/app/resources/views/ventas/show/propiedad.blade.php index 8d6208c..745b298 100644 --- a/app/resources/views/ventas/show/propiedad.blade.php +++ b/app/resources/views/ventas/show/propiedad.blade.php @@ -16,6 +16,7 @@Piso | Metros vendibles | Precio | +Valor Venta | UF/m² | Orientacion | {{$format->ufs($unidad->precio($venta->fecha)->valor)}} | ++ {{$format->ufs($unidad->valor)}} + | @if ($unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'departamento') {{$format->number($unidad->precio($venta->fecha)->valor / $unidad->proyectoTipoUnidad->vendible(), 2)}} UF/m² diff --git a/app/src/Controller/Ventas.php b/app/src/Controller/Ventas.php index 1be7461..c0c7794 100644 --- a/app/src/Controller/Ventas.php +++ b/app/src/Controller/Ventas.php @@ -69,7 +69,7 @@ class Ventas $tiposUnidades []= $unidad->proyectoTipoUnidad->tipoUnidad; } } - return $view->render($response, 'ventas.propiedades.edit', compact('propiedad', 'proyecto', 'tiposUnidades', 'unidades', 'venta_id')); + return $view->render($response, 'ventas.propiedades.edit', compact('propiedad', 'proyecto', 'tiposUnidades', 'unidades', 'venta')); } public function add(ServerRequestInterface $request, ResponseInterface $response, View $view, Repository\Region $regionRepository, Repository\Proyecto $proyectoRepository): ResponseInterface { |