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

@@ -16,6 +16,10 @@
<label for="{{form.Nombre.name}}"><strong> {{form.Nombre.label|capfirst}} </strong></label>
{% render_field form.Nombre id+="add" id+=form.Nombre.name placeholder=form.Nombre.label class="form-control" type="text" autocomplete="off" %}
</div>
<div class="form-group">
<label for="{{form.email.name}}"><strong> {{form.email.label|capfirst}} </strong></label>
{% render_field form.email id+="add" id+=form.email.name placeholder=form.email.label class="form-control" type="text" autocomplete="off" %}
</div>
<div class="form-group form-check">
{% render_field form.Activo class+="form-checkbox" type="checkbox" %}
<label class="form-check-label" for="{{form.Activo.label}}">Activo</label>

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>

View File

@@ -3,7 +3,8 @@
Fecha: <strong>{{fecha|date:"d F Y"}}</strong>
</span>
<form action="{{request.path}}" method="get" class="form-inline my-2 my-lg-0">
<input id="search" class="form-control mr-sm-2" name="search" type="search" placeholder="Search" aria-label="Search">
<input style="display:none" id="mes_id" class="form-control mr-sm-2" name="mes" type="input" placeholder="mes" aria-label="mes">
<input id="search" class="form-control mr-sm-2" name="search" type="search" placeholder="Search" aria-label="Search">
<div class="form-group form-check">
<input style="display:none" name="rfcc" type="checkbox" class="form-check-input" id="rfcc">
@@ -12,7 +13,7 @@
<div class="form-group form-check">
<input style="display:none" name="tipo" type="checkbox" class="form-check-input" id="tipo">
</div>
<div id="dates" style="display:none;" class="group-form mr-2" >
<input class="form-control sm-2" name = "datepicker" id="datepicker" placeholder="Initial Date" />
<input class="form-control sm-2" name = "datepickerFin" id="datepickerFin" placeholder="End Date" />

View File

@@ -2,7 +2,7 @@
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo03" aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="/"><img height="25px" class="center" src="https://aduanasoft.com/wp-content/uploads/2019/01/aslogo-1.png" id="icon" alt="User Icon" /></a>
<a id="home_id" class="navbar-brand" href="/"><img height="25px" class="center" src="https://aduanasoft.com/wp-content/uploads/2019/01/aslogo-1.png" id="icon" alt="User Icon" /></a>
<div class="collapse navbar-collapse" id="navbarTogglerDemo03">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">