division by zero

This commit is contained in:
fjrodriguez
2022-12-07 07:16:03 -06:00
parent 8ed7b3bef2
commit 864ef1117d
10 changed files with 152 additions and 17 deletions

View File

@@ -19,7 +19,34 @@ Timbres disponibles Comercio Digital: {{saldo.saldo}}
Cliente RFC
</th>
<th>Nombre</th>
<th>Totales Mes {{fecha|date:"F"}}</th>
<th>Totales Mes
<select id="table_select" class="form-control form-control-sm">
<option value="01">Enero
</option>
<option value="02">Febrero
</option>
<option value="03">Marzo
</option>
<option value="04">Abril
</option>
<option value="05">Mayo
</option>
<option value="06">Junio
</option>
<option value="07">Julio
</option>
<option value="08">Agosto
</option>
<option value="09">Septiembre
</option>
<option value="10">Octubre
</option>
<option value="11">Noviembre
</option>
<option value="12">Diciembre
</option>
</select>
</th>
<th>Estado</th>
<th scope="col">actions</th>
<th>
@@ -34,7 +61,9 @@ Timbres disponibles Comercio Digital: {{saldo.saldo}}
<a href="{% url 'update_cliente' obj.pk %}">{{obj.RFC}}</a>
</td>
<td>{{obj.Nombre}} </td>
<td>{{obj.timbres_mes_count}}</td>
<td>
{{obj.conteo_mes}}
</td>
<td>
{% if obj.Activo %}
@@ -57,10 +86,14 @@ Timbres disponibles Comercio Digital: {{saldo.saldo}}
{% endfor %}
</tbody>
</table>
<div id='id_filters' style="display: none;">{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}</div>
{% endblock content %}
{% block scripts %}
<script>
let filters = document.getElementById('id_filters').textContent
console.log(filters)
function aclick(event,RFC ,cuantos){
if( parseInt(cuantos)===0){
@@ -75,7 +108,25 @@ Timbres disponibles Comercio Digital: {{saldo.saldo}}
document.getElementById('rfcc').checked= table_rfcc.checked? true:false;
})
window.addEventListener("load", (event)=>{
let mes ='{{mes}}'
if(mes !="None"){
document.getElementById('table_select').value='{{mes}}'
mes_id.value='{{mes}}'
}else{
document.getElementById('table_select').value='{{fecha|date:"m"}}'
mes_id.value='{{fecha|date:"m"}}'
}
})
document.getElementById('table_select').addEventListener('change',(event)=>{
let anc = document.getElementById('home_id')
anc.href=''
let url = `?mes=${event.target.value}${filters}`
anc.href=url
anc.click()
})
</script>