minor changes in validate RFC view
This commit is contained in:
@@ -11,8 +11,6 @@ def Custom_is_staff_function(user):
|
||||
if user.is_staff:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def is_staff_access(view_to_return="index"):
|
||||
def decorator(view):
|
||||
@wraps(view)
|
||||
|
||||
@@ -24,6 +24,7 @@ from .forms import ClienteForm,EmailForm
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework import status
|
||||
|
||||
#EXCEL
|
||||
from openpyxl import Workbook
|
||||
@@ -387,7 +388,7 @@ def PACS_Retrive_RFCS(request):
|
||||
|
||||
#-----------------------------------API VIEWS
|
||||
#--------------------------------------------
|
||||
from rest_framework import status
|
||||
|
||||
class check_RFC(APIView):
|
||||
permission_classes = (IsAuthenticated,)
|
||||
def get(self,request):
|
||||
@@ -395,11 +396,14 @@ class check_RFC(APIView):
|
||||
try:
|
||||
cliente, created = Clientes.objects.get_or_create(RFC=rfc)
|
||||
serializer = ClienteSerializer(cliente)
|
||||
if not serializer.is_valid:
|
||||
return Response(serializer.errors,status=400)
|
||||
|
||||
if created:
|
||||
cliente.Activo=True
|
||||
cliente.save()
|
||||
|
||||
if not serializer.is_valid:
|
||||
return Response(serializer.errors,status=400)
|
||||
|
||||
return Response(serializer.data)
|
||||
except Exception as E:
|
||||
return Response({'Error':f'check_RFC:{E} RFC:{rfc}','isError':True})
|
||||
@@ -415,15 +419,8 @@ class add_timbre2(APIView):
|
||||
tipo=request.GET.get('tipo', None)
|
||||
rfcp=request.GET.get('rfcp', None)
|
||||
modo=request.GET.get('modo', None)
|
||||
obj={
|
||||
'uuid':uuid,
|
||||
'rfcc':rfcc,
|
||||
'fecha':fecha,
|
||||
'folio':folio,
|
||||
'serie':serie,
|
||||
'tipo':tipo,
|
||||
'rfcp':rfcp,
|
||||
'modo':modo
|
||||
obj={'uuid':uuid,'rfcc':rfcc,'fecha':fecha,'folio':folio,
|
||||
'serie':serie,'tipo':tipo,'rfcp':rfcp,'modo':modo
|
||||
}
|
||||
try:
|
||||
obj = Timbres.objects.create(**obj)
|
||||
|
||||
@@ -23,9 +23,13 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
<a data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
|
||||
Total x mes
|
||||
</a>
|
||||
|
||||
<small>
|
||||
<strong>
|
||||
<small>Filtrado: Mes:{{mes}}, Año:{{year}}, PAC:<label id="lbl_pac"></label></small>
|
||||
Filtrado: Mes:{{mes}}, Año:{{year}}, PAC:<label id="lbl_pac"></label>
|
||||
</strong>
|
||||
</small>
|
||||
|
||||
</div>
|
||||
<div style="display:none;" id="spinner_id" class="spinner-border ml-auto spinner-border-sm" role="status" aria-hidden="true"></div>
|
||||
</div>
|
||||
@@ -40,7 +44,6 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
<select style="display:inline" id="table_select_anio" class="form-control form-control-sm">
|
||||
<!--option value="0"></option-->
|
||||
</select>
|
||||
|
||||
<!--MESES-->
|
||||
<select id="table_select" class="form-control form-control-sm">
|
||||
<option value="01">Enero</option>
|
||||
@@ -158,10 +161,8 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
</div>
|
||||
|
||||
<div id='id_filters' style="display: none;">{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}</div>
|
||||
|
||||
|
||||
<!-- Modal EMAIL-->
|
||||
<div class="modal fade" data-backdrop="static" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
|
||||
<!-- Modal EMAIL-->
|
||||
<div class="modal fade" data-backdrop="static" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
|
||||
<form enctype="multipart/form-data" id="id_form" action="{% url 'send_timbres_Email' %}?mes={{mes}}{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}" method="post">
|
||||
{% csrf_token %}
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
@@ -221,10 +222,10 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal LISTA EMAILS-->
|
||||
<div class="modal fade bd-example-modal-lg" id="exampleModalCenter2" tabindex="-1" role="contentinfo" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
|
||||
<!-- Modal LISTA EMAILS-->
|
||||
<div class="modal fade bd-example-modal-lg" id="exampleModalCenter2" tabindex="-1" role="contentinfo" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -253,7 +254,7 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block scripts %}
|
||||
@@ -472,5 +473,4 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{% endblock scripts %}
|
||||
Reference in New Issue
Block a user