{% extends 'base.html.twig' %}


{% block body %}


<div class="container-fluid">


<a href="{{ path('admin_historial_regimen') }}"
class="btn btn-secondary">

<i class="fa fa-arrow-left"></i>

Regresar

</a>



<h2 class="mt-3">

<i class="fa fa-history"></i>

Auditoría cambios SRI

</h2>





{% if historial|length > 0 %}





<div class="panel panel-primary">


<div class="panel-heading">

Información del contribuyente

</div>


<div class="panel-body">


<h4>
{{ historial[0].razon_social_bd }}
</h4>


<p>
<strong>RUC:</strong>
{{ historial[0].ruc }}
</p>


<p>
<strong>Razón social SRI:</strong>
{{ historial[0].razon_social_sri }}
</p>


<p>
<strong>Origen:</strong>

<span class="label label-info">
{{ historial[0].origen }}
</span>

</p>


</div>


</div>







{% for item in historial %}





<div class="panel panel-default">


<div class="panel-heading">


<strong>
Fecha actualización:
</strong>


{{ item.fecha|date('d/m/Y H:i:s') }}



&nbsp;&nbsp;



<strong>
Estado:
</strong>


{% if item.estado == 'ACTUALIZADO' %}

<span class="label label-success">
{{ item.estado }}
</span>


{% elseif item.estado == 'ERROR' %}

<span class="label label-danger">
{{ item.estado }}
</span>


{% else %}

<span class="label label-info">
{{ item.estado }}
</span>


{% endif %}



</div>







<div class="panel-body">





<table class="table table-bordered table-striped">


<thead>

<tr>

<th width="35%">
Campo
</th>


<th width="30%">
Valor anterior
</th>


<th width="30%">
Valor nuevo
</th>


</tr>

</thead>



<tbody>




<tr>

<td>
RUC establecimiento
</td>


<td colspan="2">

<strong>
{{ item.ruc }}
</strong>


</td>

</tr>





<tr>

<td>
Razón social
</td>


<td>
{{ item.razon_social_bd }}
</td>


<td>
{{ item.razon_social_sri }}
</td>


</tr>





<tr>

<td>
Tipo contribuyente
</td>


<td>
{{ item.tipo_contribuyente_anterior }}
</td>


<td>
{{ item.tipo_contribuyente_nuevo }}
</td>


</tr>





<tr>

<td>
Régimen
</td>


<td>
{{ item.regimen_anterior }}
</td>


<td>
{{ item.regimen_nuevo }}
</td>


</tr>





<tr>

<td>
Categoría
</td>


<td>
{{ item.categoria_anterior }}
</td>


<td>
{{ item.categoria_nueva }}
</td>


</tr>





<tr>

<td>
Obligado contabilidad
</td>


<td>

{% if item.lleva_contabilidad_anterior %}
SI
{% else %}
NO
{% endif %}

</td>


<td>

{% if item.lleva_contabilidad_nuevo %}
SI
{% else %}
NO
{% endif %}

</td>


</tr>





<tr>

<td>
Agente retención
</td>


<td>
{{ item.agente_ret_anterior }}
</td>


<td>
{{ item.agente_ret_nuevo }}
</td>


</tr>





<tr>

<td>
Contribuyente especial
</td>


<td>
{{ item.contribuyente_especial_anterior }}
</td>


<td>
{{ item.contribuyente_especial_nuevo }}
</td>


</tr>





<tr>

<td>
RIMPE
</td>


<td>
{{ item.rimpe_label_anterior }}
</td>


<td>
{{ item.rimpe_label_nuevo }}
</td>


</tr>





<tr>

<td>
Mensaje error
</td>


<td colspan="2">


{% if item.mensaje_error %}

<span class="text-danger">
{{ item.mensaje_error }}
</span>


{% else %}

Sin errores


{% endif %}



</td>


</tr>





</tbody>


</table>





</div>


</div>





{% endfor %}







{% else %}



<div class="alert alert-warning">

No existe historial.

</div>



{% endif %}





</div>


{% endblock %}