PAC filter
This commit is contained in:
@@ -149,21 +149,10 @@ def index(request):
|
|||||||
print('filters------',filters)
|
print('filters------',filters)
|
||||||
if rfcc:
|
if rfcc:
|
||||||
clientes_list = Clientes.objects.filter(Q(RFC__icontains=search))
|
clientes_list = Clientes.objects.filter(Q(RFC__icontains=search))
|
||||||
|
|
||||||
for i,ii in enumerate(clientes_list):
|
for i,ii in enumerate(clientes_list):
|
||||||
ii.timbres_X_MES(mes=mes)
|
ii.timbres_X_MES(mes=mes)
|
||||||
|
|
||||||
|
|
||||||
clientes_list =pageFunc(page,clientes_list,20)
|
clientes_list =pageFunc(page,clientes_list,20)
|
||||||
|
|
||||||
# paginator = Paginator(clientes_list, 5)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# lista = paginator.page(page)
|
|
||||||
# except PageNotAnInteger:
|
|
||||||
# lista = paginator.page(1)
|
|
||||||
# except EmptyPage:
|
|
||||||
# lista = paginator.page(paginator.num_pages)
|
|
||||||
filters.pop('mes','')
|
filters.pop('mes','')
|
||||||
context = {
|
context = {
|
||||||
'lista':clientes_list,
|
'lista':clientes_list,
|
||||||
@@ -193,6 +182,12 @@ def timbres_cliente(request, RFC):
|
|||||||
lista = Timbres.objects.filter(rfcc=RFC)
|
lista = Timbres.objects.filter(rfcc=RFC)
|
||||||
else:
|
else:
|
||||||
lista = Timbres.objects.filter(rfcc=RFC,modo='Normal')
|
lista = Timbres.objects.filter(rfcc=RFC,modo='Normal')
|
||||||
|
|
||||||
|
PAC= request.GET.get('PAC',None)
|
||||||
|
if PAC=='01':
|
||||||
|
lista = lista.filter(rfcp='EME000602QR9')
|
||||||
|
if PAC=='02':
|
||||||
|
lista = lista.exclude(rfcp='EME000602QR9')
|
||||||
search = request.GET.get('search',None)
|
search = request.GET.get('search',None)
|
||||||
page = request.GET.get('page', 1)
|
page = request.GET.get('page', 1)
|
||||||
datepicker = request.GET.get('datepicker', None)
|
datepicker = request.GET.get('datepicker', None)
|
||||||
@@ -202,6 +197,8 @@ def timbres_cliente(request, RFC):
|
|||||||
|
|
||||||
filters = {key:value[0] for (key,value) in dict(request.GET).items() if value !=[""]}
|
filters = {key:value[0] for (key,value) in dict(request.GET).items() if value !=[""]}
|
||||||
filters.pop('page', '')
|
filters.pop('page', '')
|
||||||
|
filters.pop('PAC', '')
|
||||||
|
|
||||||
|
|
||||||
if tipo:
|
if tipo:
|
||||||
lista = lista.filter(Q(tipo__icontains=search))
|
lista = lista.filter(Q(tipo__icontains=search))
|
||||||
@@ -228,6 +225,7 @@ def timbres_cliente(request, RFC):
|
|||||||
'lista':lista,
|
'lista':lista,
|
||||||
'conteo':conteo,
|
'conteo':conteo,
|
||||||
'RFC':RFC,
|
'RFC':RFC,
|
||||||
|
'PAC':PAC,
|
||||||
'filters':filters
|
'filters':filters
|
||||||
}
|
}
|
||||||
return render(request, 'Clientes/timbres_cliente.html', context)
|
return render(request, 'Clientes/timbres_cliente.html', context)
|
||||||
|
|||||||
@@ -24,10 +24,8 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<select id="table_select" class="form-control form-control-sm">
|
<select id="table_select" class="form-control form-control-sm">
|
||||||
<option value="01">Enero
|
<option value="01">Enero</option>
|
||||||
</option>
|
<option value="02">Febrero</option>
|
||||||
<option value="02">Febrero
|
|
||||||
</option>
|
|
||||||
<option value="03">Marzo
|
<option value="03">Marzo
|
||||||
</option>
|
</option>
|
||||||
<option value="04">Abril
|
<option value="04">Abril
|
||||||
@@ -83,6 +81,7 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
|||||||
Acciones
|
Acciones
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
|
|
||||||
<a class="btn btn-outline-info w-100" href="{% url 'timbres_cliente' obj.RFC %}" >
|
<a class="btn btn-outline-info w-100" href="{% url 'timbres_cliente' obj.RFC %}" >
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">
|
||||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||||
|
|||||||
@@ -22,7 +22,14 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="col">UUID</th>
|
<th scope="col">UUID</th>
|
||||||
|
|
||||||
<th scope="col">PAC</th>
|
<th scope="col">
|
||||||
|
PAC
|
||||||
|
<select id="table_select_PAC" class="form-control form-control-sm">
|
||||||
|
<option value="00">Todos</option>
|
||||||
|
<option value="01">EDICOM</option>
|
||||||
|
<option value="02">Comercio Dig.</option>
|
||||||
|
</select>
|
||||||
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
<input id="table_tipo" name="tipo" value="True" type="checkbox" class="form-check-input" >
|
<input id="table_tipo" name="tipo" value="True" type="checkbox" class="form-check-input" >
|
||||||
Tipo CFDI
|
Tipo CFDI
|
||||||
@@ -47,12 +54,29 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<div id='id_filters' style="display: None;">{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}</div>
|
||||||
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script>
|
<script>
|
||||||
|
window.addEventListener("load", (event)=>{
|
||||||
|
let PAC = '{{PAC}}'
|
||||||
|
if(PAC !="None"){
|
||||||
|
table_select_PAC.value=PAC
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let filters = document.getElementById('id_filters').textContent
|
||||||
|
|
||||||
|
table_select_PAC.addEventListener('change',(event)=>{
|
||||||
|
let anc = document.getElementById('home_id')
|
||||||
|
anc.href=''
|
||||||
|
let url = `?PAC=${event.target.value}${filters}`
|
||||||
|
anc.href=url
|
||||||
|
anc.click()
|
||||||
|
})
|
||||||
|
|
||||||
table_tipo.addEventListener('click', (event)=>{
|
table_tipo.addEventListener('click', (event)=>{
|
||||||
document.getElementById('tipo').checked = table_tipo.checked? true:false;
|
document.getElementById('tipo').checked = table_tipo.checked? true:false;
|
||||||
if(table_fecha.checked){
|
if(table_fecha.checked){
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Fecha: <strong>{{fecha|date:"d F Y"}}</strong>
|
Fecha: <strong>{{fecha|date:"d F Y"}}</strong>
|
||||||
</span>
|
</span>
|
||||||
<form action="{{request.path}}" method="get" class="form-inline my-2 my-lg-0">
|
<form action="{{request.path}}" method="get" class="form-inline my-2 my-lg-0">
|
||||||
<input style="display:none" id="mes_id" class="form-control mr-sm-2" name="mes" type="input" placeholder="mes" aria-label="mes">
|
<input style="display:none" id="mes_id" class="form-control mr-sm-2" name="mes" type="input" aria-label="mes">
|
||||||
<input id="search" class="form-control mr-sm-2" name="search" type="search" placeholder="Search" aria-label="Search">
|
<input id="search" class="form-control mr-sm-2" name="search" type="search" placeholder="Search" aria-label="Search">
|
||||||
|
|
||||||
<div class="form-group form-check">
|
<div class="form-group form-check">
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="dates" style="display:none;" class="group-form mr-2" >
|
<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 ="datepicker" id="datepicker" placeholder="Initial Date" />
|
||||||
<input class="form-control sm-2" name = "datepickerFin" id="datepickerFin" placeholder="End Date" />
|
<input class="form-control sm-2" name ="datepickerFin" id="datepickerFin" placeholder="End Date" />
|
||||||
<script>
|
<script>
|
||||||
$('#datepicker').datepicker({
|
$('#datepicker').datepicker({
|
||||||
uiLibrary: 'bootstrap4'
|
uiLibrary: 'bootstrap4'
|
||||||
|
|||||||
Reference in New Issue
Block a user