This commit is contained in:
fjrodriguez
2022-11-30 08:44:59 -06:00
parent e2121905d6
commit 2d55c0974a
13 changed files with 370 additions and 46 deletions

View File

@@ -1,17 +1,24 @@
{% extends "base.html" %}
{% extends "base.html" %}
{% block titlePage %}
{% endblock titlePage %}
{% block content %}
<table class="table">
<thead>
<tr>
<th scope="col">UUID</th>
<th scope="col">
<input id="table_name" name="name" value="True" type="checkbox" class="form-check-input" >
RFC Cliente
<input id="table_rfcc" name="rfcc" value="True" type="checkbox" class="form-check-input" >
Cliente RFC
</th>
<th scope="col">PAC</th>
<th scope="col">Tipo CFDI</th>
<th scope="col">actions</th>
</tr>
@@ -19,15 +26,10 @@
<tbody>
{% for obj in timbres %}
<tr class="">
<th scope="row">{{obj.uuid}}</th>
<td>{{obj.rfcc}}</td>
<td>{{obj.rfcp}}</td>
<td>{{obj.tipo}}</td>
<td>{{obj.rfcc}}</td>
<td>
{% if request.user.is_staff %}
<a href="#" class="btn btn-info">View</a>
<a href="{% url 'timbres_cliente' obj.rfcc %}" class="btn btn-info">View Timbres</a>
{% endif %}
</td>
</tr>
@@ -35,4 +37,12 @@
</tbody>
</table>
{% endblock content %}
{% block scripts %}
<script>
table_rfcc.addEventListener('click',(event)=>{
document.getElementById('rfcc').checked= table_rfcc.checked? true:false;
})
</script>
{% endblock scripts %}

View File

@@ -0,0 +1,118 @@
{% extends 'base.html' %}
{% block content %}
<h1>Timbres <strong>{{RFC}}</strong> </h1>
<h2>Timbres totales: <strong></strong>{{conteo}}</strong></h2>
<br><br>
<table class="table">
<thead>
<tr>
<th scope="col">UUID</th>
<th scope="col">PAC</th>
<th scope="col">
<input id="table_tipo" name="tipo" value="True" type="checkbox" class="form-check-input" >
Tipo CFDI
</th>
<th scope="col">Serie/Folio</th>
<th scope="col">
<input id="table_fecha" name="fecha" value="True" type="checkbox" class="form-check-input" >
Fecha
</th>
</tr>
</thead>
<tbody>
{% for obj in lista %}
<tr class="">
<th scope="row">{{obj.uuid}}</th>
<td>{{obj.rfcp}}</td>
<td>{{obj.tipo}}</td>
<td>{{obj.serie}}/{{obj.folio}}</td>
<td>{{obj.created_at|date:"d M Y"}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if lista.has_other_pages %}
<nav>
<ul class="pagination justify-content-center">
{% if lista.has_previous %}
<li class="page-item">
<a class="page-link" href="?page={{ lista.previous_page_number }}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link" aria-hidden="true">&laquo;</span>
</li>
{% endif %}
{% for p in lista.paginator.page_range %}
{% if lista.number == p %}
<li class="page-item"><a class="page-link" style="color: red;" href="#">{{ p }}</a></li>
{% else %}
<li class="page-item"><a class="page-link" href="?page={{ p }}">{{ p }}</a></li>
{% endif %}
{% endfor %}
{% if lista.has_next %}
<li class="page-item">
<a class="page-link" href="?page={{ lista.next_page_number }}" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link" aria-hidden="true">&raquo;</span>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
</div>
{% endblock content %}
{% block scripts %}
<script>
table_tipo.addEventListener('click', (event)=>{
document.getElementById('tipo').checked = table_tipo.checked? true:false;
if(table_fecha.checked){
table_fecha.click()
}
})
table_fecha.addEventListener('click', (event)=>{
if(dates.hasAttribute("style")){
dates.removeAttribute('style')
datepicker.value=''
datepicker.setAttribute("required",'')
datepickerFin.value=''
datepickerFin.setAttribute('required','')
search.setAttribute("style","display:none;")
search.value=''
}else{
dates.setAttribute("style","display:none;")
search.removeAttribute('style')
datepicker.removeAttribute('required')
datepickerFin.removeAttribute('required')
}
if(table_tipo.checked && table_fecha.checked){
table_tipo.checked=false
}
})
</script>
{% endblock scripts %}