Base
This commit is contained in:
130
resources/views/ventas/precios/add.blade.php
Normal file
130
resources/views/ventas/precios/add.blade.php
Normal file
@ -0,0 +1,130 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h3>Agregar Precios - {{$proyecto->descripcion}}</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('precios', 'agregar', ['proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Fecha</div>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2" style="vertical-align: middle;">Tipo</th>
|
||||
<th rowspan="2">Nombre</th>
|
||||
<th rowspan="2">Abreviación</th>
|
||||
<th rowspan="2">Líneas</th>
|
||||
<th rowspan="2">m² Vendible</th>
|
||||
<th rowspan="2">#</th>
|
||||
<th colspan="2">Precio</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Anterior</th>
|
||||
<th>Nuevo</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tipo_unidades">
|
||||
@foreach ($proyecto->proyectoTipoUnidades() as $tipo)
|
||||
<tr class="show-unidades" data-status="closed" data-tipo="{{$tipo->id}}">
|
||||
<td>{{ucwords($tipo->tipo()->descripcion)}}</td>
|
||||
<td>{{$tipo->nombre}}</td>
|
||||
<td>{{$tipo->abreviacion}}</td>
|
||||
<td>{{$tipo->lineas()}}</td>
|
||||
<td>{{$tipo->m2()}}</td>
|
||||
<td>{{count($tipo->unidades())}}</td>
|
||||
<td>{{format('ufs', $tipo->precio(), true)}}</td>
|
||||
<td><input type="text" name="precio_tipo:{{$tipo->id}}" class="form-control" /></td>
|
||||
</tr>
|
||||
<tr class="unidades" data-tipo="{{$tipo->id}}">
|
||||
<td></td>
|
||||
<td colspan="7">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Descripción</th>
|
||||
<th>Piso</th>
|
||||
<th>Línea</th>
|
||||
<th>Orientación</th>
|
||||
<th colspan="2">Precio</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4"></th>
|
||||
<th>Anterior</th>
|
||||
<th>Nuevo</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $subtipo = ''; ?>
|
||||
@foreach ($tipo->unidades() as $unidad)
|
||||
@if ($subtipo != $unidad->subtipo)
|
||||
<?php $subtipo = $unidad->subtipo; ?>
|
||||
<tr data-id="{{$subtipo}}" data-status="closed" class="subtipo">
|
||||
<th colspan="4">Línea {{$subtipo}}</th>
|
||||
<th>{{format('ufs', $tipo->precioSubtipo($subtipo), true)}}</th>
|
||||
<th><input type="text" name="precio_sub:{{$tipo->id}}-{{$subtipo}}" class="form-control" /></th>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td>{{$unidad->descripcion}}</td>
|
||||
<td>{{$unidad->piso}}</td>
|
||||
<td>{{$unidad->subtipo}}</td>
|
||||
<td>{{$unidad->orientacion}}</td>
|
||||
<td>
|
||||
@if ($unidad->precio())
|
||||
{{format('ufs', $unidad->precio()->valor, true)}}
|
||||
@else
|
||||
--
|
||||
@endif
|
||||
</td>
|
||||
<td><input type="text" name="precio:{{$tipo->id}}-{{$subtipo}}-{{$unidad->id}}" class="form-control" /></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button class="form-control" type="submit">Agregar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.unidades').hide()
|
||||
$('.show-unidades').click(function(e) {
|
||||
var id = $(this).attr('data-tipo')
|
||||
var status = $(this).attr('data-status')
|
||||
if (status == 'open') {
|
||||
$(".unidades[data-tipo='" + id + "']").hide()
|
||||
$(this).attr('data-status', 'closed')
|
||||
} else {
|
||||
$(".unidades[data-tipo='" + id + "']").show()
|
||||
if ($(".unidades[data-tipo='" + id + "']").find('.subtipo').length > 0) {
|
||||
$(".unidades[data-tipo='" + id + "']").find('tbody tr').hide()
|
||||
$(".unidades[data-tipo='" + id + "']").find('.subtipo').show()
|
||||
}
|
||||
$(this).attr('data-status', 'open')
|
||||
}
|
||||
})
|
||||
$('.subtipo').click(function(e) {
|
||||
var id = $(this).attr('data-id')
|
||||
var status = $(this).attr('data-status')
|
||||
if (status == 'open') {
|
||||
$(this).nextUntil('.subtipo').hide()
|
||||
$(this).attr('data-status', 'closed')
|
||||
} else {
|
||||
$(this).nextUntil('.subtipo').show()
|
||||
$(this).attr('data-status', 'open')
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
37
resources/views/ventas/precios/import.blade.php
Normal file
37
resources/views/ventas/precios/import.blade.php
Normal file
@ -0,0 +1,37 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h3>Importar Precios</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('precios', 'importar')}}" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Proyecto</div>
|
||||
<div class="col-md-3"><select name="proyecto" class="form-control">
|
||||
<option value="">---</option>
|
||||
@foreach ($proyectos as $proyecto)
|
||||
<option value="{{$proyecto->id}}">{{$proyecto->descripcion}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Fecha</div>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Archivo CSV *</div>
|
||||
<div class="col-md-5"><input type="file" name="archivo" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<p class="small col-md-5 col-md-offset-2">
|
||||
(*) Columnas: tipo [departamento, estacionamiento, bodega], numeracion, valor
|
||||
<br />
|
||||
<a href="{{url('precios.csv')}}">Muestra</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button class="form-control" type="submit">Importar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
126
resources/views/ventas/precios/list.blade.php
Normal file
126
resources/views/ventas/precios/list.blade.php
Normal file
@ -0,0 +1,126 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h3>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
Precios - {{$proyecto->descripcion}}
|
||||
</div>
|
||||
<div class="col-md-6 text-right"><a href="{{nUrl('precios', 'add', ['proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-plus"></span></a></div>
|
||||
</div>
|
||||
</h3>
|
||||
</div>
|
||||
<br />
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tipo</th>
|
||||
<th>Nombre</th>
|
||||
<th>Tipología</th>
|
||||
<th>Líneas</th>
|
||||
<th>m² Vendibles</th>
|
||||
<th>#</th>
|
||||
<th>Precio Promedio</th>
|
||||
<th>UF/m²</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($proyecto->ProyectoTipoUnidades() as $tipo)
|
||||
<tr class="show-unidades" data-status="closed" data-id="{{$tipo->id}}">
|
||||
<td>{{ucwords($tipo->tipo()->descripcion)}}</td>
|
||||
<td>{{$tipo->nombre}}</td>
|
||||
<td>
|
||||
@if ($tipo->tipologia())
|
||||
{{$tipo->tipologia()->descripcion}}
|
||||
@else
|
||||
{{$tipo->abreviacion}}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{$tipo->lineas()}}</td>
|
||||
<td>{{$tipo->m2()}}</td>
|
||||
<td>{{count($tipo->unidades())}}</td>
|
||||
<td>{{format('ufs', $tipo->precio(), true)}}</td>
|
||||
<th>{{format('ufs', $tipo->precio() / $tipo->m2(), true)}}/m²</th>
|
||||
</tr>
|
||||
<tr class="unidades" data-tipo="{{$tipo->id}}">
|
||||
<td></td>
|
||||
<td colspan="7">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Unidad</th>
|
||||
<th>Desde</th>
|
||||
<th>Precio</th>
|
||||
<th>UF/m²</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $subtipo = ''; ?>
|
||||
@foreach ($tipo->unidades() as $unidad)
|
||||
@if ($subtipo != $unidad->subtipo)
|
||||
<?php $subtipo = $unidad->subtipo; ?>
|
||||
<tr data-id="{{$subtipo}}" data-status="closed" class="subtipo">
|
||||
<th>Línea {{$subtipo}}</th>
|
||||
<th></th>
|
||||
<th>{{format('ufs', $tipo->precioSubtipo($subtipo), null, true)}}</th>
|
||||
<th>{{format('ufs', $tipo->precioSubtipo($subtipo) / $tipo->m2(), null, true)}}/m²</th>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td>{{$unidad->descripcion}}</td>
|
||||
@if ($unidad->precio())
|
||||
<td>{{format('shortDate', $unidad->precio()->estado()->fecha)}}</td>
|
||||
<td>{{format('ufs', $unidad->precio()->valor, null, true)}}</td>
|
||||
<td>
|
||||
@if ($unidad->m2('vendible') > 0)
|
||||
{{format('ufs', $unidad->precio()->valor / $unidad->m2('vendible'), null, true)}}/m²
|
||||
@endif
|
||||
</td>
|
||||
@else
|
||||
<td colspan="3">--</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.unidades').hide()
|
||||
$('.show-unidades').css('cursor', 'pointer').click(function(e) {
|
||||
var id = $(this).attr('data-id')
|
||||
var status = $(this).attr('data-status')
|
||||
if (status == 'open') {
|
||||
$(".unidades[data-tipo='" + id + "']").hide()
|
||||
$(this).attr('data-status', 'closed')
|
||||
} else {
|
||||
$(".unidades[data-tipo='" + id + "']").show()
|
||||
if ($(".unidades[data-tipo='" + id + "']").find('.subtipo').length > 0) {
|
||||
$(".unidades[data-tipo='" + id + "']").find('tbody tr').hide()
|
||||
$(".unidades[data-tipo='" + id + "']").find('.subtipo').show()
|
||||
}
|
||||
$(this).attr('data-status', 'open')
|
||||
}
|
||||
})
|
||||
$('.subtipo').css('cursor', 'pointer').click(function(e) {
|
||||
var id = $(this).attr('data-id')
|
||||
var status = $(this).attr('data-status')
|
||||
if (status == 'open') {
|
||||
$(this).nextUntil('.subtipo').hide()
|
||||
$(this).attr('data-status', 'closed')
|
||||
} else {
|
||||
$(this).nextUntil('.subtipo').show()
|
||||
$(this).attr('data-status', 'open')
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
14
resources/views/ventas/precios/proyectos.blade.php
Normal file
14
resources/views/ventas/precios/proyectos.blade.php
Normal file
@ -0,0 +1,14 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h3>Precios</h3>
|
||||
</div>
|
||||
<table class="table">
|
||||
@foreach ($proyectos as $proyecto)
|
||||
<tr>
|
||||
<td><a href="{{nUrl('precios', 'list', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endsection
|
Reference in New Issue
Block a user