239 lines
12 KiB
Plaintext
239 lines
12 KiB
Plaintext
@inject NavigationManager Navigation
|
|
@layout ConfiguracionLayout
|
|
@rendermode InteractiveServer
|
|
@using BlazorBootstrap
|
|
@using System.Globalization
|
|
@using ClosedXML.Excel
|
|
@using Microsoft.EntityFrameworkCore
|
|
@using bdHerramientaCACOA.db
|
|
|
|
<div>
|
|
|
|
@if (totalProyectosTipo != 0)
|
|
{
|
|
<div class="mt-2" style="padding:50px;">
|
|
<div class="mb-4">
|
|
<label class="fw-bold">Total simulaciones herramienta CASA: <span>@totalProyectosTipo</span> </label>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total costes directos:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.costesDirectos.MilesYDecimales() €</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total costes indirectos:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.costesIndirectos.MilesYDecimales() €</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total costes variables:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.costesVariables.MilesYDecimales() €</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total coste hora despacho profesional:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total fases:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total horas documentación:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.horasDocumentacion.MilesYDecimales() h</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-3">
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total horas dirección obra:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.horasDireccionObra.MilesYDecimales() h</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total horas TPE:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total porcentaje externalización:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.porcentajeExternalizacion.MilesYDecimales() %</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total plazo presentación:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total coste producción:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total otros trabajos:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.totalOtrosTrabajos.MilesYDecimales() €</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-3">
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total porcentaje beneficio:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.beneficio.MilesYDecimales() %</label>
|
|
</div>
|
|
|
|
<div class="col-2 formatoCampos pt-2">
|
|
<label class="tituloLbl">Total número trabajadores:</label>
|
|
<label class="tituloLbl">@estadisticasTotales.numeroTrabajadores</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="mt-5">
|
|
<label class="tituloLbl">No hay datos entre esas fechas.</label>
|
|
</div>
|
|
}
|
|
|
|
|
|
|
|
|
|
<Grid TItem="estadisticas"
|
|
Class="tablaCACOA table"
|
|
Data="listadoHerramientaEstadistica"
|
|
AllowFiltering="false"
|
|
PageSize="10"
|
|
FixedHeader="true"
|
|
Height="750"
|
|
Unit="Unit.Px"
|
|
EmptyText="No hay registros."
|
|
PageSizeSelectorVisible="false"
|
|
Responsive="true">
|
|
<GridColumns>
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes directos">
|
|
<span>@context.costeDirecto</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" Class="text-end" HeaderTextAlignment="Alignment.Center" HeaderText="Total costes indirectos">
|
|
<span>@context.costeIndirecto</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes Variables">
|
|
<span>@context.costeVariable</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total coste hora despacho profesional">
|
|
<span>@context.costeHoraDespachoProf</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total superficie">
|
|
<span></span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total fases">
|
|
<span>@context.totalFases</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas documentación">
|
|
<span>@context.horasTPEDocumentacion</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas dirección de obra">
|
|
<span>@context.horasTPEDireccionObra</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas trabajo profesional">
|
|
<span>@context.horasTPE</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
|
<span>@context.porcentajeExternalizacion</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total plazos">
|
|
<span>@context.plazoPresentacion</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes de producción">
|
|
<span>@context.costeProduccion</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total otros trabajos">
|
|
<span>@context.totalOtrosTrabajos</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
|
<span>@context.porcentajeExternalizacion</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje beneficio">
|
|
<span>@context.porcentajeBeneficio</span>
|
|
</GridColumn>
|
|
|
|
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total número trabajadores">
|
|
<span>@context.numeroTrabajadores</span>
|
|
</GridColumn>
|
|
</GridColumns>
|
|
</Grid>
|
|
|
|
</div>
|
|
|
|
@code {
|
|
|
|
public List<estadisticas> listadoHerramientaEstadistica { get; set; } = new List<estadisticas>();
|
|
public List<estadisticas> listadoHerramientaEstadisticaAux { get; set; } = new List<estadisticas>();
|
|
|
|
public DateTime? fechaInicio { get; set; } = null;
|
|
public DateTime? fechaFinal { get; set; } = null;
|
|
|
|
public EstadistiaHerraCasaVM estadisticasTotales = new EstadistiaHerraCasaVM();
|
|
private int totalProyectosTipo = 0;
|
|
|
|
private string mensajeError = "";
|
|
|
|
public tsHerramientasCACOA bd;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
|
|
|
inicializarListado();
|
|
}
|
|
|
|
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
|
{
|
|
estadisticasTotales.costesDirectos =UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeDirecto),totalProyectosTipo);
|
|
estadisticasTotales.costesIndirectos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeIndirecto), totalProyectosTipo);
|
|
estadisticasTotales.costesVariables = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeVariable), totalProyectosTipo);
|
|
estadisticasTotales.costeDespacho = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
|
estadisticasTotales.porcentajeFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
|
estadisticasTotales.horasDocumentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPEDocumentacion), totalProyectosTipo);
|
|
estadisticasTotales.horasDireccionObra = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPEDireccionObra), totalProyectosTipo);
|
|
estadisticasTotales.horasTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
|
estadisticasTotales.porcentajeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeExternalizacion), totalProyectosTipo);
|
|
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
|
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
|
estadisticasTotales.totalOtrosTrabajos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalOtrosTrabajos), totalProyectosTipo);
|
|
estadisticasTotales.beneficio = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeBeneficio), totalProyectosTipo);
|
|
estadisticasTotales.numeroTrabajadores = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.numeroTrabajadores), totalProyectosTipo);
|
|
}
|
|
|
|
|
|
private void inicializarListado()
|
|
{
|
|
listadoHerramientaEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 31).ToList();
|
|
listadoHerramientaEstadisticaAux = listadoHerramientaEstadistica;
|
|
|
|
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
|
|
|
hacerCalculos(listadoHerramientaEstadistica);
|
|
}
|
|
|
|
|
|
|
|
|
|
} |