{% extends 'Common/base.html.twig' %}{% import 'Common/parts/functions.html.twig' as function %}{% block title %}{{ 'admin.analytical.show.title'|trans }} | {{ parent() }}{% endblock %}{% block classBody %}whater-analytical {{ parent() }}{% endblock %}{% block javascripts %}{{ parent() }}{{ encore_entry_script_tags('wt_analytical_show') }}{% endblock javascripts %}{% set isWhaterPoint = false %}{% set isDistributionNetwork = false %}{% if analytical.whaterPoint is not none %}{% set isWhaterPoint = true %}{% else %}{% set isDistributionNetwork = true %}{% endif %}{% block contents %}<div class="container-small" ng-controller="showAnalyticalCtrl"><nav class="mb-2" aria-label="breadcrumb"><ol class="breadcrumb mb-0"><li class="breadcrumb-item"><a href="{{path('web_init')}}">Inicio</a></li>{% if isWhaterPoint %}<li class="breadcrumb-item">{{ analytical.whaterPoint.town.country.name | title }}</li><li class="breadcrumb-item"><a href="{{path('web_public_whater_point_show', {'whaterPointId': analytical.whaterPoint.id })}}">{{ analytical.whaterPoint.name | title }}</a></li>{% else %}<li class="breadcrumb-item">{{ analytical.distributionNetwork.country.name | title }}</li><li class="breadcrumb-item"><a href="{{path('web_public_distribution_network_show_by_id',{'distributionNetworkId': analytical.distributionNetwork.id})}}">{{ analytical.distributionNetwork.name | title }}</a></li>{% endif %}<li class="breadcrumb-item active" aria-current="page">Analítica de agua</li></ol></nav>{{ function.showFlashes() }}<div class="pb-9"><h2 class="mb-4">Analítica de agua</h2><div class="row g-5 mb-5"><div class="col-12 col-lg-4"><h3 class="mb-3" >Datos</h3>{% if isWhaterPoint %}<div class="mb-2"><h6 class="mb-0">Whaterpoint</h6><div class="">{{ analytical.whaterPoint.name | title }}</div></div><div class="mb-2"><h6 class="mb-0">Ciudad/Municipio</h6><div class="">{{ analytical.whaterPoint.town.name | title }}</div></div><div class="mb-2"><h6 class="mb-0">Pais</h6><div class="">{{ analytical.whaterPoint.town.country.name | title }}</div></div>{% else %}<div class="mb-2"><h6 class="mb-0">Pais</h6><div class="">{{ analytical.distributionNetwork.country.name | title }}</div></div><div class="mb-2"><h6 class="mb-0">Red de Distribución</h6><div class="">{{ analytical.distributionNetwork.name | title }}</div></div>{% endif %}<div class="mb-2"><h6 class="mb-0">Fecha</h6><div class="">{{analytical.analyzedAt | date('d-m-Y') }}</div></div><div class="mb-2"><h6 class="mb-0">Resultado</h6><div class="">{{ ('analytical.result.' ~ analytical.result)| trans }}</div></div><div class="mb-2"><h6 class="mb-0">Origen</h6><div class="">{% if analytical.createdFrom == 'sinac' and analytical.distributionNetwork and analytical.distributionNetwork.sinacId %}{% if analytical.whaterPoint is not none %}{% set codMunicipio = analytical.whaterPoint.town.externalIds.sinac %}{% else %}{% set codMunicipio = analytical.distributionNetwork.towns[0].externalIds.sinac %}{% endif %}<a href="{{sinac_domain}}/CiudadanoWeb/ciudadano/informacionAbastecimientoActionDetalleRed.do?idRed={{ analytical.distributionNetwork.sinacId }}&codMunicipio={{codMunicipio}}" target="_blank">{{sinac_domain}}</a>{% else %}<div class="">whater.app</div>{% endif %}</div></div><div class="mb-2"><h6 class="mb-0">Comentarios</h6><div class="">{{ analytical.comments | raw}}</div></div></div><div class="col-12 col-lg-4"><h3 class="mb-3" >Resultados</h3>{% for sample in analytical.samples %}<div class="mb-2"><h6 class="mb-0">{{ sample.analyticalParameter.parameterName }}</h6>{% set color = "" %}{% if sample.parameterValue < sample.analyticalParameter.referenceMinValue or sample.parameterValue > sample.analyticalParameter.referenceMaxValue %}{% set color = "text-danger" %}{% endif %}<div ><span class="{{color}}">{{ sample.parameterValue }} {{ sample.analyticalParameter.parameterMetric }}</span><span class="small">(Min: {{ sample.analyticalParameter.referenceMinValue }}, Max: {{ sample.analyticalParameter.referenceMaxValue }})</span></div></div>{% else %}<div class="">No se han encontrado resultados</div>{% endfor %}</div><div class="col-12 col-lg-4"><h3 class="mb-3" >Documentos</h3><ul>{% for analyticalMedia in analytical.analyticalMedias %}<li><a href="{{ vich_uploader_asset(analyticalMedia)}}" target="_blank" class="item">{{ analyticalMedia.fileOriginalname }}</a></li>{% else %}<li>No se han enlazado documentos</li>{% endfor %}</ul></div></div><div class="row g-5 mb-5"><div class="col-12"><h3 class="mb-3" >Histórico de resultados</h3><table class="table table-sm"><thead><tr><th scope="col">Fecha</th><th scope="col">Resultado</th><th scope="col">Origen</th><th scope="col">Responsables</th><th scope="col">Comentarios</th></tr></thead><tbody>{% set otherAnalyticals = [] %}{% if isWhaterPoint %}{% set otherAnalyticals = analytical.whaterPoint.analyticals %}{% else %}{% set otherAnalyticals = analytical.distributionNetwork.analyticals %}{% endif %}{% for otherAnalytical in otherAnalyticals %}<tr><td ><a href="{{ path('web_public_analytical_show', {'analyticalId': otherAnalytical.id }) }}">{{otherAnalytical.analyzedAt | date('d-m-Y') }}</a></td><td >{% set analytical_color = '' %}{% if otherAnalytical.result == 'SUITABLE' %}{% set analytical_color = 'badge bg-success' %}{% elseif otherAnalytical.result == 'NOT_SUITABLE' %}{% set analytical_color = 'badge bg-danger' %}{% else %}{% set analytical_color = 'badge' %}{% endif %}<span class="ui {{ analytical_color }} horizontal mini">{{ ('analytical.result.' ~ otherAnalytical.result)| trans }}</span></td><td >{% if otherAnalytical.createdFrom == 'sinac' and otherAnalytical.distributionNetwork and otherAnalytical.distributionNetwork.sinacId %}{% if otherAnalytical.whaterPoint is not none %}{% set codMunicipio = otherAnalytical.whaterPoint.town.externalIds.sinac %}{% else %}{% set codMunicipio = otherAnalytical.distributionNetwork.towns[0].externalIds.sinac %}{% endif %}<a href="{{sinac_domain}}/CiudadanoWeb/ciudadano/informacionAbastecimientoActionDetalleRed.do?idRed={{ otherAnalytical.distributionNetwork.sinacId }}&codMunicipio={{ codMunicipio }}" target="_blank">{{ analytical.source }}</a>{% else %}{{ otherAnalytical.source }}{% endif %}</td><td>{% if otherAnalytical.responsable is not none %}{{ otherAnalytical.responsable.name }}<br/>{% endif %}</td><td>{{ otherAnalytical.comments | raw}}</td></tr>{% endfor %}</tbody></table></div></div></div></div>{% endblock contents %}