-
-
-
-
-
-
-
-
-
+{% block content %}
+
+
+
+
+
+
+
+
+ Bienvenido al panel de control de Usuario Externo
+Radique los siguientes tipos de solicitudes de contratos
+
+
-
+
-{% endblock %}
\ No newline at end of file
+ {% endblock %}
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/control_board/table.html b/hiring_module/hiring_app/templates/control_board/table.html
index da3c806..9315660 100644
--- a/hiring_module/hiring_app/templates/control_board/table.html
+++ b/hiring_module/hiring_app/templates/control_board/table.html
@@ -4,14 +4,16 @@
}
-
+
Solicitudes de contratación
-
+
Listado de solicitudes de contratación
+
@@ -19,6 +21,7 @@ Listado de solicitudes de contrata
Listado de solicitudes de contrata
ID
+ Contrato
Solicitante
{% if not actualgroup == 'leader' %}
Lider encargado
@@ -34,8 +37,9 @@ Listado de solicitudes de contrata
{% for request in requests %}
- {{ request.id }}
- {{ request.created_by.first_name }} {{ request.created_by.last_name }}
+ {{ request.id|truncatechars:25 }}
+ {{ request.request_type }}
+ {{ request.created_by.first_name|truncatechars:10 }} {{ request.created_by.last_name|truncatechars:8 }}
{% if not actualgroup == 'leader' %}
{{ request.leader_assigned_to.first_name }}
@@ -46,7 +50,19 @@ Listado de solicitudes de contrata
{{ request.manager_assigned_to.first_name }}
{% include 'request_hiring/components/assign_manager.html' with managers=managers contract_request=request form_id_prefix='change_manager_form_' %}
{% endif %}
- {{ request.state }}
+
+ {% if request.state == 'pending' %}
+ Pendiente
+ {% elif request.state == 'review' %}
+ En Revisión
+ {% elif request.state == 'incomplete' %}
+ Incompleto
+ {% elif request.state == 'filed' %}
+ Completado
+ {% elif request.state == 'cancelled' %}
+ Cancelado
+ {% endif %}
+
{{ request.start_date|date:"d-m-Y" }}
{% endfor %}
@@ -56,4 +72,10 @@ Listado de solicitudes de contrata
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/request_creation/cex_request_form.html b/hiring_module/hiring_app/templates/request_creation/cex_request_form.html
index 5eef5cc..f35668a 100644
--- a/hiring_module/hiring_app/templates/request_creation/cex_request_form.html
+++ b/hiring_module/hiring_app/templates/request_creation/cex_request_form.html
@@ -1,235 +1,630 @@
-{% extends 'base.html' %}
-{% load static %}
-
-{% block title %}
-Solicitudes de contratos CEX
-{% endblock %}
-
-{% block content %}
-
-
-
-
- Solicitudes de contratos CEX
-
-
- {% csrf_token %}
-
-
-
-
-
-
-
-
-
-
-
-
-
+{% extends 'base.html' %} {% load static %} {% block title %} Solicitudes de
+contratos CEX {% endblock %} {% block content %}
+
+
+ {% csrf_token %}
+
+
+ Solicitudes de contratos de CEX
+
+
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información financiera
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ Información legal para el contrato
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
-
+
+
+
+
-
-
-
-
- Título de la notificación
-
-
-
- Mensaje de notificación
-
-
-
-
-
+
+
+
+
+
+ Título de la notificación
+
+
+
+
+ Mensaje de notificación
+
+
+
+
+
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html b/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html
index eeb106e..d2ba024 100644
--- a/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html
+++ b/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html
@@ -1,230 +1,600 @@
-{% extends 'base.html' %}
-{% load static %}
-
-{% block title %}
-Solicitudes de contratos de Monitoría
-{% endblock %}
-
-{% block content %}
-
-
-
-
-
-
- {% if form.errors %}
-
-
- {% for field, error in form.errors.items %}
- - {{ field }}: {{ error }}
- {% endfor %}
-
-
- {% endif %}
-
- Solicitudes de contratos de Monitoría
-
-
- {% csrf_token %}
-
-
-
-
-
-
-
-
-
-
-
+{% extends 'base.html' %} {% load static %} {% block title %} Solicitudes de
+contratos de Monitoría {% endblock %} {% block content %}
+
+
+
+
+
+ {% csrf_token %}
+
+
+ Solicitudes de contratos de Monitoría
+
+
+
+
+
+
+
+
+ Información del estudiante
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+ Información financiera
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+ Información de la monitoria
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
+
-
-
-
-
- Título de la notificación
-
-
-
- Mensaje de notificación
-
-
-
-
-
+
+
+
+
+
+ Título de la notificación
+
+
+
+
+ Mensaje de notificación
+
+
+
+
+
-
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html b/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html
index d251355..f93531c 100644
--- a/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html
+++ b/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html
@@ -1,34 +1,35 @@
+
-
+
-
+
-
+
-
+
-
+
diff --git a/hiring_module/hiring_app/templates/request_creation/pos_request_form.html b/hiring_module/hiring_app/templates/request_creation/pos_request_form.html
index 6430d3d..b187d65 100644
--- a/hiring_module/hiring_app/templates/request_creation/pos_request_form.html
+++ b/hiring_module/hiring_app/templates/request_creation/pos_request_form.html
@@ -1,356 +1,1089 @@
-{% extends 'base.html' %}
-{% load static %}
-
-{% block title %}
-Solicitudes de contratos POS
-{% endblock %}
-
-{% block content %}
-
+{% extends 'base.html' %} {% load static %} {% block title %} Solicitudes de
+contratos POS {% endblock %} {% block content %}
-
-
-
- {% if form.errors %}
-
-
- {% for field, error in form.errors.items %}
- - {{ field }}: {{ error }}
- {% endfor %}
-
-
- {% endif %}
-
- Solicitudes de contratos de prestacion de servicio
-
-
- {% csrf_token %}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ {% csrf_token %}
+
+
+ Solicitudes de contratos de prestacion de servicio
+
+
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+ Información financiera
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+ Información de la clase
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+ Horario de clases
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
- Course schedules:
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
- Título de la notificación
-
-
-
- Mensaje de notificación
-
-
-
-
-
+
+
+
+
+
+ Título de la notificación
+
+
+
+
+ Mensaje de notificación
+
+
+
+
+
+
+
+{% endblock %}
diff --git a/hiring_module/hiring_app/templates/request_hiring/cex_information.html b/hiring_module/hiring_app/templates/request_hiring/cex_information.html
index 5e7e20f..4dcc04b 100644
--- a/hiring_module/hiring_app/templates/request_hiring/cex_information.html
+++ b/hiring_module/hiring_app/templates/request_hiring/cex_information.html
@@ -1,140 +1,235 @@
-
+
+ Solicitudes de contratos de CEX
+
+
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
+
+
+
+
+ Nombre Completo del Contratado
+
+ El nombre completo de la persona contratada.
+
+
+
+ {{ contract_request.hiree_full_name }}
+
+
+
+
+ ID del Contratado
+
+ El identificador único asignado al contratado.
+
+
+ {{ contract_request.hiree_id }}
+
+
+
+ Número de Teléfono del Contratado
+
+ El número de teléfono del contratado.
+
+
+
+ {{ contract_request.hiree_cellphone }}
+
+
+
+
+ Correo Electrónico del Contratado
+
+ El correo electrónico de contacto del contratado.
+
+
+
+ {{ contract_request.hiree_email }}
+
+
+
+
+ EPS
+
+ La Entidad Promotora de Salud del contratado.
+
+
+ {{ contract_request.eps }}
+
+
+
+ ARL
+
+ La Administradora de Riesgos Laborales del contratado.
+
+
+ {{ contract_request.arl }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información del financiera
+
+
+
+
+
+
+
+
+ Cenco
+
+ Centro de costos asignado al contratado.
+
+
+ {{ contract_request.cenco }}
+
+
+
+ Entidad Bancaria
+
+ La entidad bancaria a la que está asociada la cuenta bancaria.
+
+
+
+ {{ contract_request.banking_entity }}
+
+
+
+
+
+
+ Tipo de Cuenta Bancaria
+
+ El tipo de cuenta bancaria del contratado.
+
+
+
+
+
+ {{ contract_request.get_bank_account_type_display }}
+
+
+
+
+
+
+ Número de Cuenta Bancaria
+
+ El número de cuenta bancaria del contratado.
+
+
+
+
+
+ {{ contract_request.bank_account_number }}
+
+
+
+
+
+ Fondo de Pensiones
+
+ El fondo de pensiones del contratado.
+
+
+
+
+
+ {{ contract_request.pension_fund }}
+
+
+
+
+
+
+
-
-
-
-
-
-
- Descripcion
- Datos
-
-
-
-
-
- Nombre Completo del Contratado
- El nombre completo de la persona contratada.
-
-
- {{ contract_request.hiree_full_name }}
-
-
-
- ID del Contratado
- El identificador único asignado al
- contratado.
-
-
- {{ contract_request.hiree_id }}
-
-
-
- Número de Teléfono del Contratado
- El número de teléfono del contratado.
-
- {{ contract_request.hiree_cellphone }}
-
-
-
- Correo Electrónico del Contratado
- El correo electrónico de contacto del
- contratado.
-
- {{ contract_request.hiree_email }}
-
-
-
- Cenco
- Centro de costos asignado al contratado.
-
-
- {{ contract_request.cenco }}
-
-
-
- Motivo de la Solicitud
- El motivo por el cual se realiza la
- solicitud.
-
-
- {{ contract_request.request_motive }}
-
-
-
- Entidad Bancaria
- La entidad bancaria a la que está asociada
- la
- cuenta bancaria.
-
- {{ contract_request.banking_entity }}
-
-
-
- Tipo de Cuenta Bancaria
- El tipo de cuenta bancaria del contratado.
-
-
- {{ contract_request.get_bank_account_type_display }}
-
-
-
- Número de Cuenta Bancaria
- El número de cuenta bancaria del contratado.
-
-
- {{ contract_request.bank_account_number }}
-
-
-
- EPS
- La Entidad Promotora de Salud del
- contratado.
-
-
- {{ contract_request.eps }}
-
-
-
- Fondo de Pensiones
- El fondo de pensiones del contratado.
-
- {{ contract_request.pension_fund }}
-
-
-
- ARL
- La Administradora de Riesgos Laborales del
- contratado.
-
- {{ contract_request.arl }}
-
-
-
- Valor del Contrato
- El valor total del contrato.
-
- {{ contract_request.contract_value }}
-
-
-
- Cuenta de Cobro
- La cuenta bancaria a la que se realizarán
- los
- pagos correspondientes.
-
- {{ contract_request.charge_account }}
-
-
-
- Descargar
- Archivo RUT
-
-
-
+
+
+
+
+
+
+ Información legal del contrato
+
+
+
+
+
+
+
+
+ Motivo de la Solicitud
+
+ El motivo por el cual se realiza la solicitud.
+
+
+
+ {{ contract_request.request_motive }}
+
+
-
-
+
+
+ Valor del Contrato
+
+ El valor total del contrato.
+
+
+
+ {{ contract_request.contract_value }}
+
+
+
+
+ Cuenta de Cobro
+
+ La cuenta bancaria a la que se realizarán los pagos
+ correspondientes.
+
+
+
+ {{ contract_request.charge_account }}
+
+
+
+
+ Descargar Archivo RUT
+
+
+
+
+
-
\ No newline at end of file
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html b/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html
index 0e35df1..9c992aa 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html
@@ -4,7 +4,7 @@
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html b/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html
index 7e70581..499e58a 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html
@@ -9,7 +9,7 @@
{% for manager in managers %}
-
+
{% endfor %}
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/change_state.html b/hiring_module/hiring_app/templates/request_hiring/components/change_state.html
index 69a6a2e..81bd475 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/change_state.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/change_state.html
@@ -3,7 +3,22 @@
@@ -20,8 +35,8 @@
-
-
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html b/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html
index 55b5cdd..eb1e823 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html
@@ -3,13 +3,13 @@
- Default Bootstrap Modal
+
...
-
-
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html b/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html
index bf9dcca..c3a9ee0 100644
--- a/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html
+++ b/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html
@@ -1,134 +1,218 @@
-
+
+ Solicitudes de contratos de Monitoría
+
+
+
+
+
+
+
+
+ Información del estudiante
+
+
+
+
+
+
+
+
+
+ Código del Estudiante
+
+ El código asignado al estudiante.
+
+
+
+ {{ contract_request.student_code }}
+
+
+
+
+ Nombre Completo del Estudiante
+
+ El nombre completo del estudiante.
+
+
+
+ {{ contract_request.student_full_name }}
+
+
+
+
+ ID del Estudiante
+
+ El identificador único asignado al estudiante.
+
+
+
+ {{ contract_request.student_id }}
+
+
+
+
+ Correo Electrónico del Estudiante
+
+ El correo electrónico de contacto del estudiante.
+
+
+
+ {{ contract_request.student_email }}
+
+
+
+
+ Número de Teléfono del Estudiante
+
+ El número de teléfono del estudiante.
+
+
+
+ {{ contract_request.student_cellphone }}
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Información del financiera
+
+
+
+
-
-
-
- Descripcion
- Datos
-
-
-
-
-
- Nombre Completo del Estudiante
- El nombre completo del estudiante.
-
- {{ contract_request.student_full_name }}
-
-
-
- ID del Estudiante
- El identificador único asignado al
- estudiante.
-
- {{ contract_request.student_id }}
-
-
-
- Número de Teléfono del Estudiante
- El número de teléfono del estudiante.
-
- {{ contract_request.student_cellphone }}
-
-
-
- Correo Electrónico del Estudiante
- El correo electrónico de contacto del
- estudiante.
-
- {{ contract_request.student_email }}
-
-
-
- Daviplata
- El número de cuenta Daviplata del
- estudiante.
-
- {{ contract_request.daviplata }}
-
-
-
- Curso o Proyecto
- El curso o proyecto en el que participa el
- estudiante.
-
- {{ contract_request.course_or_project }}
-
-
-
- Descripción de la Monitoria
- Una descripción de la actividad de monitoreo
- del estudiante.
-
- {{ contract_request.monitoring_description }}
-
-
-
- Horas Semanales
- El número de horas que el estudiante
- trabajará por semana.
-
- {{ contract_request.weekly_hours }}
-
-
-
- Valor Total a Pagar
- El valor total que se pagará al estudiante.
-
-
- {{ contract_request.total_value_to_pay }}
-
-
-
- Es Pago Único
- Indica si el pago es único o recurrente.
-
-
- {{ contract_request.is_unique_payment }}
-
-
-
- Tiene Dinero en Cenco
- Indica si el estudiante tiene dinero
- disponible en el cenco.
-
- {{ contract_request.has_money_in_cenco }}
-
-
-
- Gerente de Cenco
- El gerente responsable del cenco.
-
- {{ contract_request.cenco_manager }}
-
-
-
- Tipo de Monitoria
- El tipo de actividad de monitoreo.
-
- {{ contract_request.monitoring_type }}
-
-
-
- Código del Estudiante
- El código asignado al estudiante.
-
- {{ contract_request.student_code }}
-
-
-
- Daviplata
- El número de cuenta Daviplata del
- estudiante.
-
- {{ contract_request.daviplata }}
-
-
+
+
+
+
+ Cenco
+
+ CENCO asignado.
+
+
+ {{ contract_request.cenco }}
+
+
+
+ Administrador del cenco
+
+ Administrador del cenco asignado.
+
+
+
+ {{ contract_request.cenco_manager }}
+
+
+
+
+ Daviplata
+
+ Num de Daviplata del estudiante.
+
+
+
+ {{ contract_request.daviplata }}
+
+
+
+
+ Valor total a pagar
+
+ Valor en total del pago.
+
+
+
+ {{ contract_request.total_value_to_pay }}
+
+
+
+
+ Hora semanales
+
+ {{ contract_request.weekly_hours }}
+
+
+
+ Es pago unico?
+
+ {% if contract_request.is_unique_payment %} Sí {% else %} No
+ {% endif %}
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+ Información de la monitoria
+
+
+
+
+
+
+
+
+
+ Tipo de Monitoria
+
+ El tipo de actividad de monitoreo.
+
+
+
+ {{ contract_request.monitoring_type }}
+
+
+
+
+ Curso o Proyecto
+
+ El curso o proyecto en el que participa el estudiante.
+
+
+
+ {{ contract_request.course_or_project }}
+
+
+
+
+ Descripción de la Monitoria
+
+ Una descripción de la actividad de monitoreo del estudiante.
+
+
+
+ {{ contract_request.monitoring_description }}
+
+
+
+
+
-
\ No newline at end of file
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/pos_information.html b/hiring_module/hiring_app/templates/request_hiring/pos_information.html
index 1dc2aba..c68c6cc 100644
--- a/hiring_module/hiring_app/templates/request_hiring/pos_information.html
+++ b/hiring_module/hiring_app/templates/request_hiring/pos_information.html
@@ -1,244 +1,425 @@
-
-
-
-
-
-
-
-
- Descripcion
- Datos
-
-
-
-
-
- Nombre Completo del Contratado
- El nombre completo de la persona contratada.
-
-
- {{ contract_request.hiree_full_name }}
-
-
-
- ID del Contratado
- El identificador único asignado al
- contratado.
-
-
- {{ contract_request.hiree_id }}
-
-
-
- Número de Teléfono del Contratado
- El número de teléfono del contratado.
-
- {{ contract_request.hiree_cellphone }}
-
-
-
- Correo Electrónico del Contratado
- El correo electrónico de contacto del
- contratado.
-
- {{ contract_request.hiree_email }}
-
-
-
- Cenco
- Centro de costos asignado al contratado.
-
-
- {{ contract_request.cenco }}
-
-
-
- Motivo de la Solicitud
- El motivo por el cual se realiza la
- solicitud.
-
-
- {{ contract_request.request_motive }}
-
-
-
- Entidad Bancaria
- La entidad bancaria a la que está asociada
- la
- cuenta bancaria.
-
- {{ contract_request.banking_entity }}
-
-
-
- Tipo de Cuenta Bancaria
- El tipo de cuenta bancaria del contratado.
-
-
- {{ contract_request.get_bank_account_type_display }}
-
-
-
- Número de Cuenta Bancaria
- El número de cuenta bancaria del contratado.
-
-
- {{ contract_request.bank_account_number }}
-
-
-
- EPS
- La Entidad Promotora de Salud del
- contratado.
-
-
- {{ contract_request.eps }}
-
-
-
- Fondo de Pensiones
- El fondo de pensiones del contratado.
-
- {{ contract_request.pension_fund }}
-
-
-
- ARL
- La Administradora de Riesgos Laborales del
- contratado.
-
- {{ contract_request.arl }}
-
-
-
- Valor del Contrato
- El valor total del contrato.
-
- {{ contract_request.contract_value }}
-
-
-
- Cuenta de Cobro
- La cuenta bancaria a la que se realizarán
- los
- pagos correspondientes.
-
- {{ contract_request.charge_account }}
-
-
-
- Descargar
- Archivo RUT
-
-
-
-
- Nombre de curso
- El nombre de curso del contrato.
-
- {{ contract_request.course_name }}
-
-
-
- Periodo
- El periodo del curso.
-
- {{ contract_request.period }}
-
-
-
- Grupo
- El grupo del curso.
-
- {{ contract_request.group }}
-
-
-
- Intensidad horaria
- La intensidad horaria de las clases del curso.
-
- {{ contract_request.intensity }}
-
-
-
- Horas totales
- La cantidad de horas totales del curso.
-
- {{ contract_request.total_hours }}
-
-
-
- Codigo del curso
- El codigo del curso.
-
- {{ contract_request.course_code }}
-
-
-
- Cantidad de estudiantes
- La cantidad de estudiantes del curso.
-
- {{ contract_request.students_quantity }}
-
-
-
- Horas adicionales
- Las horas adicionales del curso.
-
- {{ contract_request.additional_hours }}
-
- {% for schedule in course_schedules %}
-
-
- Clase
-
-
-
-
-
- Fecha
- La fecha de la clase.
-
- {{ schedule.date }}
-
-
-
- Hora de inicio
- La hora de inicio de la clase.
-
- {{ schedule.start_time }}
-
-
-
- Hora de fin
- La hora de fin de la clase.
-
- {{ schedule.end_time }}
-
-
-
- Salón
- El salón de la clase.
-
- {{ schedule.room }}
-
-
-
- Responsabilidad
- Codigo de la responsabilidad de la clase.
-
- {{ schedule.responsability }}
-
- {% endfor %}
-
-
-
-
+
+ Solicitudes de contratos de CEX
+
+
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
+
+
+
+
+ Nombre Completo del Contratado
+
+ El nombre completo de la persona contratada.
+
+
+
+ {{ contract_request.hiree_full_name }}
+
+
+
+
+ ID del Contratado
+
+ El identificador único asignado al contratado.
+
+
+ {{ contract_request.hiree_id }}
+
+
+
+ Número de Teléfono del Contratado
+
+ El número de teléfono del contratado.
+
+
+
+ {{ contract_request.hiree_cellphone }}
+
+
+
+
+ Correo Electrónico del Contratado
+
+ El correo electrónico de contacto del contratado.
+
+
+
+ {{ contract_request.hiree_email }}
+
+
+
+
+ EPS
+
+ La Entidad Promotora de Salud del contratado.
+
+
+ {{ contract_request.eps }}
+
+
+
+ ARL
+
+ La Administradora de Riesgos Laborales del contratado.
+
+
+ {{ contract_request.arl }}
+
+
+
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+ Información del financiera
+
+
+
+
+
+
+
+
+ Cenco
+
+ Centro de costos asignado al contratado.
+
+
+ {{ contract_request.cenco }}
+
+
+
+ Entidad Bancaria
+
+ La entidad bancaria a la que está asociada la cuenta bancaria.
+
+
+
+ {{ contract_request.banking_entity }}
+
+
+
+
+
+
+ Tipo de Cuenta Bancaria
+
+ El tipo de cuenta bancaria del contratado.
+
+
+
+
+
+ {{ contract_request.get_bank_account_type_display }}
+
+
+
+
+
+
+ Número de Cuenta Bancaria
+
+ El número de cuenta bancaria del contratado.
+
+
+
+
+
+ {{ contract_request.bank_account_number }}
+
+
+
+
+
+ Fondo de Pensiones
+
+ El fondo de pensiones del contratado.
+
+
+
+
+
+ {{ contract_request.pension_fund }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información legal del contrato
+
+
+
+
+
+
+
+
+ Nombre de curso
+
+ El nombre de curso del contrato.
+
+
+
+ {{ contract_request.course_name }}
+
+
+
+
+ Periodo
+
+ El periodo del curso.
+
+
+ {{ contract_request.period }}
+
+
+
+ Grupo
+
+ El grupo del curso.
+
+
+ {{ contract_request.group }}
+
+
+
+ Intensidad horaria
+
+ La intensidad horaria de las clases del curso.
+
+
+ {{ contract_request.intensity }}
+
+
+
+ Horas totales
+
+ La cantidad de horas totales del curso.
+
+
+
+ {{ contract_request.total_hours }}
+
+
+
+
+ Codigo del curso
+
+ El codigo del curso.
+
+
+
+ {{ contract_request.course_code }}
+
+
+
+
+ Cantidad de estudiantes
+
+ La cantidad de estudiantes del curso.
+
+
+
+ {{ contract_request.students_quantity }}
+
+
+
+
+ Horas adicionales
+
+ Las horas adicionales del curso.
+
+
+
+ {{ contract_request.additional_hours }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información legal del contrato
+
+
+
+
+
+
+
+
+
+
+ Motivo de la Solicitud
+
+ El motivo por el cual se realiza la solicitud.
+
+
+
+
+
+ {{ contract_request.request_motive }}
+
+
+
+
+
+
+
+ Valor del Contrato
+
+ El valor total del contrato.
+
+
+
+
+
+ {{ contract_request.contract_value }}
+
+
+
+
+
+
+ Cuenta de Cobro
+
+ La cuenta bancaria a la que se realizarán los pagos
+ correspondientes.
+
+
+
+
+
+ {{ contract_request.charge_account }}
+
+
+
+
+
+
+ Descargar Archivo RUT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información legal del contrato
+
+
+
+
+
+
+ {% for schedule in course_schedules %}
+
+
+ Clase
+
+
+
+
+ Fecha
+
+ La fecha de la clase.
+
+
+ {{ schedule.date }}
+
+
+
+ Hora de inicio
+
+ La hora de inicio de la clase.
+
+
+ {{ schedule.start_time }}
+
+
+
+ Hora de fin
+
+ La hora de fin de la clase.
+
+
+ {{ schedule.end_time }}
+
+
+
+ Salón
+
+ El salón de la clase.
+
+
+ {{ schedule.room }}
+
+
+
+ Responsabilidad
+
+ Codigo de la responsabilidad de la clase.
+
+
+ {{ schedule.responsability }}
+
+ {% endfor %}
+
+
+
+
+
+
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_daily_requests.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_daily_requests.html
deleted file mode 100644
index 726e9dc..0000000
--- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_daily_requests.html
+++ /dev/null
@@ -1,77 +0,0 @@
-{% load static %}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Solicitudes CEX: 0
-
-
-
-
- Solicitudes Monitorias: 0
-
-
-
-
- Solicitudes Prestacion de Servicios: 0
-
-
-
-
-
-
-
-
-{{ daily_requests }}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_date_range_requests.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_date_range_requests.html
new file mode 100644
index 0000000..7212774
--- /dev/null
+++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_date_range_requests.html
@@ -0,0 +1,87 @@
+{% load static %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Solicitudes CEX:
+ 0
+
+
+
+
+ Solicitudes Monitorias:
+ 0
+
+
+
+
+ Solicitudes Prestacion de
+ Servicios: 0
+
+
+
+
+
+
+{{ daily_requests }}
+
+
+
+
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html
index a75c6ec..394e494 100644
--- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html
+++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html
@@ -1,10 +1,9 @@
{% load static %}
-
-
+
-
-
- Solicitudes Aprobadas: {{ leader_data.0.1 }}
+ Solicitudes Aprobadas:
+ {{ leader_data.0.1 }}
+
+
+
+
+ Solicitudes En revisión:
+ {{ leader_data.0.2 }}
- Solicitudes En revisión: {{ leader_data.0.2 }}
+ Solicitudes por validar:
+ {{ leader_data.0.3 }}
- Solicitudes por validar: {{ leader_data.0.3 }}
+ Solicitudes canceladas:
+ {{ leader_data.0.4 }}
@@ -41,22 +44,23 @@
-
-
-
+
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html
index 55f4fb2..90f10e2 100644
--- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html
+++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html
@@ -3,8 +3,8 @@
-
-
-
+
- var dailySelect = document.getElementById('data_select');
+
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/statistical_registers/statistics.html b/hiring_module/hiring_app/templates/statistical_registers/statistics.html
index d21caf1..c1b28c3 100644
--- a/hiring_module/hiring_app/templates/statistical_registers/statistics.html
+++ b/hiring_module/hiring_app/templates/statistical_registers/statistics.html
@@ -23,28 +23,25 @@ General
{% include 'statistical_registers/components/monthly_requests.html' %}
- {% include 'statistical_registers/components/pie_chart_daily_requests.html' %}
+ {% include 'statistical_registers/components/pie_chart_date_range_requests.html' %}
{% include 'statistical_registers/components/average_time_and_overdue_requests.html' %}
-
+
{% endblock %}
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/__init__.py b/hiring_module/hiring_app/tests/functionality/__init__.py
index 2f90783..7cd3312 100644
--- a/hiring_module/hiring_app/tests/functionality/__init__.py
+++ b/hiring_module/hiring_app/tests/functionality/__init__.py
@@ -1,5 +1,5 @@
from .auth import *
-from .control_board import *
+from .left_panel import *
from .request_creation import *
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/admin_user/___init___.py b/hiring_module/hiring_app/tests/functionality/admin_user/___init___.py
deleted file mode 100644
index 5d96140..0000000
--- a/hiring_module/hiring_app/tests/functionality/admin_user/___init___.py
+++ /dev/null
@@ -1 +0,0 @@
-from .admin_user import AdminUserTest
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/admin_user/__init__.py b/hiring_module/hiring_app/tests/functionality/admin_user/__init__.py
new file mode 100644
index 0000000..1a781ed
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/admin_user/__init__.py
@@ -0,0 +1 @@
+from .admin_user import *
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py b/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py
index c076f3a..f13144a 100644
--- a/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py
+++ b/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py
@@ -22,7 +22,7 @@ def tearDownClass(cls):
super().tearDownClass()
- def test_add_user(self):
+ def test_external_to_manager(self):
self.selenium.get(self.live_server_url)
username_input = self.selenium.find_element(By.NAME,'id')
@@ -38,7 +38,7 @@ def test_add_user(self):
self.selenium.find_element(By.ID, 'UserList').click()
time.sleep(2)
- self.assertEqual('Panel de control', self.selenium.title)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
self.selenium.find_element(By.ID, 'addUser').click()
@@ -52,10 +52,69 @@ def test_add_user(self):
time.sleep(2)
- user = self.selenium.find_element(By.ID, '1106293874').text
+ user = self.selenium.find_element(By.ID, '1106293874_id').text
self.assertIn('1106293874', user)
+ def test_manager_to_leader(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'UserList').click()
+
+ time.sleep(2)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'roleSelect_1111539567').send_keys('leader')
+
+ time.sleep(2)
+
+ self.assertEqual('1111539567', self.selenium.find_element(By.ID, '1111539567_id').text)
+
+ select_element = self.selenium.find_element(By.ID, "roleSelect_1111539567")
+
+ selected_option = select_element.find_element(By.CSS_SELECTOR, "option:checked")
+
+ selected_value = selected_option.get_attribute("value")
+
+ self.assertEqual('leader', selected_value)
+
+ def test_leader_to_admin(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'UserList').click()
+
+ time.sleep(2)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'roleSelect_1109185879').send_keys('administrator')
+
+ time.sleep(2)
+
+ self.assertEqual('1109185879', self.selenium.find_element(By.ID, '1109185879_id').text)
+
+ select_element = self.selenium.find_element(By.ID, "roleSelect_1109185879")
+
+ selected_option = select_element.find_element(By.CSS_SELECTOR, "option:checked")
+
+ selected_value = selected_option.get_attribute("value")
+
+ self.assertEqual('admin', selected_value)
def test_delete_user(self):
@@ -75,15 +134,13 @@ def test_delete_user(self):
self.selenium.find_element(By.ID, 'UserList').click()
time.sleep(2)
- self.assertEqual('Panel de control', self.selenium.title)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
self.selenium.find_element(By.ID, 'roleSelect_1109185879').send_keys('remove')
+
+ time.sleep(2)
-
- try:
- self.selenium.find_element(By.ID, 'addUser').click()
- except StaleElementReferenceException:
- self.selenium.find_element(By.ID, 'addUser').click()
+ self.selenium.find_element(By.ID, 'addUser').click()
self.assertEqual('1109185879', self.selenium.find_element(By.ID, '1109185879_id').text)
diff --git a/hiring_module/hiring_app/tests/functionality/auth/login.py b/hiring_module/hiring_app/tests/functionality/auth/login.py
index 883f639..b5ea3aa 100644
--- a/hiring_module/hiring_app/tests/functionality/auth/login.py
+++ b/hiring_module/hiring_app/tests/functionality/auth/login.py
@@ -65,3 +65,27 @@ def test_login_external_user(self):
password_input.send_keys(Keys.RETURN)
self.assertIn('Panel de control de usuario externo', self.selenium.title)
+
+ def test_login_wrong_password(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Log In', self.selenium.title)
+
+ def test_login_wrong_username(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('111607086')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Log In', self.selenium.title)
diff --git a/hiring_module/hiring_app/tests/functionality/control_board/__init__.py b/hiring_module/hiring_app/tests/functionality/control_board/__init__.py
deleted file mode 100644
index 1ab8cc0..0000000
--- a/hiring_module/hiring_app/tests/functionality/control_board/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from .control_board_external_user import ControlBoardExternalUser
diff --git a/hiring_module/hiring_app/tests/functionality/control_board/control_board_external_user.py b/hiring_module/hiring_app/tests/functionality/control_board/control_board_external_user.py
deleted file mode 100644
index 0bdec89..0000000
--- a/hiring_module/hiring_app/tests/functionality/control_board/control_board_external_user.py
+++ /dev/null
@@ -1,71 +0,0 @@
-from django.contrib.auth.models import User
-from django.contrib.staticfiles.testing import StaticLiveServerTestCase
-from selenium.webdriver.chrome.webdriver import WebDriver
-from selenium.webdriver.common.keys import Keys
-from selenium.webdriver.common.by import By
-
-class ControlBoardExternalUser(StaticLiveServerTestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
- cls.selenium = WebDriver()
- cls.selenium.implicitly_wait(10)
-
- @classmethod
- def tearDownClass(cls):
- cls.selenium.quit()
- super().tearDownClass()
-
-
- def test_get_form_monitoring(self):
- self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
- password_input = self.selenium.find_element(By.NAME, 'password')
- username_input.send_keys('1106293874')
- password_input.send_keys('mariagonzales123')
-
- password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_monitoring_contract')
-
- button_create_monitoring_contract.click()
-
-
- self.assertIn('Solicitudes de contratos de Monitoría', self.selenium.title)
-
-
- def test_get_form_cex(self):
- self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
- password_input = self.selenium.find_element(By.NAME, 'password')
- username_input.send_keys('1106293874')
- password_input.send_keys('mariagonzales123')
-
- password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_cex_contract')
-
- button_create_monitoring_contract.click()
-
-
- self.assertIn('Solicitudes de contratos CEX', self.selenium.title)
-
-
- def test_get_form_pos(self):
- self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
- password_input = self.selenium.find_element(By.NAME, 'password')
- username_input.send_keys('1106293874')
- password_input.send_keys('mariagonzales123')
-
- password_input.send_keys(Keys.RETURN)
-
- button_create_pos_contract = self.selenium.find_element(By.ID, 'create_pos_contract')
-
- button_create_pos_contract.click()
-
-
- self.assertIn('Solicitudes de contratos POS', self.selenium.title)
diff --git a/hiring_module/hiring_app/tests/functionality/left_panel/__init__.py b/hiring_module/hiring_app/tests/functionality/left_panel/__init__.py
new file mode 100644
index 0000000..aca00a3
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/left_panel/__init__.py
@@ -0,0 +1 @@
+from .left_panel_navitagion import *
diff --git a/hiring_module/hiring_app/tests/functionality/left_panel/left_panel_navitagion.py b/hiring_module/hiring_app/tests/functionality/left_panel/left_panel_navitagion.py
new file mode 100644
index 0000000..5795df0
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/left_panel/left_panel_navitagion.py
@@ -0,0 +1,98 @@
+from django.contrib.auth.models import User
+from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from selenium.webdriver.chrome.webdriver import WebDriver
+from selenium.webdriver.common.keys import Keys
+from selenium.webdriver.common.by import By
+from selenium.common.exceptions import NoSuchElementException
+
+class LeftPanelNavigation(StaticLiveServerTestCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.selenium = WebDriver()
+ cls.selenium.implicitly_wait(10)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.selenium.quit()
+ super().tearDownClass()
+
+
+ def test_admin_redirections(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+
+ password_input.send_keys(Keys.RETURN)
+
+ user_list_button = self.selenium.find_element(By.ID, 'UserList')
+
+ user_list_button.click()
+
+
+ self.assertIn('Lista de usuarios', self.selenium.title)
+
+ control_pannel_button = self.selenium.find_element(By.ID, 'ControlPanel')
+
+ control_pannel_button.click()
+
+ self.assertIn('Panel de control', self.selenium.title)
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ def test_leader_redirections(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1107838593')
+ password_input.send_keys('alejandrolondono123')
+
+
+ password_input.send_keys(Keys.RETURN)
+
+ with self.assertRaises(NoSuchElementException):
+ user_list_button = self.selenium.find_element(By.ID, 'UserList')
+
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ control_pannel_button = self.selenium.find_element(By.ID, 'ControlPanel')
+
+ control_pannel_button.click()
+
+ self.assertIn('Panel de control', self.selenium.title)
+
+ def test_external_user_redirections(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ with self.assertRaises(NoSuchElementException):
+ user_list_button = self.selenium.find_element(By.ID, 'UserList')
+
+ with self.assertRaises(NoSuchElementException):
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ control_pannel_button = self.selenium.find_element(By.ID, 'ControlPanel')
+
+ control_pannel_button.click()
+
+ self.assertIn('Panel de control', self.selenium.title)
diff --git a/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py b/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py
index ea391c8..88d5b39 100644
--- a/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py
+++ b/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py
@@ -5,155 +5,290 @@
from selenium.webdriver.common.by import By
import os
import time
+from selenium.common.exceptions import NoSuchElementException
+
class CreateHiringRequest(StaticLiveServerTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.selenium = WebDriver()
- cls.selenium.implicitly_wait(10)
+ cls.selenium.implicitly_wait(10)
@classmethod
def tearDownClass(cls):
cls.selenium.quit()
super().tearDownClass()
-
def test_create_form_monitoring(self):
self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
password_input = self.selenium.find_element(By.NAME, 'password')
username_input.send_keys('1106293874')
password_input.send_keys('mariagonzales123')
-
+
password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_monitoring_contract')
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_monitoring_contract')
button_create_monitoring_contract.click()
self.selenium.find_element(By.NAME, 'cenco').send_keys('Cenco ABC')
- self.selenium.find_element(By.NAME, 'cenco_manager').send_keys('John Doe')
- monitoring_type = self.selenium.find_element(By.NAME, 'monitoring_type')
- monitoring_type.send_keys('Academic')
+ self.selenium.find_element(
+ By.NAME, 'cenco_manager').send_keys('John Doe')
+ monitoring_type = self.selenium.find_element(
+ By.NAME, 'monitoring_type')
+ monitoring_type.send_keys('Academico')
self.selenium.find_element(By.NAME, 'student_code').send_keys('123456')
- self.selenium.find_element(By.NAME, 'student_full_name').send_keys('Jane Smith')
+ self.selenium.find_element(
+ By.NAME, 'student_full_name').send_keys('Jane Smith')
self.selenium.find_element(By.NAME, 'student_id').send_keys('7890123')
- self.selenium.find_element(By.NAME, 'student_email').send_keys('jane@example.com')
- self.selenium.find_element(By.NAME, 'student_cellphone').send_keys('1234567890')
- self.selenium.find_element(By.NAME, 'daviplata').send_keys('Daviplata XYZ')
- self.selenium.find_element(By.NAME, 'course_or_proyect').send_keys('Project ABC')
- self.selenium.find_element(By.NAME, 'monitoring_description').send_keys('Description of monitoring')
- self.selenium.find_element(By.NAME, 'weekly_hours').send_keys('10') # Assuming 10 weekly hours
- self.selenium.find_element(By.NAME, 'total_value_to_pay').send_keys('100000') # Assuming total value
+ self.selenium.find_element(
+ By.NAME, 'student_email').send_keys('jane@example.com')
+ self.selenium.find_element(
+ By.NAME, 'student_cellphone').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'daviplata').send_keys('Daviplata XYZ')
+ self.selenium.find_element(
+ By.NAME, 'course_or_proyect').send_keys('Project ABC')
+ self.selenium.find_element(By.NAME, 'monitoring_description').send_keys(
+ 'Description of monitoring')
+ self.selenium.find_element(By.NAME, 'weekly_hours').send_keys(
+ '10') # Assuming 10 weekly hours
+ self.selenium.find_element(By.NAME, 'total_value_to_pay').send_keys(
+ '100000') # Assuming total value
self.selenium.find_element(By.NAME, 'is_unique_payment').click()
- self.selenium.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
time.sleep(5)
- notification_message = self.selenium.find_element(By.ID, "notificationMessage").text
-
- self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
- self.assertIn('Solicitudes de contratos de Monitoría', self.selenium.title)
+ self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ self.assertIn('Solicitudes de contratos de Monitoría',
+ self.selenium.title)
def test_create_form_cex(self):
self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
password_input = self.selenium.find_element(By.NAME, 'password')
username_input.send_keys('1106293874')
password_input.send_keys('mariagonzales123')
-
+
password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_cex_contract')
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_cex_contract')
button_create_monitoring_contract.click()
-
- self.selenium.find_element(By.NAME, 'solicitant_name').send_keys('John Doe')
- self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys('Faculty of Engineering')
- self.selenium.find_element(By.NAME, 'hiree_full_name').send_keys('Jane Smith')
+
+ self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys(
+ 'Faculty of Engineering')
+ self.selenium.find_element(
+ By.NAME, 'hiree_full_name').send_keys('Jane Smith')
self.selenium.find_element(By.NAME, 'hiree_id').send_keys('123456789')
- self.selenium.find_element(By.NAME, 'hiree_cellphone').send_keys('1234567890')
- self.selenium.find_element(By.NAME, 'hiree_email').send_keys('jane@example.com')
+ self.selenium.find_element(
+ By.NAME, 'hiree_cellphone').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'hiree_email').send_keys('jane@example.com')
self.selenium.find_element(By.NAME, 'cenco').send_keys('Cenco 123')
- self.selenium.find_element(By.NAME, 'request_motive').send_keys('Hiring new employee')
- self.selenium.find_element(By.NAME, 'banking_entity').send_keys('Bank of Example')
- bank_account_type = self.selenium.find_element(By.NAME, 'bank_account_type')
- bank_account_type.send_keys('Savings')
- self.selenium.find_element(By.NAME, 'bank_account_number').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'request_motive').send_keys('Hiring new employee')
+ self.selenium.find_element(
+ By.NAME, 'banking_entity').send_keys('Bank of Example')
+ bank_account_type = self.selenium.find_element(
+ By.NAME, 'bank_account_type')
+ bank_account_type.send_keys('Ahorros')
+ self.selenium.find_element(
+ By.NAME, 'bank_account_number').send_keys('1234567890')
self.selenium.find_element(By.NAME, 'eps').send_keys('EPS Company')
- self.selenium.find_element(By.NAME, 'pension_fund').send_keys('Pension Fund')
+ self.selenium.find_element(
+ By.NAME, 'pension_fund').send_keys('Pension Fund')
self.selenium.find_element(By.NAME, 'arl').send_keys('ARL Company')
- self.selenium.find_element(By.NAME, 'contract_value').send_keys('1000000')
- self.selenium.find_element(By.NAME, 'charge_account').send_keys('Charge account details')
- ruta_documento_pdf = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'documento.pdf')
+ self.selenium.find_element(
+ By.NAME, 'contract_value').send_keys('1000000')
+ self.selenium.find_element(By.NAME, 'charge_account').send_keys(
+ 'Charge account details')
+ ruta_documento_pdf = os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), 'documento.pdf')
- self.selenium.find_element(By.NAME, 'rut').send_keys(ruta_documento_pdf)
+ self.selenium.find_element(
+ By.NAME, 'rut').send_keys(ruta_documento_pdf)
- self.selenium.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
time.sleep(2)
- notification_message = self.selenium.find_element(By.ID, "notificationMessage").text
-
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
+
self.assertEqual(notification_message, "La solicitud fue exitosa.")
self.assertIn('Solicitudes de contratos CEX', self.selenium.title)
-
def test_create_form_pos(self):
self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
password_input = self.selenium.find_element(By.NAME, 'password')
username_input.send_keys('1106293874')
password_input.send_keys('mariagonzales123')
-
+
password_input.send_keys(Keys.RETURN)
-
- button_create_pos_contract = self.selenium.find_element(By.ID, 'create_pos_contract')
+
+ button_create_pos_contract = self.selenium.find_element(
+ By.ID, 'create_pos_contract')
button_create_pos_contract.click()
-
- self.selenium.find_element(By.NAME, 'solicitant_name').send_keys('John Doe')
- self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys('Faculty of Engineering')
- self.selenium.find_element(By.NAME, 'hiree_full_name').send_keys('Jane Smith')
+
+ self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys(
+ 'Faculty of Engineering')
+ self.selenium.find_element(
+ By.NAME, 'hiree_full_name').send_keys('Jane Smith')
self.selenium.find_element(By.NAME, 'hiree_id').send_keys('123456789')
- self.selenium.find_element(By.NAME, 'hiree_cellphone').send_keys('1234567890')
- self.selenium.find_element(By.NAME, 'hiree_email').send_keys('jane@example.com')
+ self.selenium.find_element(
+ By.NAME, 'hiree_cellphone').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'hiree_email').send_keys('jane@example.com')
self.selenium.find_element(By.NAME, 'cenco').send_keys('Cenco 123')
- self.selenium.find_element(By.NAME, 'request_motive').send_keys('Hiring new employee')
- self.selenium.find_element(By.NAME, 'banking_entity').send_keys('Bank of Example')
- bank_account_type = self.selenium.find_element(By.NAME, 'bank_account_type')
- bank_account_type.send_keys('Savings')
- self.selenium.find_element(By.NAME, 'bank_account_number').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'request_motive').send_keys('Hiring new employee')
+ self.selenium.find_element(
+ By.NAME, 'banking_entity').send_keys('Bank of Example')
+ bank_account_type = self.selenium.find_element(
+ By.NAME, 'bank_account_type')
+ bank_account_type.send_keys('Ahorros')
+ self.selenium.find_element(
+ By.NAME, 'bank_account_number').send_keys('1234567890')
self.selenium.find_element(By.NAME, 'eps').send_keys('EPS Company')
- self.selenium.find_element(By.NAME, 'pension_fund').send_keys('Pension Fund')
+ self.selenium.find_element(
+ By.NAME, 'pension_fund').send_keys('Pension Fund')
self.selenium.find_element(By.NAME, 'arl').send_keys('ARL Company')
- self.selenium.find_element(By.NAME, 'contract_value').send_keys('1000000')
- self.selenium.find_element(By.NAME, 'charge_account').send_keys('Charge account details')
- ruta_documento_pdf = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'documento.pdf')
+ self.selenium.find_element(
+ By.NAME, 'contract_value').send_keys('1000000')
+ self.selenium.find_element(By.NAME, 'charge_account').send_keys(
+ 'Charge account details')
+ ruta_documento_pdf = os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), 'documento.pdf')
- self.selenium.find_element(By.NAME, 'rut').send_keys(ruta_documento_pdf)
- self.selenium.find_element(By.NAME, 'course_name').send_keys('Computer Science')
+ self.selenium.find_element(
+ By.NAME, 'rut').send_keys(ruta_documento_pdf)
+ self.selenium.find_element(
+ By.NAME, 'course_name').send_keys('Computer Science')
self.selenium.find_element(By.NAME, 'period').send_keys('2024 Spring')
self.selenium.find_element(By.NAME, 'group').send_keys('Group A')
self.selenium.find_element(By.NAME, 'intensity').send_keys('20')
self.selenium.find_element(By.NAME, 'total_hours').send_keys('40')
self.selenium.find_element(By.NAME, 'course_code').send_keys('CS101')
- self.selenium.find_element(By.NAME, 'students_quantity').send_keys('30')
+ self.selenium.find_element(
+ By.NAME, 'students_quantity').send_keys('30')
self.selenium.find_element(By.NAME, 'additional_hours').send_keys('10')
- self.selenium.find_element(By.ID, 'add-fields-btn').click()
- additional_fields = self.selenium.find_elements(By.XPATH, '//div[@id="additionalFields"]')
+ additional_fields = self.selenium.find_elements(
+ By.XPATH, '//div[@id="additionalFields"]')
for field in additional_fields:
- field.find_element(By.NAME, 'additionalFields-date').send_keys('2024-05-04')
- field.find_element(By.NAME, 'additionalFields-start_time').send_keys('08:001') # 1 para AM
- field.find_element(By.NAME, 'additionalFields-end_time').send_keys('12:002') # 2 para PM
- field.find_element(By.NAME, 'additionalFields-room').send_keys('Room 101')
- field.find_element(By.NAME, 'additionalFields-responsability').send_keys('Teaching')
+ field.find_element(
+ By.CSS_SELECTOR, "[name^='additionalFields-date']").send_keys('2024-05-04')
+ field.find_element(
+ # 1 para AM
+ By.CSS_SELECTOR, "[name^='additionalFields-start_time']").send_keys('08:001')
+ field.find_element(
+ # 2 para PM
+ By.CSS_SELECTOR, "[name^='additionalFields-end_time']").send_keys('12:002')
+ field.find_element(
+ By.CSS_SELECTOR, "[name^='additionalFields-room']").send_keys('101D')
+ field.find_element(
+ By.CSS_SELECTOR, "[name^='additionalFields-responsability']").send_keys('Teaching')
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+ time.sleep(4)
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
+
+ self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ self.assertIn('Solicitudes de contratos POS', self.selenium.title)
+
+ def test_create_form_monitoring_wrong_data(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_monitoring_contract')
- self.selenium.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
+ button_create_monitoring_contract.click()
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+
time.sleep(2)
- notification_message = self.selenium.find_element(By.ID, "notificationMessage").text
+
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage")
- self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ self.assertEqual(notification_message.text, "")
+
+ self.assertIn('Solicitudes de contratos de Monitoría',
+ self.selenium.title)
+
+ def test_create_form_cex_wrong_data(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_cex_contract')
+
+ button_create_monitoring_contract.click()
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+
+ time.sleep(2)
+
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage")
+
+ self.assertEqual(notification_message.text, "")
+
+ self.assertIn('Solicitudes de contratos CEX', self.selenium.title)
+
+ def test_create_form_pos_wrong_data(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ button_create_pos_contract = self.selenium.find_element(
+ By.ID, 'create_pos_contract')
+
+ button_create_pos_contract.click()
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+
+ time.sleep(2)
+
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
+
+ self.assertEqual(notification_message, "")
+
self.assertIn('Solicitudes de contratos POS', self.selenium.title)
+
diff --git a/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py b/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py
index 706144e..883dce8 100644
--- a/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py
+++ b/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py
@@ -18,6 +18,149 @@ def tearDownClass(cls):
cls.selenium.quit()
super().tearDownClass()
+ def test_search_request_hiring_by_id(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ search_input.send_keys(id)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_solicitant(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ solicitant = first_result.find_element(By.XPATH, './td[2]').text
+
+ search_input.send_keys(solicitant)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_state(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ state = "Pendiente"
+
+ search_input.send_keys(state)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_date(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ date = first_result.find_element(By.XPATH, './td[6]').text
+
+ search_input.send_keys(date)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_wrong_id(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys('abcdef-abcdef-abcdef')
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn('No matching records found', self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr/td').text)
+
+ def test_access_request_hiring(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+
def test_request_hiring_assing_leader(self):
self.selenium.get(self.live_server_url)
@@ -79,9 +222,64 @@ def test_request_hiring_assing_manager(self):
self.assertIn('La solicitud fue exitosa.', self.selenium.find_element(By.ID, 'notificationMessage').text)
+ def test_request_hiring_change_status_pending_review_filled(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
- def test_request_hiring_change_status(self):
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
+ select.select_by_index(1)
+
+
+ time.sleep(2)
+
+ self.assertIn('50%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ with self.assertRaises(NotImplementedError):
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(2)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(3)
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ def test_request_hiring_change_status_pending_incomplete_cancelled(self):
self.selenium.get(self.live_server_url)
username_input = self.selenium.find_element(By.NAME,'id')
@@ -92,6 +290,12 @@ def test_request_hiring_change_status(self):
password_input.send_keys(Keys.RETURN)
self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
@@ -105,17 +309,148 @@ def test_request_hiring_change_status(self):
select = Select(select_element)
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
select.select_by_index(2)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ time.sleep(2)
+
+ self.assertIn('75%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(4)
+
self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+
+ def test_request_hiring_change_status_pending_incomplete_review_cancelled(self):
+ self.selenium.get(self.live_server_url)
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
- self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Save changes"]').click()
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
- time.sleep(2)
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
+
+ with self.assertRaises(NotImplementedError):
+ select.select_by_index(3)
+
+ select.select_by_index(2)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
self.assertIn('75%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+ with self.assertRaises(NotImplementedError):
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(3)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(1)
+
+ self.assertIn('50%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(4)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ def test_request_hiring_change_status_pending_cancelled(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
+ select.select_by_index(4)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
def test_request_hiring_comment(self):
@@ -180,6 +515,4 @@ def test_request_hiring_snapshot(self):
info = self.selenium.find_element(By.ID, 'pending').text
- print(info)
-
self.assertIn('Estado de la contratacion:\npending', info)
diff --git a/hiring_module/hiring_app/tests/functionality/statistics/__init__.py b/hiring_module/hiring_app/tests/functionality/statistics/__init__.py
new file mode 100644
index 0000000..a7d4d95
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/statistics/__init__.py
@@ -0,0 +1 @@
+from .statistics import *
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/statistics/statistics.py b/hiring_module/hiring_app/tests/functionality/statistics/statistics.py
new file mode 100644
index 0000000..441113a
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/statistics/statistics.py
@@ -0,0 +1,172 @@
+from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from selenium.webdriver.chrome.webdriver import WebDriver
+from selenium.webdriver.common.keys import Keys
+from selenium.webdriver.common.by import By
+from datetime import datetime
+from selenium.webdriver.support.select import Select
+import time
+
+class StatisticsTest(StaticLiveServerTestCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.selenium = WebDriver()
+ cls.selenium.implicitly_wait(10)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.selenium.quit()
+ super().tearDownClass()
+
+ def test_date_range_statistics(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ time.sleep(2)
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ # Get the current date
+ current_date = datetime.now().strftime('%m/%d/%Y')
+
+ # Send the current date to the start_date field
+ start_date = self.selenium.find_element(By.ID, 'start_date')
+ start_date.send_keys(current_date)
+
+ # Send the current date to the end_date field
+ end_date = self.selenium.find_element(By.ID, 'end_date')
+ end_date.send_keys(current_date)
+
+ contratos_cex = self.selenium.find_element(By.ID, 'contratos_cex').text
+ self.assertIn('4', contratos_cex)
+
+ def test_leader_statistics(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ time.sleep(2)
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.NAME, 'leader')
+
+ select = Select(select_element)
+
+ select.select_by_index(1)
+
+ time.sleep(2)
+
+ self.assertIn('La solicitud fue exitosa.', self.selenium.find_element(By.ID, 'notificationMessage').text)
+
+ notificationCloseBtn = self.selenium.find_element(By.ID, 'notificationCloseBtn')
+
+ notificationCloseBtn.click()
+
+ time.sleep(2)
+
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ time.sleep(2)
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ select_element = self.selenium.find_element(By.ID, "data_leader_select")
+
+ select = Select(select_element)
+
+ select.select_by_index(0)
+
+ solicitudes_por_validar_leader = self.selenium.find_element(By.ID, 'solicitudes_por_validar_leader').text
+
+ self.assertIn('1', solicitudes_por_validar_leader)
+
+ time.sleep(2)
+
+ def test_manager_statistics(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ time.sleep(2)
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.NAME, 'manager')
+
+ select = Select(select_element)
+
+ select.select_by_index(1)
+
+ time.sleep(2)
+
+ self.assertIn('La solicitud fue exitosa.', self.selenium.find_element(By.ID, 'notificationMessage').text)
+
+ notificationCloseBtn = self.selenium.find_element(By.ID, 'notificationCloseBtn')
+
+ notificationCloseBtn.click()
+
+ time.sleep(2)
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ time.sleep(2)
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+
+ select_element = self.selenium.find_element(By.ID, "data_manager_select")
+
+ select = Select(select_element)
+
+ select.select_by_index(0)
+
+ solicitudes_por_validar_leader = self.selenium.find_element(By.ID, 'solicitudes_por_validar_manager').text
+
+ self.assertIn('1', solicitudes_por_validar_leader)
+
+
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/urls.py b/hiring_module/hiring_app/urls.py
index a99599b..644bb0c 100644
--- a/hiring_module/hiring_app/urls.py
+++ b/hiring_module/hiring_app/urls.py
@@ -10,6 +10,7 @@
from hiring_app.views.control_board.administrator_user_list_view import AdministratorUserListView
from hiring_app.views.control_board.add_user_view import AddUserView
from hiring_app.views.statistical_registers.statistics_view import StatisticsView
+from hiring_app.views.control_board.export_requests_view import ExportRequestsView
app_name = 'hiring_app'
@@ -43,5 +44,6 @@
path('download_rut//',
download_rut_file, name='download_rut'),
path('statistics/', StatisticsView.as_view(), name='statistics'),
+ path('export_requests/', ExportRequestsView.as_view(), name='export_requests')
]
diff --git a/hiring_module/hiring_app/views/__init__.py b/hiring_module/hiring_app/views/__init__.py
index 5ba591d..50fe5f3 100644
--- a/hiring_module/hiring_app/views/__init__.py
+++ b/hiring_module/hiring_app/views/__init__.py
@@ -9,3 +9,4 @@
from .control_board.leader_dashboard_view import LeaderDashboardView
from .control_board.manager_dashboard_view import ManagerDashboardView
from .request_hiring.assign_leader import AssignLeaderView
+from .control_board.export_requests_view import ExportRequestsView
diff --git a/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py b/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py
index 6511824..d34c283 100644
--- a/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py
+++ b/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py
@@ -21,11 +21,23 @@ def dispatch(self, *args, **kwargs):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
users = CustomUser.objects.filter(groups__name__in=['admin', 'leader', 'manager'])
+ admins_ammount = 0
+ leaders_ammount = 0
+ managers_ammount = 0
# Add a role field to each user object
for user in users:
user.role = str(user.groups.first())
+ if user.role == 'admin':
+ admins_ammount += 1
+ elif user.role == 'leader':
+ leaders_ammount += 1
+ elif user.role == 'manager':
+ managers_ammount += 1
context['users'] = users
context['actualgroup'] = 'admin'
+ context['admins_ammount'] = admins_ammount
+ context['leaders_ammount'] = leaders_ammount
+ context['managers_ammount'] = managers_ammount
return context
def post(self, request, *args, **kwargs):
diff --git a/hiring_module/hiring_app/views/control_board/export_requests_view.py b/hiring_module/hiring_app/views/control_board/export_requests_view.py
new file mode 100644
index 0000000..7572999
--- /dev/null
+++ b/hiring_module/hiring_app/views/control_board/export_requests_view.py
@@ -0,0 +1,8 @@
+from django.shortcuts import redirect
+from django.views import View
+from hiring_app.model.user_model import CustomUser
+from .utilities import export_requests
+class ExportRequestsView(View):
+
+ def get(self, request):
+ return export_requests(self.request.user)
\ No newline at end of file
diff --git a/hiring_module/hiring_app/views/control_board/utilities.py b/hiring_module/hiring_app/views/control_board/utilities.py
index 88b8c00..df72451 100644
--- a/hiring_module/hiring_app/views/control_board/utilities.py
+++ b/hiring_module/hiring_app/views/control_board/utilities.py
@@ -7,6 +7,14 @@
from hiring_app.model.cex_contract_request_model import CEXContractRequest
from hiring_app.model.monitoring_contract_request_model import MonitoringContractRequest
from hiring_app.model.provision_of_services_request_model import ProvisionOfServicesContractRequest
+from django.http import HttpResponse
+from openpyxl import Workbook
+
+from datetime import datetime
+from django.db.models import Q
+from django.utils import timezone
+from itertools import chain
+
# Decorator to redirect users to the correct dashboard based on their role
def role_redirect(view_func):
@@ -89,15 +97,57 @@ def get_requests(user):
requests_CEX = CEXContractRequest.objects.filter(manager_assigned_to=user.id)
requests_monitoring = MonitoringContractRequest.objects.filter(manager_assigned_to=user.id)
requests_pos = ProvisionOfServicesContractRequest.objects.filter(manager_assigned_to=user.id)
+
+ for request in requests_CEX:
+ request.request_type = 'CEX'
+
+ for request in requests_monitoring:
+ request.request_type = 'Monitoría'
+
+ for request in requests_pos:
+ request.request_type = 'Honorarios'
groupManager = Group.objects.get(name='manager')
groupLeader = Group.objects.get(name='leader')
managers = list(CustomUser.objects.filter(groups=groupManager))
leaders = list(CustomUser.objects.filter(groups=groupLeader))
+
+ current_date = timezone.now()
+ current_month = current_date.month
+ current_year = current_date.year
+
+ requests = list(requests_CEX) + list(requests_monitoring) + list(requests_pos)
+
+ requests_month = list(
+ chain(
+ requests_CEX.filter(start_date__month=current_month, start_date__year=current_year),
+ requests_monitoring.filter(start_date__month=current_month, start_date__year=current_year),
+ requests_pos.filter(start_date__month=current_month, start_date__year=current_year)
+ )
+ )
+
+ filled_requests = list(
+ chain(
+ requests_CEX.filter(start_date__month=current_month, start_date__year=current_year, state='filed'),
+ requests_monitoring.filter(start_date__month=current_month, start_date__year=current_year, state='filed'),
+ requests_pos.filter(start_date__month=current_month, start_date__year=current_year, state='filed')
+ )
+ )
+
+ reviewed_requests = list(
+ chain(
+ requests_CEX.filter(start_date__month=current_month, start_date__year=current_year, state='review'),
+ requests_monitoring.filter(start_date__month=current_month, start_date__year=current_year, state='review'),
+ requests_pos.filter(start_date__month=current_month, start_date__year=current_year, state='review')
+ )
+ )
+
+
return {
- 'requests': list(requests_CEX) + list(requests_monitoring) + list(requests_pos),
- 'filled_requests': list(requests_CEX.filter(state='filed')) + list(requests_monitoring.filter(state='filed')) + list(requests_pos.filter(state='filed')),
- 'reviewed_requests': list(requests_CEX.filter(state='review')) + list(requests_monitoring.filter(state='review')) + list(requests_pos.filter(state='review')),
+ 'requests': requests,
+ 'requests_month': requests_month,
+ 'filled_requests': filled_requests,
+ 'reviewed_requests': reviewed_requests,
'for_validate_requests': list(requests_CEX.filter(state__in=['pending', 'incomplete'])) + list(requests_monitoring.filter(state__in=['pending', 'incomplete'])) + list(requests_pos.filter(state__in=['pending', 'incomplete'])),
'leaders': leaders,
'managers': managers,
@@ -105,4 +155,257 @@ def get_requests(user):
-
+def export_requests(user):
+ groups = [group.name for group in user.groups.all()]
+ requests_CEX = CEXContractRequest.objects.none()
+ requests_monitoring = MonitoringContractRequest.objects.none()
+ requests_pos = ProvisionOfServicesContractRequest.objects.none()
+
+ if 'admin' in groups:
+ requests_CEX = CEXContractRequest.objects.all()
+ requests_monitoring = MonitoringContractRequest.objects.all()
+ requests_pos = ProvisionOfServicesContractRequest.objects.all()
+ elif 'leader' in groups:
+ requests_CEX = CEXContractRequest.objects.filter(leader_assigned_to=user.id)
+ requests_monitoring = MonitoringContractRequest.objects.filter(leader_assigned_to=user.id)
+ requests_pos = ProvisionOfServicesContractRequest.objects.filter(leader_assigned_to=user.id)
+ elif 'manager' in groups:
+ requests_CEX = CEXContractRequest.objects.filter(manager_assigned_to=user.id)
+ requests_monitoring = MonitoringContractRequest.objects.filter(manager_assigned_to=user.id)
+ requests_pos = ProvisionOfServicesContractRequest.objects.filter(manager_assigned_to=user.id)
+
+
+
+ wb = Workbook()
+
+ ws1 = wb.active
+ ws1.title = "Solicitudes de Contratación"
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ ]
+
+ ws1.append(headers)
+
+ for request in (list(requests_CEX) + list(requests_monitoring) + list(requests_pos)):
+ row_data = [
+ str(request.id),
+ request.start_date.strftime('%Y-%m-%d'),
+ request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if request.completion_date else None,
+ request.estimated_completion_date.strftime('%Y-%m-%d') if request.estimated_completion_date else None,
+ request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ request.state,
+ f'{request.manager_assigned_to.first_name} {request.manager_assigned_to.last_name}' if request.manager_assigned_to else 'sin asignar',
+ f'{request.leader_assigned_to.first_name} {request.leader_assigned_to.last_name}' if request.leader_assigned_to else 'sin asignar',
+ f'{request.created_by.first_name} {request.created_by.last_name}' if request.created_by else 'sin asignar',
+ ]
+ ws1.append(row_data)
+
+
+ ws2 = wb.create_sheet(title="CEX")
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ "Hiree Full Name",
+ "Hiree ID",
+ "Hiree Cellphone",
+ "Hiree Email",
+ "Cenco",
+ "Request Motive",
+ "Banking Entity",
+ "Bank Account Type",
+ "Bank Account Number",
+ "EPS",
+ "Pension Fund",
+ "ARL",
+ "Contract Value",
+ "Charge Account",
+ "RUT"
+ ]
+ ws2.append(headers)
+
+ for cex_request in requests_CEX:
+ row_data = [
+ str(cex_request.id),
+ cex_request.start_date.strftime('%Y-%m-%d'),
+ cex_request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if cex_request.completion_date else None,
+ cex_request.estimated_completion_date.strftime('%Y-%m-%d') if cex_request.estimated_completion_date else None,
+ cex_request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ cex_request.state,
+ f'{cex_request.manager_assigned_to.first_name} {cex_request.manager_assigned_to.last_name}' if cex_request.manager_assigned_to else 'sin asignar',
+ f'{cex_request.leader_assigned_to.first_name} {cex_request.leader_assigned_to.last_name}' if cex_request.leader_assigned_to else 'sin asignar',
+ f'{cex_request.created_by.first_name} {cex_request.created_by.last_name}' if cex_request.created_by else 'sin asignar',
+ cex_request.hiree_full_name,
+ cex_request.hiree_id,
+ cex_request.hiree_cellphone,
+ cex_request.hiree_email,
+ cex_request.cenco,
+ cex_request.request_motive,
+ cex_request.banking_entity,
+ cex_request.bank_account_type,
+ cex_request.bank_account_number,
+ cex_request.eps,
+ cex_request.pension_fund,
+ cex_request.arl,
+ cex_request.contract_value,
+ cex_request.charge_account,
+ cex_request.rut.url if cex_request.rut else ""
+ ]
+ ws2.append(row_data)
+
+ ws3 = wb.create_sheet(title="Monitorías")
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ "Cenco",
+ "Has Money in Cenco",
+ "Cenco Manager",
+ "Monitoring Type",
+ "Student Code",
+ "Student Full Name",
+ "Student ID",
+ "Student Email",
+ "Student Cellphone",
+ "Daviplata",
+ "Course or Project",
+ "Monitoring Description",
+ "Weekly Hours",
+ "Total Value to Pay",
+ "Is Unique Payment"
+ ]
+ ws3.append(headers)
+
+ for monitoring_request in requests_monitoring:
+ row_data = [
+ str(monitoring_request.id),
+ monitoring_request.start_date.strftime('%Y-%m-%d'),
+ monitoring_request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if monitoring_request.completion_date else None,
+ monitoring_request.estimated_completion_date.strftime('%Y-%m-%d') if monitoring_request.estimated_completion_date else None,
+ monitoring_request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ monitoring_request.state,
+ f'{monitoring_request.manager_assigned_to.first_name} {monitoring_request.manager_assigned_to.last_name}' if monitoring_request.manager_assigned_to else 'sin asignar',
+ f'{monitoring_request.leader_assigned_to.first_name} {monitoring_request.leader_assigned_to.last_name}' if monitoring_request.leader_assigned_to else 'sin asignar',
+ f'{monitoring_request.created_by.first_name} {monitoring_request.created_by.last_name}' if monitoring_request.created_by else 'sin asignar',
+ monitoring_request.cenco,
+ monitoring_request.has_money_in_cenco,
+ monitoring_request.cenco_manager,
+ monitoring_request.monitoring_type,
+ monitoring_request.student_code,
+ monitoring_request.student_full_name,
+ monitoring_request.student_id,
+ monitoring_request.student_email,
+ monitoring_request.student_cellphone,
+ monitoring_request.daviplata,
+ monitoring_request.course_or_proyect,
+ monitoring_request.monitoring_description,
+ monitoring_request.weekly_hours,
+ monitoring_request.total_value_to_pay,
+ monitoring_request.is_unique_payment
+ ]
+ ws3.append(row_data)
+
+ ws4 = wb.create_sheet(title="Honorarios")
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ "Hiree Full Name",
+ "Hiree ID",
+ "Hiree Cellphone",
+ "Hiree Email",
+ "Cenco",
+ "Request Motive",
+ "Banking Entity",
+ "Bank Account Type",
+ "Bank Account Number",
+ "EPS",
+ "Pension Fund",
+ "ARL",
+ "Contract Value",
+ "Charge Account",
+ "RUT",
+ "Course Name",
+ "Period",
+ "Group",
+ "Intensity",
+ "Total Hours",
+ "Course Code",
+ "Students Quantity",
+ "Additional Hours"
+ ]
+
+ ws4.append(headers)
+
+ for post_request in requests_pos:
+ row_data = [
+ str(post_request.id),
+ post_request.start_date.strftime('%Y-%m-%d'),
+ post_request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if post_request.completion_date else None,
+ post_request.estimated_completion_date.strftime('%Y-%m-%d') if post_request.estimated_completion_date else None,
+ post_request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ post_request.state,
+ f'{post_request.manager_assigned_to.first_name} {post_request.manager_assigned_to.last_name}' if post_request.manager_assigned_to else 'sin asignar',
+ f'{post_request.leader_assigned_to.first_name} {post_request.leader_assigned_to.last_name}' if post_request.leader_assigned_to else 'sin asignar',
+ f'{post_request.created_by.first_name} {post_request.created_by.last_name}' if post_request.created_by else 'sin asignar',
+ post_request.hiree_full_name,
+ post_request.hiree_id,
+ post_request.hiree_cellphone,
+ post_request.hiree_email,
+ post_request.cenco,
+ post_request.request_motive,
+ post_request.banking_entity,
+ post_request.bank_account_type,
+ post_request.bank_account_number,
+ post_request.eps,
+ post_request.pension_fund,
+ post_request.arl,
+ post_request.contract_value,
+ post_request.charge_account,
+ post_request.rut.url if post_request.rut else "",
+ post_request.course_name,
+ post_request.period,
+ post_request.group,
+ post_request.intensity,
+ post_request.total_hours,
+ post_request.course_code,
+ post_request.students_quantity,
+ post_request.additional_hours
+ ]
+ ws4.append(row_data)
+
+ response = HttpResponse(content_type='application/ms-excel')
+ response['Content-Disposition'] = 'attachment; filename="solicitudes.xlsx"'
+ wb.save(response)
+
+ return response
\ No newline at end of file
diff --git a/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py b/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py
index 102bff4..32aad4e 100644
--- a/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py
+++ b/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py
@@ -2,12 +2,14 @@
from django.views.generic import CreateView
from hiring_app.forms import CEXContractRequestForm
from hiring_app.model import CEXContractRequest
+from hiring_app.model import ProvisionOfServicesContractRequest
from django.urls import reverse_lazy
from datetime import datetime, timedelta
from .utilities import utilities
from django.shortcuts import get_object_or_404
from django.core.exceptions import PermissionDenied
+
class CEXContractRequestView(CreateView):
model = CEXContractRequest
form_class = CEXContractRequestForm
@@ -20,6 +22,7 @@ def form_valid(self, form):
estimated_completion_date = datetime.now() + timedelta(days=30)
leader = utilities.findLeaderToAssign()
manager = utilities.findManagerToAssign()
+ form.instance.id_solicitant_name = self.request.user.first_name
form.instance.estimated_completion_date = estimated_completion_date
form.instance.created_by = current_user
form.instance.leader_assigned_to = leader
@@ -29,9 +32,9 @@ def form_valid(self, form):
cex_contract_request.create_snapshot()
cex_contract_request.save()
utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',
- current_user.email)
+ current_user.email)
return super().form_valid(form)
-
+
def form_invalid(self, form):
return self.render_to_response(self.get_context_data(form=form))
@@ -39,15 +42,20 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['actualgroup'] = 'external'
return context
-
-
+
def download_rut_file(request, idContract, *args, **kwargs):
# Get the rut and send it as a file
- model_instance = get_object_or_404(CEXContractRequest, id=idContract)
+ model_instance = None
+
+ if CEXContractRequest.objects.filter(id=idContract).exists():
+ model_instance = get_object_or_404(CEXContractRequest, id=idContract)
+ else:
+ model_instance = get_object_or_404(ProvisionOfServicesContractRequest, id=idContract)
if not request.user.has_perm('your_app.view_cexcontractrequest'):
- raise PermissionDenied("You don't have permission to download this file.")
-
+ raise PermissionDenied(
+ "You don't have permission to download this file.")
+
if not model_instance.rut:
raise Http404("The requested file does not exist.")
try:
@@ -55,6 +63,7 @@ def download_rut_file(request, idContract, *args, **kwargs):
except IOError as e:
raise IOError(f"Error reading file: {e}")
- response = HttpResponse(rut_file_data, content_type='application/octet-stream')
+ response = HttpResponse(
+ rut_file_data, content_type='application/octet-stream')
response['Content-Disposition'] = f'attachment; filename="{model_instance.rut.name}"'
- return response
\ No newline at end of file
+ return response
diff --git a/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py b/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py
index 56351c3..e77458c 100644
--- a/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py
+++ b/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py
@@ -27,8 +27,7 @@ def form_valid(self, form):
monitoring_contract_request.save()
- utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',
- current_user.email)
+ utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',current_user.email)
return super().form_valid(form)
def form_invalid(self, form):
diff --git a/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py b/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py
index 46da7d9..9f3bf0f 100644
--- a/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py
+++ b/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py
@@ -9,6 +9,7 @@
from django.shortcuts import get_object_or_404
from django.core.exceptions import PermissionDenied
+
class POSContractRequestView(CreateView):
model = ProvisionOfServicesContractRequest
form_class = ProvisionOfServicesContractRequestForm
@@ -21,6 +22,7 @@ def form_valid(self, form):
estimated_completion_date = datetime.now() + timedelta(days=30)
leader = utilities.findLeaderToAssign()
manager = utilities.findManagerToAssign()
+ form.instance.id_solicitant_name = self.request.user.first_name
form.instance.estimated_completion_date = estimated_completion_date
form.instance.created_by = current_user
form.instance.leader_assigned_to = leader
@@ -35,29 +37,31 @@ def form_valid(self, form):
field_name = key.replace('additionalFields-', '')
field_name = field_name.split('-')[0]
additional_fields[field_name] = value
- if(field_name == 'responsability'):
+ if (field_name == 'responsability'):
additional_fields['pos_contract_request'] = pos_contract_request
- course_schedule = CourseSchedule.objects.create_schedule(**additional_fields)
+ course_schedule = CourseSchedule.objects.create_schedule(
+ **additional_fields)
course_schedule.save()
additional_fields = {}
- utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',
- current_user.email)
+ utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',current_user.email)
return super().form_valid(form)
-
+
def form_invalid(self, form):
return self.render_to_response(self.get_context_data(form=form))
-
+
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['actualgroup'] = 'external'
return context
-
+
def download_rut_file(request, idContract, *args, **kwargs):
# Get the rut and send it as a file
- model_instance = get_object_or_404(ProvisionOfServicesContractRequest, id=idContract)
+ model_instance = get_object_or_404(
+ ProvisionOfServicesContractRequest, id=idContract)
if not request.user.has_perm('your_app.view_poscontractrequest'):
- raise PermissionDenied("You don't have permission to download this file.")
+ raise PermissionDenied(
+ "You don't have permission to download this file.")
if not model_instance.rut:
raise Http404("The requested file does not exist.")
@@ -66,6 +70,7 @@ def download_rut_file(request, idContract, *args, **kwargs):
except IOError as e:
raise IOError(f"Error reading file: {e}")
- response = HttpResponse(rut_file_data, content_type='application/octet-stream')
+ response = HttpResponse(
+ rut_file_data, content_type='application/octet-stream')
response['Content-Disposition'] = f'attachment; filename="{model_instance.rut.name}"'
- return response
\ No newline at end of file
+ return response
diff --git a/hiring_module/hiring_app/views/request_hiring/change_state.py b/hiring_module/hiring_app/views/request_hiring/change_state.py
index f95f18e..9ecd92b 100644
--- a/hiring_module/hiring_app/views/request_hiring/change_state.py
+++ b/hiring_module/hiring_app/views/request_hiring/change_state.py
@@ -33,8 +33,6 @@ def post(self, request, idContract):
contract_request = utilities.getContract(idContract)
new_state = request.POST.get('state')
reason = request.POST.get('reason')
- print(new_state)
- print(reason)
state_actions = {
'incomplete': {
'email_function': self.send_email_file
diff --git a/hiring_module/hiring_app/views/statistical_registers/statistics_view.py b/hiring_module/hiring_app/views/statistical_registers/statistics_view.py
index a746aea..2f662ba 100644
--- a/hiring_module/hiring_app/views/statistical_registers/statistics_view.py
+++ b/hiring_module/hiring_app/views/statistical_registers/statistics_view.py
@@ -5,11 +5,10 @@
from ..utilities import leader_or_admin_redirect_to_manager_statistics, get_manager_metrics, get_leader_metrics, get_average_duration
-
class StatisticsView(View):
template_name = 'statistical_registers/statistics.html'
- #@method_decorator(leader_or_admin_redirect_to_manager_statistics)
+ # @method_decorator(leader_or_admin_redirect_to_manager_statistics)
def dispatch(self, request, *args, **kwargs):
# Get the required metrics
@@ -19,6 +18,6 @@ def dispatch(self, request, *args, **kwargs):
group = {'actualgroup': 'other'}
if self.request.user.groups.first().name == 'admin':
group = {'actualgroup': 'admin'}
-
+
# Pass metrics as context to template
- return render(request, self.template_name, manager_metrics|leader_metrics|average_duration|group)
+ return render(request, self.template_name, manager_metrics | leader_metrics | average_duration | group)
diff --git a/hiring_module/hiring_app/views/utilities.py b/hiring_module/hiring_app/views/utilities.py
index 50d5585..a92ed19 100644
--- a/hiring_module/hiring_app/views/utilities.py
+++ b/hiring_module/hiring_app/views/utilities.py
@@ -50,7 +50,7 @@ def get_manager_metrics():
cex_requests = CEXContractRequest.objects.all()
monitoring_requests = MonitoringContractRequest.objects.all()
- pos_requests = ProvisionOfServicesContractRequest.objects.all()
+ pos_requests = ProvisionOfServicesContractRequest.objects.all()
# Initialize a defaultdict to store requests count for each date
requests_count_by_date = defaultdict(lambda: [0, 0, 0])
@@ -100,12 +100,16 @@ def get_manager_metrics():
) + pos_requests.filter(state='incomplete').count(
)
+ cancelled_requests = cex_requests.filter(state='cancelled').count(
+ ) + monitoring_requests.filter(state='cancelled').count(
+ ) + pos_requests.filter(state='cancelled').count(
+ )
data.append([(manager.first_name + ' ' + manager.last_name), approved_requests,
- review_requests, for_validate_requests])
+ review_requests, for_validate_requests,cancelled_requests])
- best_to_worse_manager.append([(manager.first_name + ' ' + manager.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests)])
+ best_to_worse_manager.append([(manager.first_name + ' ' + manager.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests,cancelled_requests)])
best_to_worse_manager = sorted(best_to_worse_manager, key=lambda x: x[1], reverse=True)
@@ -191,12 +195,17 @@ def get_leader_metrics():
) + pos_requests.filter(state='incomplete').count(
)
+ cancelled_requests = cex_requests.filter(state='cancelled').count(
+ ) + monitoring_requests.filter(state='cancelled').count(
+ ) + pos_requests.filter(state='cancelled').count(
+ )
+
data.append([(leader.first_name + ' ' + leader.last_name), approved_requests,
- review_requests, for_validate_requests])
+ review_requests, for_validate_requests,cancelled_requests])
- best_to_worse_leader.append([(leader.first_name + ' ' + leader.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests)])
+ best_to_worse_leader.append([(leader.first_name + ' ' + leader.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests,cancelled_requests)])
best_to_worse_leader = sorted(best_to_worse_leader, key=lambda x: x[1], reverse=True)
@@ -212,13 +221,13 @@ def get_leader_metrics():
}
-def quality_calculator(aprobadas, en_revision, por_validar):
- total = aprobadas + en_revision + por_validar
+def quality_calculator(approved_requests, under_review_requests, for_validate_requests, cancelled_requests):
+ total = approved_requests + under_review_requests + for_validate_requests + cancelled_requests
if total != 0:
- porcentaje_aprobadas = (aprobadas / total) * 100
- porcentaje_aprobadas = round(porcentaje_aprobadas, 2)
- return porcentaje_aprobadas
+ quality = ((approved_requests + cancelled_requests)/ total) * 100
+ quality = round(quality, 2)
+ return quality
else:
return 0
@@ -229,7 +238,7 @@ def get_average_duration():
list(ProvisionOfServicesContractRequest.objects.filter(Q(state='filed') | Q(state='cancelled')))
)
- total_duration_seconds = sum((request.completion_date - timezone.make_aware(datetime.combine(request.start_date, datetime.min.time()), timezone.utc)).total_seconds() for request in approved_or_cancelled_requests if request.completion_date and request.start_date)
+ total_duration_seconds = sum((request.completion_date - timezone.make_aware(datetime.combine(request.start_date, datetime.min.time()))).total_seconds() for request in approved_or_cancelled_requests if request.completion_date and request.start_date)
total_count = len(approved_or_cancelled_requests)
total_avg_duration_seconds = total_duration_seconds / total_count if total_count > 0 else 0
@@ -262,6 +271,10 @@ def get_resolved_after_estimated_date():
return resolved_after_estimated_date_count
+
+
+
+
diff --git a/hiring_module/requirements.txt b/hiring_module/requirements.txt
index 96ffe06..029d66c 100644
--- a/hiring_module/requirements.txt
+++ b/hiring_module/requirements.txt
@@ -7,3 +7,4 @@ six == 1.16.0
sqlparse == 0.4.3
tzdata == 2022.7
selenium
+openpyxl
\ No newline at end of file
diff --git a/hiring_module/test_db.sqlite3 b/hiring_module/test_db.sqlite3
new file mode 100644
index 0000000..e69de29
Listado de solicitudes de contrata
{% for request in requests %}
- {{ request.id }}
- {{ request.created_by.first_name }} {{ request.created_by.last_name }}
+ {{ request.id|truncatechars:25 }}
+ {{ request.request_type }}
+ {{ request.created_by.first_name|truncatechars:10 }} {{ request.created_by.last_name|truncatechars:8 }}
{% if not actualgroup == 'leader' %}
{{ request.leader_assigned_to.first_name }}
@@ -46,7 +50,19 @@ Listado de solicitudes de contrata
{{ request.manager_assigned_to.first_name }}
{% include 'request_hiring/components/assign_manager.html' with managers=managers contract_request=request form_id_prefix='change_manager_form_' %}
{% endif %}
- {{ request.state }}
+
+ {% if request.state == 'pending' %}
+ Pendiente
+ {% elif request.state == 'review' %}
+ En Revisión
+ {% elif request.state == 'incomplete' %}
+ Incompleto
+ {% elif request.state == 'filed' %}
+ Completado
+ {% elif request.state == 'cancelled' %}
+ Cancelado
+ {% endif %}
+
{{ request.start_date|date:"d-m-Y" }}
{% endfor %}
@@ -56,4 +72,10 @@ Listado de solicitudes de contrata
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/request_creation/cex_request_form.html b/hiring_module/hiring_app/templates/request_creation/cex_request_form.html
index 5eef5cc..f35668a 100644
--- a/hiring_module/hiring_app/templates/request_creation/cex_request_form.html
+++ b/hiring_module/hiring_app/templates/request_creation/cex_request_form.html
@@ -1,235 +1,630 @@
-{% extends 'base.html' %}
-{% load static %}
-
-{% block title %}
-Solicitudes de contratos CEX
-{% endblock %}
-
-{% block content %}
-
-
-
-
- Solicitudes de contratos CEX
-
-
- {% csrf_token %}
-
-
-
-
-
-
-
-
-
-
-
-
-
+{% extends 'base.html' %} {% load static %} {% block title %} Solicitudes de
+contratos CEX {% endblock %} {% block content %}
+
+
+ {% csrf_token %}
+
+
+ Solicitudes de contratos de CEX
+
+
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información financiera
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ Información legal para el contrato
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
-
+
+
+
+
-
-
-
-
- Título de la notificación
-
-
-
- Mensaje de notificación
-
-
-
-
-
+
+
+
+
+
+ Título de la notificación
+
+
+
+
+ Mensaje de notificación
+
+
+
+
+
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html b/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html
index eeb106e..d2ba024 100644
--- a/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html
+++ b/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html
@@ -1,230 +1,600 @@
-{% extends 'base.html' %}
-{% load static %}
-
-{% block title %}
-Solicitudes de contratos de Monitoría
-{% endblock %}
-
-{% block content %}
-
-
-
-
-
-
- {% if form.errors %}
-
-
- {% for field, error in form.errors.items %}
- - {{ field }}: {{ error }}
- {% endfor %}
-
-
- {% endif %}
-
- Solicitudes de contratos de Monitoría
-
-
- {% csrf_token %}
-
-
-
-
-
-
-
-
-
-
-
+{% extends 'base.html' %} {% load static %} {% block title %} Solicitudes de
+contratos de Monitoría {% endblock %} {% block content %}
+
+
+
+
+
+ {% csrf_token %}
+
+
+ Solicitudes de contratos de Monitoría
+
+
+
+
+
+
+
+
+ Información del estudiante
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+ Información financiera
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+ Información de la monitoria
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
+
-
-
-
-
- Título de la notificación
-
-
-
- Mensaje de notificación
-
-
-
-
-
+
+
+
+
+
+ Título de la notificación
+
+
+
+
+ Mensaje de notificación
+
+
+
+
+
-
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html b/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html
index d251355..f93531c 100644
--- a/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html
+++ b/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html
@@ -1,34 +1,35 @@
+
-
+
-
+
-
+
-
+
-
+
diff --git a/hiring_module/hiring_app/templates/request_creation/pos_request_form.html b/hiring_module/hiring_app/templates/request_creation/pos_request_form.html
index 6430d3d..b187d65 100644
--- a/hiring_module/hiring_app/templates/request_creation/pos_request_form.html
+++ b/hiring_module/hiring_app/templates/request_creation/pos_request_form.html
@@ -1,356 +1,1089 @@
-{% extends 'base.html' %}
-{% load static %}
-
-{% block title %}
-Solicitudes de contratos POS
-{% endblock %}
-
-{% block content %}
-
+{% extends 'base.html' %} {% load static %} {% block title %} Solicitudes de
+contratos POS {% endblock %} {% block content %}
-
-
-
- {% if form.errors %}
-
-
- {% for field, error in form.errors.items %}
- - {{ field }}: {{ error }}
- {% endfor %}
-
-
- {% endif %}
-
- Solicitudes de contratos de prestacion de servicio
-
-
- {% csrf_token %}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ {% csrf_token %}
+
+
+ Solicitudes de contratos de prestacion de servicio
+
+
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+ Información financiera
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+ Información de la clase
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+ Horario de clases
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
- Course schedules:
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
- Título de la notificación
-
-
-
- Mensaje de notificación
-
-
-
-
-
+
+
+
+
+
+ Título de la notificación
+
+
+
+
+ Mensaje de notificación
+
+
+
+
+
+
+
+{% endblock %}
diff --git a/hiring_module/hiring_app/templates/request_hiring/cex_information.html b/hiring_module/hiring_app/templates/request_hiring/cex_information.html
index 5e7e20f..4dcc04b 100644
--- a/hiring_module/hiring_app/templates/request_hiring/cex_information.html
+++ b/hiring_module/hiring_app/templates/request_hiring/cex_information.html
@@ -1,140 +1,235 @@
-
+
+ Solicitudes de contratos de CEX
+
+
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
+
+
+
+
+ Nombre Completo del Contratado
+
+ El nombre completo de la persona contratada.
+
+
+
+ {{ contract_request.hiree_full_name }}
+
+
+
+
+ ID del Contratado
+
+ El identificador único asignado al contratado.
+
+
+ {{ contract_request.hiree_id }}
+
+
+
+ Número de Teléfono del Contratado
+
+ El número de teléfono del contratado.
+
+
+
+ {{ contract_request.hiree_cellphone }}
+
+
+
+
+ Correo Electrónico del Contratado
+
+ El correo electrónico de contacto del contratado.
+
+
+
+ {{ contract_request.hiree_email }}
+
+
+
+
+ EPS
+
+ La Entidad Promotora de Salud del contratado.
+
+
+ {{ contract_request.eps }}
+
+
+
+ ARL
+
+ La Administradora de Riesgos Laborales del contratado.
+
+
+ {{ contract_request.arl }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información del financiera
+
+
+
+
+
+
+
+
+ Cenco
+
+ Centro de costos asignado al contratado.
+
+
+ {{ contract_request.cenco }}
+
+
+
+ Entidad Bancaria
+
+ La entidad bancaria a la que está asociada la cuenta bancaria.
+
+
+
+ {{ contract_request.banking_entity }}
+
+
+
+
+
+
+ Tipo de Cuenta Bancaria
+
+ El tipo de cuenta bancaria del contratado.
+
+
+
+
+
+ {{ contract_request.get_bank_account_type_display }}
+
+
+
+
+
+
+ Número de Cuenta Bancaria
+
+ El número de cuenta bancaria del contratado.
+
+
+
+
+
+ {{ contract_request.bank_account_number }}
+
+
+
+
+
+ Fondo de Pensiones
+
+ El fondo de pensiones del contratado.
+
+
+
+
+
+ {{ contract_request.pension_fund }}
+
+
+
+
+
+
+
-
-
-
-
-
-
- Descripcion
- Datos
-
-
-
-
-
- Nombre Completo del Contratado
- El nombre completo de la persona contratada.
-
-
- {{ contract_request.hiree_full_name }}
-
-
-
- ID del Contratado
- El identificador único asignado al
- contratado.
-
-
- {{ contract_request.hiree_id }}
-
-
-
- Número de Teléfono del Contratado
- El número de teléfono del contratado.
-
- {{ contract_request.hiree_cellphone }}
-
-
-
- Correo Electrónico del Contratado
- El correo electrónico de contacto del
- contratado.
-
- {{ contract_request.hiree_email }}
-
-
-
- Cenco
- Centro de costos asignado al contratado.
-
-
- {{ contract_request.cenco }}
-
-
-
- Motivo de la Solicitud
- El motivo por el cual se realiza la
- solicitud.
-
-
- {{ contract_request.request_motive }}
-
-
-
- Entidad Bancaria
- La entidad bancaria a la que está asociada
- la
- cuenta bancaria.
-
- {{ contract_request.banking_entity }}
-
-
-
- Tipo de Cuenta Bancaria
- El tipo de cuenta bancaria del contratado.
-
-
- {{ contract_request.get_bank_account_type_display }}
-
-
-
- Número de Cuenta Bancaria
- El número de cuenta bancaria del contratado.
-
-
- {{ contract_request.bank_account_number }}
-
-
-
- EPS
- La Entidad Promotora de Salud del
- contratado.
-
-
- {{ contract_request.eps }}
-
-
-
- Fondo de Pensiones
- El fondo de pensiones del contratado.
-
- {{ contract_request.pension_fund }}
-
-
-
- ARL
- La Administradora de Riesgos Laborales del
- contratado.
-
- {{ contract_request.arl }}
-
-
-
- Valor del Contrato
- El valor total del contrato.
-
- {{ contract_request.contract_value }}
-
-
-
- Cuenta de Cobro
- La cuenta bancaria a la que se realizarán
- los
- pagos correspondientes.
-
- {{ contract_request.charge_account }}
-
-
-
- Descargar
- Archivo RUT
-
-
-
+
+
+
+
+
+
+ Información legal del contrato
+
+
+
+
+
+
+
+
+ Motivo de la Solicitud
+
+ El motivo por el cual se realiza la solicitud.
+
+
+
+ {{ contract_request.request_motive }}
+
+
-
-
+
+
+ Valor del Contrato
+
+ El valor total del contrato.
+
+
+
+ {{ contract_request.contract_value }}
+
+
+
+
+ Cuenta de Cobro
+
+ La cuenta bancaria a la que se realizarán los pagos
+ correspondientes.
+
+
+
+ {{ contract_request.charge_account }}
+
+
+
+
+ Descargar Archivo RUT
+
+
+
+
+
-
\ No newline at end of file
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html b/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html
index 0e35df1..9c992aa 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html
@@ -4,7 +4,7 @@
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html b/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html
index 7e70581..499e58a 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html
@@ -9,7 +9,7 @@
{% for manager in managers %}
-
+
{% endfor %}
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/change_state.html b/hiring_module/hiring_app/templates/request_hiring/components/change_state.html
index 69a6a2e..81bd475 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/change_state.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/change_state.html
@@ -3,7 +3,22 @@
@@ -20,8 +35,8 @@
-
-
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html b/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html
index 55b5cdd..eb1e823 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html
@@ -3,13 +3,13 @@
- Default Bootstrap Modal
+
...
-
-
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html b/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html
index bf9dcca..c3a9ee0 100644
--- a/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html
+++ b/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html
@@ -1,134 +1,218 @@
-
+
+ Solicitudes de contratos de Monitoría
+
+
+
+
+
+
+
+
+ Información del estudiante
+
+
+
+
+
+
+
+
+
+ Código del Estudiante
+
+ El código asignado al estudiante.
+
+
+
+ {{ contract_request.student_code }}
+
+
+
+
+ Nombre Completo del Estudiante
+
+ El nombre completo del estudiante.
+
+
+
+ {{ contract_request.student_full_name }}
+
+
+
+
+ ID del Estudiante
+
+ El identificador único asignado al estudiante.
+
+
+
+ {{ contract_request.student_id }}
+
+
+
+
+ Correo Electrónico del Estudiante
+
+ El correo electrónico de contacto del estudiante.
+
+
+
+ {{ contract_request.student_email }}
+
+
+
+
+ Número de Teléfono del Estudiante
+
+ El número de teléfono del estudiante.
+
+
+
+ {{ contract_request.student_cellphone }}
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Información del financiera
+
+
+
+
-
-
-
- Descripcion
- Datos
-
-
-
-
-
- Nombre Completo del Estudiante
- El nombre completo del estudiante.
-
- {{ contract_request.student_full_name }}
-
-
-
- ID del Estudiante
- El identificador único asignado al
- estudiante.
-
- {{ contract_request.student_id }}
-
-
-
- Número de Teléfono del Estudiante
- El número de teléfono del estudiante.
-
- {{ contract_request.student_cellphone }}
-
-
-
- Correo Electrónico del Estudiante
- El correo electrónico de contacto del
- estudiante.
-
- {{ contract_request.student_email }}
-
-
-
- Daviplata
- El número de cuenta Daviplata del
- estudiante.
-
- {{ contract_request.daviplata }}
-
-
-
- Curso o Proyecto
- El curso o proyecto en el que participa el
- estudiante.
-
- {{ contract_request.course_or_project }}
-
-
-
- Descripción de la Monitoria
- Una descripción de la actividad de monitoreo
- del estudiante.
-
- {{ contract_request.monitoring_description }}
-
-
-
- Horas Semanales
- El número de horas que el estudiante
- trabajará por semana.
-
- {{ contract_request.weekly_hours }}
-
-
-
- Valor Total a Pagar
- El valor total que se pagará al estudiante.
-
-
- {{ contract_request.total_value_to_pay }}
-
-
-
- Es Pago Único
- Indica si el pago es único o recurrente.
-
-
- {{ contract_request.is_unique_payment }}
-
-
-
- Tiene Dinero en Cenco
- Indica si el estudiante tiene dinero
- disponible en el cenco.
-
- {{ contract_request.has_money_in_cenco }}
-
-
-
- Gerente de Cenco
- El gerente responsable del cenco.
-
- {{ contract_request.cenco_manager }}
-
-
-
- Tipo de Monitoria
- El tipo de actividad de monitoreo.
-
- {{ contract_request.monitoring_type }}
-
-
-
- Código del Estudiante
- El código asignado al estudiante.
-
- {{ contract_request.student_code }}
-
-
-
- Daviplata
- El número de cuenta Daviplata del
- estudiante.
-
- {{ contract_request.daviplata }}
-
-
+
+
+
+
+ Cenco
+
+ CENCO asignado.
+
+
+ {{ contract_request.cenco }}
+
+
+
+ Administrador del cenco
+
+ Administrador del cenco asignado.
+
+
+
+ {{ contract_request.cenco_manager }}
+
+
+
+
+ Daviplata
+
+ Num de Daviplata del estudiante.
+
+
+
+ {{ contract_request.daviplata }}
+
+
+
+
+ Valor total a pagar
+
+ Valor en total del pago.
+
+
+
+ {{ contract_request.total_value_to_pay }}
+
+
+
+
+ Hora semanales
+
+ {{ contract_request.weekly_hours }}
+
+
+
+ Es pago unico?
+
+ {% if contract_request.is_unique_payment %} Sí {% else %} No
+ {% endif %}
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+ Información de la monitoria
+
+
+
+
+
+
+
+
+
+ Tipo de Monitoria
+
+ El tipo de actividad de monitoreo.
+
+
+
+ {{ contract_request.monitoring_type }}
+
+
+
+
+ Curso o Proyecto
+
+ El curso o proyecto en el que participa el estudiante.
+
+
+
+ {{ contract_request.course_or_project }}
+
+
+
+
+ Descripción de la Monitoria
+
+ Una descripción de la actividad de monitoreo del estudiante.
+
+
+
+ {{ contract_request.monitoring_description }}
+
+
+
+
+
-
\ No newline at end of file
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/pos_information.html b/hiring_module/hiring_app/templates/request_hiring/pos_information.html
index 1dc2aba..c68c6cc 100644
--- a/hiring_module/hiring_app/templates/request_hiring/pos_information.html
+++ b/hiring_module/hiring_app/templates/request_hiring/pos_information.html
@@ -1,244 +1,425 @@
-
-
-
-
-
-
-
-
- Descripcion
- Datos
-
-
-
-
-
- Nombre Completo del Contratado
- El nombre completo de la persona contratada.
-
-
- {{ contract_request.hiree_full_name }}
-
-
-
- ID del Contratado
- El identificador único asignado al
- contratado.
-
-
- {{ contract_request.hiree_id }}
-
-
-
- Número de Teléfono del Contratado
- El número de teléfono del contratado.
-
- {{ contract_request.hiree_cellphone }}
-
-
-
- Correo Electrónico del Contratado
- El correo electrónico de contacto del
- contratado.
-
- {{ contract_request.hiree_email }}
-
-
-
- Cenco
- Centro de costos asignado al contratado.
-
-
- {{ contract_request.cenco }}
-
-
-
- Motivo de la Solicitud
- El motivo por el cual se realiza la
- solicitud.
-
-
- {{ contract_request.request_motive }}
-
-
-
- Entidad Bancaria
- La entidad bancaria a la que está asociada
- la
- cuenta bancaria.
-
- {{ contract_request.banking_entity }}
-
-
-
- Tipo de Cuenta Bancaria
- El tipo de cuenta bancaria del contratado.
-
-
- {{ contract_request.get_bank_account_type_display }}
-
-
-
- Número de Cuenta Bancaria
- El número de cuenta bancaria del contratado.
-
-
- {{ contract_request.bank_account_number }}
-
-
-
- EPS
- La Entidad Promotora de Salud del
- contratado.
-
-
- {{ contract_request.eps }}
-
-
-
- Fondo de Pensiones
- El fondo de pensiones del contratado.
-
- {{ contract_request.pension_fund }}
-
-
-
- ARL
- La Administradora de Riesgos Laborales del
- contratado.
-
- {{ contract_request.arl }}
-
-
-
- Valor del Contrato
- El valor total del contrato.
-
- {{ contract_request.contract_value }}
-
-
-
- Cuenta de Cobro
- La cuenta bancaria a la que se realizarán
- los
- pagos correspondientes.
-
- {{ contract_request.charge_account }}
-
-
-
- Descargar
- Archivo RUT
-
-
-
-
- Nombre de curso
- El nombre de curso del contrato.
-
- {{ contract_request.course_name }}
-
-
-
- Periodo
- El periodo del curso.
-
- {{ contract_request.period }}
-
-
-
- Grupo
- El grupo del curso.
-
- {{ contract_request.group }}
-
-
-
- Intensidad horaria
- La intensidad horaria de las clases del curso.
-
- {{ contract_request.intensity }}
-
-
-
- Horas totales
- La cantidad de horas totales del curso.
-
- {{ contract_request.total_hours }}
-
-
-
- Codigo del curso
- El codigo del curso.
-
- {{ contract_request.course_code }}
-
-
-
- Cantidad de estudiantes
- La cantidad de estudiantes del curso.
-
- {{ contract_request.students_quantity }}
-
-
-
- Horas adicionales
- Las horas adicionales del curso.
-
- {{ contract_request.additional_hours }}
-
- {% for schedule in course_schedules %}
-
-
- Clase
-
-
-
-
-
- Fecha
- La fecha de la clase.
-
- {{ schedule.date }}
-
-
-
- Hora de inicio
- La hora de inicio de la clase.
-
- {{ schedule.start_time }}
-
-
-
- Hora de fin
- La hora de fin de la clase.
-
- {{ schedule.end_time }}
-
-
-
- Salón
- El salón de la clase.
-
- {{ schedule.room }}
-
-
-
- Responsabilidad
- Codigo de la responsabilidad de la clase.
-
- {{ schedule.responsability }}
-
- {% endfor %}
-
-
-
-
+
+ Solicitudes de contratos de CEX
+
+
+
+
+
+
+
+
+ Información del contratado
+
+
+
+
+
+
+
+
+ Nombre Completo del Contratado
+
+ El nombre completo de la persona contratada.
+
+
+
+ {{ contract_request.hiree_full_name }}
+
+
+
+
+ ID del Contratado
+
+ El identificador único asignado al contratado.
+
+
+ {{ contract_request.hiree_id }}
+
+
+
+ Número de Teléfono del Contratado
+
+ El número de teléfono del contratado.
+
+
+
+ {{ contract_request.hiree_cellphone }}
+
+
+
+
+ Correo Electrónico del Contratado
+
+ El correo electrónico de contacto del contratado.
+
+
+
+ {{ contract_request.hiree_email }}
+
+
+
+
+ EPS
+
+ La Entidad Promotora de Salud del contratado.
+
+
+ {{ contract_request.eps }}
+
+
+
+ ARL
+
+ La Administradora de Riesgos Laborales del contratado.
+
+
+ {{ contract_request.arl }}
+
+
+
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+ Información del financiera
+
+
+
+
+
+
+
+
+ Cenco
+
+ Centro de costos asignado al contratado.
+
+
+ {{ contract_request.cenco }}
+
+
+
+ Entidad Bancaria
+
+ La entidad bancaria a la que está asociada la cuenta bancaria.
+
+
+
+ {{ contract_request.banking_entity }}
+
+
+
+
+
+
+ Tipo de Cuenta Bancaria
+
+ El tipo de cuenta bancaria del contratado.
+
+
+
+
+
+ {{ contract_request.get_bank_account_type_display }}
+
+
+
+
+
+
+ Número de Cuenta Bancaria
+
+ El número de cuenta bancaria del contratado.
+
+
+
+
+
+ {{ contract_request.bank_account_number }}
+
+
+
+
+
+ Fondo de Pensiones
+
+ El fondo de pensiones del contratado.
+
+
+
+
+
+ {{ contract_request.pension_fund }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información legal del contrato
+
+
+
+
+
+
+
+
+ Nombre de curso
+
+ El nombre de curso del contrato.
+
+
+
+ {{ contract_request.course_name }}
+
+
+
+
+ Periodo
+
+ El periodo del curso.
+
+
+ {{ contract_request.period }}
+
+
+
+ Grupo
+
+ El grupo del curso.
+
+
+ {{ contract_request.group }}
+
+
+
+ Intensidad horaria
+
+ La intensidad horaria de las clases del curso.
+
+
+ {{ contract_request.intensity }}
+
+
+
+ Horas totales
+
+ La cantidad de horas totales del curso.
+
+
+
+ {{ contract_request.total_hours }}
+
+
+
+
+ Codigo del curso
+
+ El codigo del curso.
+
+
+
+ {{ contract_request.course_code }}
+
+
+
+
+ Cantidad de estudiantes
+
+ La cantidad de estudiantes del curso.
+
+
+
+ {{ contract_request.students_quantity }}
+
+
+
+
+ Horas adicionales
+
+ Las horas adicionales del curso.
+
+
+
+ {{ contract_request.additional_hours }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información legal del contrato
+
+
+
+
+
+
+
+
+
+
+ Motivo de la Solicitud
+
+ El motivo por el cual se realiza la solicitud.
+
+
+
+
+
+ {{ contract_request.request_motive }}
+
+
+
+
+
+
+
+ Valor del Contrato
+
+ El valor total del contrato.
+
+
+
+
+
+ {{ contract_request.contract_value }}
+
+
+
+
+
+
+ Cuenta de Cobro
+
+ La cuenta bancaria a la que se realizarán los pagos
+ correspondientes.
+
+
+
+
+
+ {{ contract_request.charge_account }}
+
+
+
+
+
+
+ Descargar Archivo RUT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información legal del contrato
+
+
+
+
+
+
+ {% for schedule in course_schedules %}
+
+
+ Clase
+
+
+
+
+ Fecha
+
+ La fecha de la clase.
+
+
+ {{ schedule.date }}
+
+
+
+ Hora de inicio
+
+ La hora de inicio de la clase.
+
+
+ {{ schedule.start_time }}
+
+
+
+ Hora de fin
+
+ La hora de fin de la clase.
+
+
+ {{ schedule.end_time }}
+
+
+
+ Salón
+
+ El salón de la clase.
+
+
+ {{ schedule.room }}
+
+
+
+ Responsabilidad
+
+ Codigo de la responsabilidad de la clase.
+
+
+ {{ schedule.responsability }}
+
+ {% endfor %}
+
+
+
+
+
+
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_daily_requests.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_daily_requests.html
deleted file mode 100644
index 726e9dc..0000000
--- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_daily_requests.html
+++ /dev/null
@@ -1,77 +0,0 @@
-{% load static %}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Solicitudes CEX: 0
-
-
-
-
- Solicitudes Monitorias: 0
-
-
-
-
- Solicitudes Prestacion de Servicios: 0
-
-
-
-
-
-
-
-
-{{ daily_requests }}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_date_range_requests.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_date_range_requests.html
new file mode 100644
index 0000000..7212774
--- /dev/null
+++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_date_range_requests.html
@@ -0,0 +1,87 @@
+{% load static %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Solicitudes CEX:
+ 0
+
+
+
+
+ Solicitudes Monitorias:
+ 0
+
+
+
+
+ Solicitudes Prestacion de
+ Servicios: 0
+
+
+
+
+
+
+{{ daily_requests }}
+
+
+
+
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html
index a75c6ec..394e494 100644
--- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html
+++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html
@@ -1,10 +1,9 @@
{% load static %}
-
-
+
-
-
- Solicitudes Aprobadas: {{ leader_data.0.1 }}
+ Solicitudes Aprobadas:
+ {{ leader_data.0.1 }}
+
+
+
+
+ Solicitudes En revisión:
+ {{ leader_data.0.2 }}
- Solicitudes En revisión: {{ leader_data.0.2 }}
+ Solicitudes por validar:
+ {{ leader_data.0.3 }}
- Solicitudes por validar: {{ leader_data.0.3 }}
+ Solicitudes canceladas:
+ {{ leader_data.0.4 }}
@@ -41,22 +44,23 @@
-
-
-
+
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html
index 55f4fb2..90f10e2 100644
--- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html
+++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html
@@ -3,8 +3,8 @@
-
-
-
+
- var dailySelect = document.getElementById('data_select');
+
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/statistical_registers/statistics.html b/hiring_module/hiring_app/templates/statistical_registers/statistics.html
index d21caf1..c1b28c3 100644
--- a/hiring_module/hiring_app/templates/statistical_registers/statistics.html
+++ b/hiring_module/hiring_app/templates/statistical_registers/statistics.html
@@ -23,28 +23,25 @@ General
{% include 'statistical_registers/components/monthly_requests.html' %}
- {% include 'statistical_registers/components/pie_chart_daily_requests.html' %}
+ {% include 'statistical_registers/components/pie_chart_date_range_requests.html' %}
{% include 'statistical_registers/components/average_time_and_overdue_requests.html' %}
-
+
{% endblock %}
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/__init__.py b/hiring_module/hiring_app/tests/functionality/__init__.py
index 2f90783..7cd3312 100644
--- a/hiring_module/hiring_app/tests/functionality/__init__.py
+++ b/hiring_module/hiring_app/tests/functionality/__init__.py
@@ -1,5 +1,5 @@
from .auth import *
-from .control_board import *
+from .left_panel import *
from .request_creation import *
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/admin_user/___init___.py b/hiring_module/hiring_app/tests/functionality/admin_user/___init___.py
deleted file mode 100644
index 5d96140..0000000
--- a/hiring_module/hiring_app/tests/functionality/admin_user/___init___.py
+++ /dev/null
@@ -1 +0,0 @@
-from .admin_user import AdminUserTest
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/admin_user/__init__.py b/hiring_module/hiring_app/tests/functionality/admin_user/__init__.py
new file mode 100644
index 0000000..1a781ed
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/admin_user/__init__.py
@@ -0,0 +1 @@
+from .admin_user import *
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py b/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py
index c076f3a..f13144a 100644
--- a/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py
+++ b/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py
@@ -22,7 +22,7 @@ def tearDownClass(cls):
super().tearDownClass()
- def test_add_user(self):
+ def test_external_to_manager(self):
self.selenium.get(self.live_server_url)
username_input = self.selenium.find_element(By.NAME,'id')
@@ -38,7 +38,7 @@ def test_add_user(self):
self.selenium.find_element(By.ID, 'UserList').click()
time.sleep(2)
- self.assertEqual('Panel de control', self.selenium.title)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
self.selenium.find_element(By.ID, 'addUser').click()
@@ -52,10 +52,69 @@ def test_add_user(self):
time.sleep(2)
- user = self.selenium.find_element(By.ID, '1106293874').text
+ user = self.selenium.find_element(By.ID, '1106293874_id').text
self.assertIn('1106293874', user)
+ def test_manager_to_leader(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'UserList').click()
+
+ time.sleep(2)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'roleSelect_1111539567').send_keys('leader')
+
+ time.sleep(2)
+
+ self.assertEqual('1111539567', self.selenium.find_element(By.ID, '1111539567_id').text)
+
+ select_element = self.selenium.find_element(By.ID, "roleSelect_1111539567")
+
+ selected_option = select_element.find_element(By.CSS_SELECTOR, "option:checked")
+
+ selected_value = selected_option.get_attribute("value")
+
+ self.assertEqual('leader', selected_value)
+
+ def test_leader_to_admin(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'UserList').click()
+
+ time.sleep(2)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'roleSelect_1109185879').send_keys('administrator')
+
+ time.sleep(2)
+
+ self.assertEqual('1109185879', self.selenium.find_element(By.ID, '1109185879_id').text)
+
+ select_element = self.selenium.find_element(By.ID, "roleSelect_1109185879")
+
+ selected_option = select_element.find_element(By.CSS_SELECTOR, "option:checked")
+
+ selected_value = selected_option.get_attribute("value")
+
+ self.assertEqual('admin', selected_value)
def test_delete_user(self):
@@ -75,15 +134,13 @@ def test_delete_user(self):
self.selenium.find_element(By.ID, 'UserList').click()
time.sleep(2)
- self.assertEqual('Panel de control', self.selenium.title)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
self.selenium.find_element(By.ID, 'roleSelect_1109185879').send_keys('remove')
+
+ time.sleep(2)
-
- try:
- self.selenium.find_element(By.ID, 'addUser').click()
- except StaleElementReferenceException:
- self.selenium.find_element(By.ID, 'addUser').click()
+ self.selenium.find_element(By.ID, 'addUser').click()
self.assertEqual('1109185879', self.selenium.find_element(By.ID, '1109185879_id').text)
diff --git a/hiring_module/hiring_app/tests/functionality/auth/login.py b/hiring_module/hiring_app/tests/functionality/auth/login.py
index 883f639..b5ea3aa 100644
--- a/hiring_module/hiring_app/tests/functionality/auth/login.py
+++ b/hiring_module/hiring_app/tests/functionality/auth/login.py
@@ -65,3 +65,27 @@ def test_login_external_user(self):
password_input.send_keys(Keys.RETURN)
self.assertIn('Panel de control de usuario externo', self.selenium.title)
+
+ def test_login_wrong_password(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Log In', self.selenium.title)
+
+ def test_login_wrong_username(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('111607086')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Log In', self.selenium.title)
diff --git a/hiring_module/hiring_app/tests/functionality/control_board/__init__.py b/hiring_module/hiring_app/tests/functionality/control_board/__init__.py
deleted file mode 100644
index 1ab8cc0..0000000
--- a/hiring_module/hiring_app/tests/functionality/control_board/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from .control_board_external_user import ControlBoardExternalUser
diff --git a/hiring_module/hiring_app/tests/functionality/control_board/control_board_external_user.py b/hiring_module/hiring_app/tests/functionality/control_board/control_board_external_user.py
deleted file mode 100644
index 0bdec89..0000000
--- a/hiring_module/hiring_app/tests/functionality/control_board/control_board_external_user.py
+++ /dev/null
@@ -1,71 +0,0 @@
-from django.contrib.auth.models import User
-from django.contrib.staticfiles.testing import StaticLiveServerTestCase
-from selenium.webdriver.chrome.webdriver import WebDriver
-from selenium.webdriver.common.keys import Keys
-from selenium.webdriver.common.by import By
-
-class ControlBoardExternalUser(StaticLiveServerTestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
- cls.selenium = WebDriver()
- cls.selenium.implicitly_wait(10)
-
- @classmethod
- def tearDownClass(cls):
- cls.selenium.quit()
- super().tearDownClass()
-
-
- def test_get_form_monitoring(self):
- self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
- password_input = self.selenium.find_element(By.NAME, 'password')
- username_input.send_keys('1106293874')
- password_input.send_keys('mariagonzales123')
-
- password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_monitoring_contract')
-
- button_create_monitoring_contract.click()
-
-
- self.assertIn('Solicitudes de contratos de Monitoría', self.selenium.title)
-
-
- def test_get_form_cex(self):
- self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
- password_input = self.selenium.find_element(By.NAME, 'password')
- username_input.send_keys('1106293874')
- password_input.send_keys('mariagonzales123')
-
- password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_cex_contract')
-
- button_create_monitoring_contract.click()
-
-
- self.assertIn('Solicitudes de contratos CEX', self.selenium.title)
-
-
- def test_get_form_pos(self):
- self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
- password_input = self.selenium.find_element(By.NAME, 'password')
- username_input.send_keys('1106293874')
- password_input.send_keys('mariagonzales123')
-
- password_input.send_keys(Keys.RETURN)
-
- button_create_pos_contract = self.selenium.find_element(By.ID, 'create_pos_contract')
-
- button_create_pos_contract.click()
-
-
- self.assertIn('Solicitudes de contratos POS', self.selenium.title)
diff --git a/hiring_module/hiring_app/tests/functionality/left_panel/__init__.py b/hiring_module/hiring_app/tests/functionality/left_panel/__init__.py
new file mode 100644
index 0000000..aca00a3
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/left_panel/__init__.py
@@ -0,0 +1 @@
+from .left_panel_navitagion import *
diff --git a/hiring_module/hiring_app/tests/functionality/left_panel/left_panel_navitagion.py b/hiring_module/hiring_app/tests/functionality/left_panel/left_panel_navitagion.py
new file mode 100644
index 0000000..5795df0
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/left_panel/left_panel_navitagion.py
@@ -0,0 +1,98 @@
+from django.contrib.auth.models import User
+from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from selenium.webdriver.chrome.webdriver import WebDriver
+from selenium.webdriver.common.keys import Keys
+from selenium.webdriver.common.by import By
+from selenium.common.exceptions import NoSuchElementException
+
+class LeftPanelNavigation(StaticLiveServerTestCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.selenium = WebDriver()
+ cls.selenium.implicitly_wait(10)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.selenium.quit()
+ super().tearDownClass()
+
+
+ def test_admin_redirections(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+
+ password_input.send_keys(Keys.RETURN)
+
+ user_list_button = self.selenium.find_element(By.ID, 'UserList')
+
+ user_list_button.click()
+
+
+ self.assertIn('Lista de usuarios', self.selenium.title)
+
+ control_pannel_button = self.selenium.find_element(By.ID, 'ControlPanel')
+
+ control_pannel_button.click()
+
+ self.assertIn('Panel de control', self.selenium.title)
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ def test_leader_redirections(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1107838593')
+ password_input.send_keys('alejandrolondono123')
+
+
+ password_input.send_keys(Keys.RETURN)
+
+ with self.assertRaises(NoSuchElementException):
+ user_list_button = self.selenium.find_element(By.ID, 'UserList')
+
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ control_pannel_button = self.selenium.find_element(By.ID, 'ControlPanel')
+
+ control_pannel_button.click()
+
+ self.assertIn('Panel de control', self.selenium.title)
+
+ def test_external_user_redirections(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ with self.assertRaises(NoSuchElementException):
+ user_list_button = self.selenium.find_element(By.ID, 'UserList')
+
+ with self.assertRaises(NoSuchElementException):
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ control_pannel_button = self.selenium.find_element(By.ID, 'ControlPanel')
+
+ control_pannel_button.click()
+
+ self.assertIn('Panel de control', self.selenium.title)
diff --git a/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py b/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py
index ea391c8..88d5b39 100644
--- a/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py
+++ b/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py
@@ -5,155 +5,290 @@
from selenium.webdriver.common.by import By
import os
import time
+from selenium.common.exceptions import NoSuchElementException
+
class CreateHiringRequest(StaticLiveServerTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.selenium = WebDriver()
- cls.selenium.implicitly_wait(10)
+ cls.selenium.implicitly_wait(10)
@classmethod
def tearDownClass(cls):
cls.selenium.quit()
super().tearDownClass()
-
def test_create_form_monitoring(self):
self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
password_input = self.selenium.find_element(By.NAME, 'password')
username_input.send_keys('1106293874')
password_input.send_keys('mariagonzales123')
-
+
password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_monitoring_contract')
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_monitoring_contract')
button_create_monitoring_contract.click()
self.selenium.find_element(By.NAME, 'cenco').send_keys('Cenco ABC')
- self.selenium.find_element(By.NAME, 'cenco_manager').send_keys('John Doe')
- monitoring_type = self.selenium.find_element(By.NAME, 'monitoring_type')
- monitoring_type.send_keys('Academic')
+ self.selenium.find_element(
+ By.NAME, 'cenco_manager').send_keys('John Doe')
+ monitoring_type = self.selenium.find_element(
+ By.NAME, 'monitoring_type')
+ monitoring_type.send_keys('Academico')
self.selenium.find_element(By.NAME, 'student_code').send_keys('123456')
- self.selenium.find_element(By.NAME, 'student_full_name').send_keys('Jane Smith')
+ self.selenium.find_element(
+ By.NAME, 'student_full_name').send_keys('Jane Smith')
self.selenium.find_element(By.NAME, 'student_id').send_keys('7890123')
- self.selenium.find_element(By.NAME, 'student_email').send_keys('jane@example.com')
- self.selenium.find_element(By.NAME, 'student_cellphone').send_keys('1234567890')
- self.selenium.find_element(By.NAME, 'daviplata').send_keys('Daviplata XYZ')
- self.selenium.find_element(By.NAME, 'course_or_proyect').send_keys('Project ABC')
- self.selenium.find_element(By.NAME, 'monitoring_description').send_keys('Description of monitoring')
- self.selenium.find_element(By.NAME, 'weekly_hours').send_keys('10') # Assuming 10 weekly hours
- self.selenium.find_element(By.NAME, 'total_value_to_pay').send_keys('100000') # Assuming total value
+ self.selenium.find_element(
+ By.NAME, 'student_email').send_keys('jane@example.com')
+ self.selenium.find_element(
+ By.NAME, 'student_cellphone').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'daviplata').send_keys('Daviplata XYZ')
+ self.selenium.find_element(
+ By.NAME, 'course_or_proyect').send_keys('Project ABC')
+ self.selenium.find_element(By.NAME, 'monitoring_description').send_keys(
+ 'Description of monitoring')
+ self.selenium.find_element(By.NAME, 'weekly_hours').send_keys(
+ '10') # Assuming 10 weekly hours
+ self.selenium.find_element(By.NAME, 'total_value_to_pay').send_keys(
+ '100000') # Assuming total value
self.selenium.find_element(By.NAME, 'is_unique_payment').click()
- self.selenium.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
time.sleep(5)
- notification_message = self.selenium.find_element(By.ID, "notificationMessage").text
-
- self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
- self.assertIn('Solicitudes de contratos de Monitoría', self.selenium.title)
+ self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ self.assertIn('Solicitudes de contratos de Monitoría',
+ self.selenium.title)
def test_create_form_cex(self):
self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
password_input = self.selenium.find_element(By.NAME, 'password')
username_input.send_keys('1106293874')
password_input.send_keys('mariagonzales123')
-
+
password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_cex_contract')
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_cex_contract')
button_create_monitoring_contract.click()
-
- self.selenium.find_element(By.NAME, 'solicitant_name').send_keys('John Doe')
- self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys('Faculty of Engineering')
- self.selenium.find_element(By.NAME, 'hiree_full_name').send_keys('Jane Smith')
+
+ self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys(
+ 'Faculty of Engineering')
+ self.selenium.find_element(
+ By.NAME, 'hiree_full_name').send_keys('Jane Smith')
self.selenium.find_element(By.NAME, 'hiree_id').send_keys('123456789')
- self.selenium.find_element(By.NAME, 'hiree_cellphone').send_keys('1234567890')
- self.selenium.find_element(By.NAME, 'hiree_email').send_keys('jane@example.com')
+ self.selenium.find_element(
+ By.NAME, 'hiree_cellphone').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'hiree_email').send_keys('jane@example.com')
self.selenium.find_element(By.NAME, 'cenco').send_keys('Cenco 123')
- self.selenium.find_element(By.NAME, 'request_motive').send_keys('Hiring new employee')
- self.selenium.find_element(By.NAME, 'banking_entity').send_keys('Bank of Example')
- bank_account_type = self.selenium.find_element(By.NAME, 'bank_account_type')
- bank_account_type.send_keys('Savings')
- self.selenium.find_element(By.NAME, 'bank_account_number').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'request_motive').send_keys('Hiring new employee')
+ self.selenium.find_element(
+ By.NAME, 'banking_entity').send_keys('Bank of Example')
+ bank_account_type = self.selenium.find_element(
+ By.NAME, 'bank_account_type')
+ bank_account_type.send_keys('Ahorros')
+ self.selenium.find_element(
+ By.NAME, 'bank_account_number').send_keys('1234567890')
self.selenium.find_element(By.NAME, 'eps').send_keys('EPS Company')
- self.selenium.find_element(By.NAME, 'pension_fund').send_keys('Pension Fund')
+ self.selenium.find_element(
+ By.NAME, 'pension_fund').send_keys('Pension Fund')
self.selenium.find_element(By.NAME, 'arl').send_keys('ARL Company')
- self.selenium.find_element(By.NAME, 'contract_value').send_keys('1000000')
- self.selenium.find_element(By.NAME, 'charge_account').send_keys('Charge account details')
- ruta_documento_pdf = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'documento.pdf')
+ self.selenium.find_element(
+ By.NAME, 'contract_value').send_keys('1000000')
+ self.selenium.find_element(By.NAME, 'charge_account').send_keys(
+ 'Charge account details')
+ ruta_documento_pdf = os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), 'documento.pdf')
- self.selenium.find_element(By.NAME, 'rut').send_keys(ruta_documento_pdf)
+ self.selenium.find_element(
+ By.NAME, 'rut').send_keys(ruta_documento_pdf)
- self.selenium.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
time.sleep(2)
- notification_message = self.selenium.find_element(By.ID, "notificationMessage").text
-
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
+
self.assertEqual(notification_message, "La solicitud fue exitosa.")
self.assertIn('Solicitudes de contratos CEX', self.selenium.title)
-
def test_create_form_pos(self):
self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
password_input = self.selenium.find_element(By.NAME, 'password')
username_input.send_keys('1106293874')
password_input.send_keys('mariagonzales123')
-
+
password_input.send_keys(Keys.RETURN)
-
- button_create_pos_contract = self.selenium.find_element(By.ID, 'create_pos_contract')
+
+ button_create_pos_contract = self.selenium.find_element(
+ By.ID, 'create_pos_contract')
button_create_pos_contract.click()
-
- self.selenium.find_element(By.NAME, 'solicitant_name').send_keys('John Doe')
- self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys('Faculty of Engineering')
- self.selenium.find_element(By.NAME, 'hiree_full_name').send_keys('Jane Smith')
+
+ self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys(
+ 'Faculty of Engineering')
+ self.selenium.find_element(
+ By.NAME, 'hiree_full_name').send_keys('Jane Smith')
self.selenium.find_element(By.NAME, 'hiree_id').send_keys('123456789')
- self.selenium.find_element(By.NAME, 'hiree_cellphone').send_keys('1234567890')
- self.selenium.find_element(By.NAME, 'hiree_email').send_keys('jane@example.com')
+ self.selenium.find_element(
+ By.NAME, 'hiree_cellphone').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'hiree_email').send_keys('jane@example.com')
self.selenium.find_element(By.NAME, 'cenco').send_keys('Cenco 123')
- self.selenium.find_element(By.NAME, 'request_motive').send_keys('Hiring new employee')
- self.selenium.find_element(By.NAME, 'banking_entity').send_keys('Bank of Example')
- bank_account_type = self.selenium.find_element(By.NAME, 'bank_account_type')
- bank_account_type.send_keys('Savings')
- self.selenium.find_element(By.NAME, 'bank_account_number').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'request_motive').send_keys('Hiring new employee')
+ self.selenium.find_element(
+ By.NAME, 'banking_entity').send_keys('Bank of Example')
+ bank_account_type = self.selenium.find_element(
+ By.NAME, 'bank_account_type')
+ bank_account_type.send_keys('Ahorros')
+ self.selenium.find_element(
+ By.NAME, 'bank_account_number').send_keys('1234567890')
self.selenium.find_element(By.NAME, 'eps').send_keys('EPS Company')
- self.selenium.find_element(By.NAME, 'pension_fund').send_keys('Pension Fund')
+ self.selenium.find_element(
+ By.NAME, 'pension_fund').send_keys('Pension Fund')
self.selenium.find_element(By.NAME, 'arl').send_keys('ARL Company')
- self.selenium.find_element(By.NAME, 'contract_value').send_keys('1000000')
- self.selenium.find_element(By.NAME, 'charge_account').send_keys('Charge account details')
- ruta_documento_pdf = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'documento.pdf')
+ self.selenium.find_element(
+ By.NAME, 'contract_value').send_keys('1000000')
+ self.selenium.find_element(By.NAME, 'charge_account').send_keys(
+ 'Charge account details')
+ ruta_documento_pdf = os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), 'documento.pdf')
- self.selenium.find_element(By.NAME, 'rut').send_keys(ruta_documento_pdf)
- self.selenium.find_element(By.NAME, 'course_name').send_keys('Computer Science')
+ self.selenium.find_element(
+ By.NAME, 'rut').send_keys(ruta_documento_pdf)
+ self.selenium.find_element(
+ By.NAME, 'course_name').send_keys('Computer Science')
self.selenium.find_element(By.NAME, 'period').send_keys('2024 Spring')
self.selenium.find_element(By.NAME, 'group').send_keys('Group A')
self.selenium.find_element(By.NAME, 'intensity').send_keys('20')
self.selenium.find_element(By.NAME, 'total_hours').send_keys('40')
self.selenium.find_element(By.NAME, 'course_code').send_keys('CS101')
- self.selenium.find_element(By.NAME, 'students_quantity').send_keys('30')
+ self.selenium.find_element(
+ By.NAME, 'students_quantity').send_keys('30')
self.selenium.find_element(By.NAME, 'additional_hours').send_keys('10')
- self.selenium.find_element(By.ID, 'add-fields-btn').click()
- additional_fields = self.selenium.find_elements(By.XPATH, '//div[@id="additionalFields"]')
+ additional_fields = self.selenium.find_elements(
+ By.XPATH, '//div[@id="additionalFields"]')
for field in additional_fields:
- field.find_element(By.NAME, 'additionalFields-date').send_keys('2024-05-04')
- field.find_element(By.NAME, 'additionalFields-start_time').send_keys('08:001') # 1 para AM
- field.find_element(By.NAME, 'additionalFields-end_time').send_keys('12:002') # 2 para PM
- field.find_element(By.NAME, 'additionalFields-room').send_keys('Room 101')
- field.find_element(By.NAME, 'additionalFields-responsability').send_keys('Teaching')
+ field.find_element(
+ By.CSS_SELECTOR, "[name^='additionalFields-date']").send_keys('2024-05-04')
+ field.find_element(
+ # 1 para AM
+ By.CSS_SELECTOR, "[name^='additionalFields-start_time']").send_keys('08:001')
+ field.find_element(
+ # 2 para PM
+ By.CSS_SELECTOR, "[name^='additionalFields-end_time']").send_keys('12:002')
+ field.find_element(
+ By.CSS_SELECTOR, "[name^='additionalFields-room']").send_keys('101D')
+ field.find_element(
+ By.CSS_SELECTOR, "[name^='additionalFields-responsability']").send_keys('Teaching')
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+ time.sleep(4)
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
+
+ self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ self.assertIn('Solicitudes de contratos POS', self.selenium.title)
+
+ def test_create_form_monitoring_wrong_data(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_monitoring_contract')
- self.selenium.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
+ button_create_monitoring_contract.click()
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+
time.sleep(2)
- notification_message = self.selenium.find_element(By.ID, "notificationMessage").text
+
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage")
- self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ self.assertEqual(notification_message.text, "")
+
+ self.assertIn('Solicitudes de contratos de Monitoría',
+ self.selenium.title)
+
+ def test_create_form_cex_wrong_data(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_cex_contract')
+
+ button_create_monitoring_contract.click()
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+
+ time.sleep(2)
+
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage")
+
+ self.assertEqual(notification_message.text, "")
+
+ self.assertIn('Solicitudes de contratos CEX', self.selenium.title)
+
+ def test_create_form_pos_wrong_data(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ button_create_pos_contract = self.selenium.find_element(
+ By.ID, 'create_pos_contract')
+
+ button_create_pos_contract.click()
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+
+ time.sleep(2)
+
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
+
+ self.assertEqual(notification_message, "")
+
self.assertIn('Solicitudes de contratos POS', self.selenium.title)
+
diff --git a/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py b/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py
index 706144e..883dce8 100644
--- a/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py
+++ b/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py
@@ -18,6 +18,149 @@ def tearDownClass(cls):
cls.selenium.quit()
super().tearDownClass()
+ def test_search_request_hiring_by_id(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ search_input.send_keys(id)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_solicitant(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ solicitant = first_result.find_element(By.XPATH, './td[2]').text
+
+ search_input.send_keys(solicitant)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_state(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ state = "Pendiente"
+
+ search_input.send_keys(state)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_date(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ date = first_result.find_element(By.XPATH, './td[6]').text
+
+ search_input.send_keys(date)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_wrong_id(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys('abcdef-abcdef-abcdef')
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn('No matching records found', self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr/td').text)
+
+ def test_access_request_hiring(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+
def test_request_hiring_assing_leader(self):
self.selenium.get(self.live_server_url)
@@ -79,9 +222,64 @@ def test_request_hiring_assing_manager(self):
self.assertIn('La solicitud fue exitosa.', self.selenium.find_element(By.ID, 'notificationMessage').text)
+ def test_request_hiring_change_status_pending_review_filled(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
- def test_request_hiring_change_status(self):
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
+ select.select_by_index(1)
+
+
+ time.sleep(2)
+
+ self.assertIn('50%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ with self.assertRaises(NotImplementedError):
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(2)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(3)
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ def test_request_hiring_change_status_pending_incomplete_cancelled(self):
self.selenium.get(self.live_server_url)
username_input = self.selenium.find_element(By.NAME,'id')
@@ -92,6 +290,12 @@ def test_request_hiring_change_status(self):
password_input.send_keys(Keys.RETURN)
self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
@@ -105,17 +309,148 @@ def test_request_hiring_change_status(self):
select = Select(select_element)
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
select.select_by_index(2)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ time.sleep(2)
+
+ self.assertIn('75%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(4)
+
self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+
+ def test_request_hiring_change_status_pending_incomplete_review_cancelled(self):
+ self.selenium.get(self.live_server_url)
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
- self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Save changes"]').click()
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
- time.sleep(2)
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
+
+ with self.assertRaises(NotImplementedError):
+ select.select_by_index(3)
+
+ select.select_by_index(2)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
self.assertIn('75%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+ with self.assertRaises(NotImplementedError):
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(3)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(1)
+
+ self.assertIn('50%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(4)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ def test_request_hiring_change_status_pending_cancelled(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
+ select.select_by_index(4)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
def test_request_hiring_comment(self):
@@ -180,6 +515,4 @@ def test_request_hiring_snapshot(self):
info = self.selenium.find_element(By.ID, 'pending').text
- print(info)
-
self.assertIn('Estado de la contratacion:\npending', info)
diff --git a/hiring_module/hiring_app/tests/functionality/statistics/__init__.py b/hiring_module/hiring_app/tests/functionality/statistics/__init__.py
new file mode 100644
index 0000000..a7d4d95
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/statistics/__init__.py
@@ -0,0 +1 @@
+from .statistics import *
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/statistics/statistics.py b/hiring_module/hiring_app/tests/functionality/statistics/statistics.py
new file mode 100644
index 0000000..441113a
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/statistics/statistics.py
@@ -0,0 +1,172 @@
+from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from selenium.webdriver.chrome.webdriver import WebDriver
+from selenium.webdriver.common.keys import Keys
+from selenium.webdriver.common.by import By
+from datetime import datetime
+from selenium.webdriver.support.select import Select
+import time
+
+class StatisticsTest(StaticLiveServerTestCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.selenium = WebDriver()
+ cls.selenium.implicitly_wait(10)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.selenium.quit()
+ super().tearDownClass()
+
+ def test_date_range_statistics(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ time.sleep(2)
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ # Get the current date
+ current_date = datetime.now().strftime('%m/%d/%Y')
+
+ # Send the current date to the start_date field
+ start_date = self.selenium.find_element(By.ID, 'start_date')
+ start_date.send_keys(current_date)
+
+ # Send the current date to the end_date field
+ end_date = self.selenium.find_element(By.ID, 'end_date')
+ end_date.send_keys(current_date)
+
+ contratos_cex = self.selenium.find_element(By.ID, 'contratos_cex').text
+ self.assertIn('4', contratos_cex)
+
+ def test_leader_statistics(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ time.sleep(2)
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.NAME, 'leader')
+
+ select = Select(select_element)
+
+ select.select_by_index(1)
+
+ time.sleep(2)
+
+ self.assertIn('La solicitud fue exitosa.', self.selenium.find_element(By.ID, 'notificationMessage').text)
+
+ notificationCloseBtn = self.selenium.find_element(By.ID, 'notificationCloseBtn')
+
+ notificationCloseBtn.click()
+
+ time.sleep(2)
+
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ time.sleep(2)
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ select_element = self.selenium.find_element(By.ID, "data_leader_select")
+
+ select = Select(select_element)
+
+ select.select_by_index(0)
+
+ solicitudes_por_validar_leader = self.selenium.find_element(By.ID, 'solicitudes_por_validar_leader').text
+
+ self.assertIn('1', solicitudes_por_validar_leader)
+
+ time.sleep(2)
+
+ def test_manager_statistics(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ time.sleep(2)
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.NAME, 'manager')
+
+ select = Select(select_element)
+
+ select.select_by_index(1)
+
+ time.sleep(2)
+
+ self.assertIn('La solicitud fue exitosa.', self.selenium.find_element(By.ID, 'notificationMessage').text)
+
+ notificationCloseBtn = self.selenium.find_element(By.ID, 'notificationCloseBtn')
+
+ notificationCloseBtn.click()
+
+ time.sleep(2)
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ time.sleep(2)
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+
+ select_element = self.selenium.find_element(By.ID, "data_manager_select")
+
+ select = Select(select_element)
+
+ select.select_by_index(0)
+
+ solicitudes_por_validar_leader = self.selenium.find_element(By.ID, 'solicitudes_por_validar_manager').text
+
+ self.assertIn('1', solicitudes_por_validar_leader)
+
+
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/urls.py b/hiring_module/hiring_app/urls.py
index a99599b..644bb0c 100644
--- a/hiring_module/hiring_app/urls.py
+++ b/hiring_module/hiring_app/urls.py
@@ -10,6 +10,7 @@
from hiring_app.views.control_board.administrator_user_list_view import AdministratorUserListView
from hiring_app.views.control_board.add_user_view import AddUserView
from hiring_app.views.statistical_registers.statistics_view import StatisticsView
+from hiring_app.views.control_board.export_requests_view import ExportRequestsView
app_name = 'hiring_app'
@@ -43,5 +44,6 @@
path('download_rut//',
download_rut_file, name='download_rut'),
path('statistics/', StatisticsView.as_view(), name='statistics'),
+ path('export_requests/', ExportRequestsView.as_view(), name='export_requests')
]
diff --git a/hiring_module/hiring_app/views/__init__.py b/hiring_module/hiring_app/views/__init__.py
index 5ba591d..50fe5f3 100644
--- a/hiring_module/hiring_app/views/__init__.py
+++ b/hiring_module/hiring_app/views/__init__.py
@@ -9,3 +9,4 @@
from .control_board.leader_dashboard_view import LeaderDashboardView
from .control_board.manager_dashboard_view import ManagerDashboardView
from .request_hiring.assign_leader import AssignLeaderView
+from .control_board.export_requests_view import ExportRequestsView
diff --git a/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py b/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py
index 6511824..d34c283 100644
--- a/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py
+++ b/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py
@@ -21,11 +21,23 @@ def dispatch(self, *args, **kwargs):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
users = CustomUser.objects.filter(groups__name__in=['admin', 'leader', 'manager'])
+ admins_ammount = 0
+ leaders_ammount = 0
+ managers_ammount = 0
# Add a role field to each user object
for user in users:
user.role = str(user.groups.first())
+ if user.role == 'admin':
+ admins_ammount += 1
+ elif user.role == 'leader':
+ leaders_ammount += 1
+ elif user.role == 'manager':
+ managers_ammount += 1
context['users'] = users
context['actualgroup'] = 'admin'
+ context['admins_ammount'] = admins_ammount
+ context['leaders_ammount'] = leaders_ammount
+ context['managers_ammount'] = managers_ammount
return context
def post(self, request, *args, **kwargs):
diff --git a/hiring_module/hiring_app/views/control_board/export_requests_view.py b/hiring_module/hiring_app/views/control_board/export_requests_view.py
new file mode 100644
index 0000000..7572999
--- /dev/null
+++ b/hiring_module/hiring_app/views/control_board/export_requests_view.py
@@ -0,0 +1,8 @@
+from django.shortcuts import redirect
+from django.views import View
+from hiring_app.model.user_model import CustomUser
+from .utilities import export_requests
+class ExportRequestsView(View):
+
+ def get(self, request):
+ return export_requests(self.request.user)
\ No newline at end of file
diff --git a/hiring_module/hiring_app/views/control_board/utilities.py b/hiring_module/hiring_app/views/control_board/utilities.py
index 88b8c00..df72451 100644
--- a/hiring_module/hiring_app/views/control_board/utilities.py
+++ b/hiring_module/hiring_app/views/control_board/utilities.py
@@ -7,6 +7,14 @@
from hiring_app.model.cex_contract_request_model import CEXContractRequest
from hiring_app.model.monitoring_contract_request_model import MonitoringContractRequest
from hiring_app.model.provision_of_services_request_model import ProvisionOfServicesContractRequest
+from django.http import HttpResponse
+from openpyxl import Workbook
+
+from datetime import datetime
+from django.db.models import Q
+from django.utils import timezone
+from itertools import chain
+
# Decorator to redirect users to the correct dashboard based on their role
def role_redirect(view_func):
@@ -89,15 +97,57 @@ def get_requests(user):
requests_CEX = CEXContractRequest.objects.filter(manager_assigned_to=user.id)
requests_monitoring = MonitoringContractRequest.objects.filter(manager_assigned_to=user.id)
requests_pos = ProvisionOfServicesContractRequest.objects.filter(manager_assigned_to=user.id)
+
+ for request in requests_CEX:
+ request.request_type = 'CEX'
+
+ for request in requests_monitoring:
+ request.request_type = 'Monitoría'
+
+ for request in requests_pos:
+ request.request_type = 'Honorarios'
groupManager = Group.objects.get(name='manager')
groupLeader = Group.objects.get(name='leader')
managers = list(CustomUser.objects.filter(groups=groupManager))
leaders = list(CustomUser.objects.filter(groups=groupLeader))
+
+ current_date = timezone.now()
+ current_month = current_date.month
+ current_year = current_date.year
+
+ requests = list(requests_CEX) + list(requests_monitoring) + list(requests_pos)
+
+ requests_month = list(
+ chain(
+ requests_CEX.filter(start_date__month=current_month, start_date__year=current_year),
+ requests_monitoring.filter(start_date__month=current_month, start_date__year=current_year),
+ requests_pos.filter(start_date__month=current_month, start_date__year=current_year)
+ )
+ )
+
+ filled_requests = list(
+ chain(
+ requests_CEX.filter(start_date__month=current_month, start_date__year=current_year, state='filed'),
+ requests_monitoring.filter(start_date__month=current_month, start_date__year=current_year, state='filed'),
+ requests_pos.filter(start_date__month=current_month, start_date__year=current_year, state='filed')
+ )
+ )
+
+ reviewed_requests = list(
+ chain(
+ requests_CEX.filter(start_date__month=current_month, start_date__year=current_year, state='review'),
+ requests_monitoring.filter(start_date__month=current_month, start_date__year=current_year, state='review'),
+ requests_pos.filter(start_date__month=current_month, start_date__year=current_year, state='review')
+ )
+ )
+
+
return {
- 'requests': list(requests_CEX) + list(requests_monitoring) + list(requests_pos),
- 'filled_requests': list(requests_CEX.filter(state='filed')) + list(requests_monitoring.filter(state='filed')) + list(requests_pos.filter(state='filed')),
- 'reviewed_requests': list(requests_CEX.filter(state='review')) + list(requests_monitoring.filter(state='review')) + list(requests_pos.filter(state='review')),
+ 'requests': requests,
+ 'requests_month': requests_month,
+ 'filled_requests': filled_requests,
+ 'reviewed_requests': reviewed_requests,
'for_validate_requests': list(requests_CEX.filter(state__in=['pending', 'incomplete'])) + list(requests_monitoring.filter(state__in=['pending', 'incomplete'])) + list(requests_pos.filter(state__in=['pending', 'incomplete'])),
'leaders': leaders,
'managers': managers,
@@ -105,4 +155,257 @@ def get_requests(user):
-
+def export_requests(user):
+ groups = [group.name for group in user.groups.all()]
+ requests_CEX = CEXContractRequest.objects.none()
+ requests_monitoring = MonitoringContractRequest.objects.none()
+ requests_pos = ProvisionOfServicesContractRequest.objects.none()
+
+ if 'admin' in groups:
+ requests_CEX = CEXContractRequest.objects.all()
+ requests_monitoring = MonitoringContractRequest.objects.all()
+ requests_pos = ProvisionOfServicesContractRequest.objects.all()
+ elif 'leader' in groups:
+ requests_CEX = CEXContractRequest.objects.filter(leader_assigned_to=user.id)
+ requests_monitoring = MonitoringContractRequest.objects.filter(leader_assigned_to=user.id)
+ requests_pos = ProvisionOfServicesContractRequest.objects.filter(leader_assigned_to=user.id)
+ elif 'manager' in groups:
+ requests_CEX = CEXContractRequest.objects.filter(manager_assigned_to=user.id)
+ requests_monitoring = MonitoringContractRequest.objects.filter(manager_assigned_to=user.id)
+ requests_pos = ProvisionOfServicesContractRequest.objects.filter(manager_assigned_to=user.id)
+
+
+
+ wb = Workbook()
+
+ ws1 = wb.active
+ ws1.title = "Solicitudes de Contratación"
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ ]
+
+ ws1.append(headers)
+
+ for request in (list(requests_CEX) + list(requests_monitoring) + list(requests_pos)):
+ row_data = [
+ str(request.id),
+ request.start_date.strftime('%Y-%m-%d'),
+ request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if request.completion_date else None,
+ request.estimated_completion_date.strftime('%Y-%m-%d') if request.estimated_completion_date else None,
+ request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ request.state,
+ f'{request.manager_assigned_to.first_name} {request.manager_assigned_to.last_name}' if request.manager_assigned_to else 'sin asignar',
+ f'{request.leader_assigned_to.first_name} {request.leader_assigned_to.last_name}' if request.leader_assigned_to else 'sin asignar',
+ f'{request.created_by.first_name} {request.created_by.last_name}' if request.created_by else 'sin asignar',
+ ]
+ ws1.append(row_data)
+
+
+ ws2 = wb.create_sheet(title="CEX")
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ "Hiree Full Name",
+ "Hiree ID",
+ "Hiree Cellphone",
+ "Hiree Email",
+ "Cenco",
+ "Request Motive",
+ "Banking Entity",
+ "Bank Account Type",
+ "Bank Account Number",
+ "EPS",
+ "Pension Fund",
+ "ARL",
+ "Contract Value",
+ "Charge Account",
+ "RUT"
+ ]
+ ws2.append(headers)
+
+ for cex_request in requests_CEX:
+ row_data = [
+ str(cex_request.id),
+ cex_request.start_date.strftime('%Y-%m-%d'),
+ cex_request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if cex_request.completion_date else None,
+ cex_request.estimated_completion_date.strftime('%Y-%m-%d') if cex_request.estimated_completion_date else None,
+ cex_request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ cex_request.state,
+ f'{cex_request.manager_assigned_to.first_name} {cex_request.manager_assigned_to.last_name}' if cex_request.manager_assigned_to else 'sin asignar',
+ f'{cex_request.leader_assigned_to.first_name} {cex_request.leader_assigned_to.last_name}' if cex_request.leader_assigned_to else 'sin asignar',
+ f'{cex_request.created_by.first_name} {cex_request.created_by.last_name}' if cex_request.created_by else 'sin asignar',
+ cex_request.hiree_full_name,
+ cex_request.hiree_id,
+ cex_request.hiree_cellphone,
+ cex_request.hiree_email,
+ cex_request.cenco,
+ cex_request.request_motive,
+ cex_request.banking_entity,
+ cex_request.bank_account_type,
+ cex_request.bank_account_number,
+ cex_request.eps,
+ cex_request.pension_fund,
+ cex_request.arl,
+ cex_request.contract_value,
+ cex_request.charge_account,
+ cex_request.rut.url if cex_request.rut else ""
+ ]
+ ws2.append(row_data)
+
+ ws3 = wb.create_sheet(title="Monitorías")
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ "Cenco",
+ "Has Money in Cenco",
+ "Cenco Manager",
+ "Monitoring Type",
+ "Student Code",
+ "Student Full Name",
+ "Student ID",
+ "Student Email",
+ "Student Cellphone",
+ "Daviplata",
+ "Course or Project",
+ "Monitoring Description",
+ "Weekly Hours",
+ "Total Value to Pay",
+ "Is Unique Payment"
+ ]
+ ws3.append(headers)
+
+ for monitoring_request in requests_monitoring:
+ row_data = [
+ str(monitoring_request.id),
+ monitoring_request.start_date.strftime('%Y-%m-%d'),
+ monitoring_request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if monitoring_request.completion_date else None,
+ monitoring_request.estimated_completion_date.strftime('%Y-%m-%d') if monitoring_request.estimated_completion_date else None,
+ monitoring_request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ monitoring_request.state,
+ f'{monitoring_request.manager_assigned_to.first_name} {monitoring_request.manager_assigned_to.last_name}' if monitoring_request.manager_assigned_to else 'sin asignar',
+ f'{monitoring_request.leader_assigned_to.first_name} {monitoring_request.leader_assigned_to.last_name}' if monitoring_request.leader_assigned_to else 'sin asignar',
+ f'{monitoring_request.created_by.first_name} {monitoring_request.created_by.last_name}' if monitoring_request.created_by else 'sin asignar',
+ monitoring_request.cenco,
+ monitoring_request.has_money_in_cenco,
+ monitoring_request.cenco_manager,
+ monitoring_request.monitoring_type,
+ monitoring_request.student_code,
+ monitoring_request.student_full_name,
+ monitoring_request.student_id,
+ monitoring_request.student_email,
+ monitoring_request.student_cellphone,
+ monitoring_request.daviplata,
+ monitoring_request.course_or_proyect,
+ monitoring_request.monitoring_description,
+ monitoring_request.weekly_hours,
+ monitoring_request.total_value_to_pay,
+ monitoring_request.is_unique_payment
+ ]
+ ws3.append(row_data)
+
+ ws4 = wb.create_sheet(title="Honorarios")
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ "Hiree Full Name",
+ "Hiree ID",
+ "Hiree Cellphone",
+ "Hiree Email",
+ "Cenco",
+ "Request Motive",
+ "Banking Entity",
+ "Bank Account Type",
+ "Bank Account Number",
+ "EPS",
+ "Pension Fund",
+ "ARL",
+ "Contract Value",
+ "Charge Account",
+ "RUT",
+ "Course Name",
+ "Period",
+ "Group",
+ "Intensity",
+ "Total Hours",
+ "Course Code",
+ "Students Quantity",
+ "Additional Hours"
+ ]
+
+ ws4.append(headers)
+
+ for post_request in requests_pos:
+ row_data = [
+ str(post_request.id),
+ post_request.start_date.strftime('%Y-%m-%d'),
+ post_request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if post_request.completion_date else None,
+ post_request.estimated_completion_date.strftime('%Y-%m-%d') if post_request.estimated_completion_date else None,
+ post_request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ post_request.state,
+ f'{post_request.manager_assigned_to.first_name} {post_request.manager_assigned_to.last_name}' if post_request.manager_assigned_to else 'sin asignar',
+ f'{post_request.leader_assigned_to.first_name} {post_request.leader_assigned_to.last_name}' if post_request.leader_assigned_to else 'sin asignar',
+ f'{post_request.created_by.first_name} {post_request.created_by.last_name}' if post_request.created_by else 'sin asignar',
+ post_request.hiree_full_name,
+ post_request.hiree_id,
+ post_request.hiree_cellphone,
+ post_request.hiree_email,
+ post_request.cenco,
+ post_request.request_motive,
+ post_request.banking_entity,
+ post_request.bank_account_type,
+ post_request.bank_account_number,
+ post_request.eps,
+ post_request.pension_fund,
+ post_request.arl,
+ post_request.contract_value,
+ post_request.charge_account,
+ post_request.rut.url if post_request.rut else "",
+ post_request.course_name,
+ post_request.period,
+ post_request.group,
+ post_request.intensity,
+ post_request.total_hours,
+ post_request.course_code,
+ post_request.students_quantity,
+ post_request.additional_hours
+ ]
+ ws4.append(row_data)
+
+ response = HttpResponse(content_type='application/ms-excel')
+ response['Content-Disposition'] = 'attachment; filename="solicitudes.xlsx"'
+ wb.save(response)
+
+ return response
\ No newline at end of file
diff --git a/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py b/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py
index 102bff4..32aad4e 100644
--- a/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py
+++ b/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py
@@ -2,12 +2,14 @@
from django.views.generic import CreateView
from hiring_app.forms import CEXContractRequestForm
from hiring_app.model import CEXContractRequest
+from hiring_app.model import ProvisionOfServicesContractRequest
from django.urls import reverse_lazy
from datetime import datetime, timedelta
from .utilities import utilities
from django.shortcuts import get_object_or_404
from django.core.exceptions import PermissionDenied
+
class CEXContractRequestView(CreateView):
model = CEXContractRequest
form_class = CEXContractRequestForm
@@ -20,6 +22,7 @@ def form_valid(self, form):
estimated_completion_date = datetime.now() + timedelta(days=30)
leader = utilities.findLeaderToAssign()
manager = utilities.findManagerToAssign()
+ form.instance.id_solicitant_name = self.request.user.first_name
form.instance.estimated_completion_date = estimated_completion_date
form.instance.created_by = current_user
form.instance.leader_assigned_to = leader
@@ -29,9 +32,9 @@ def form_valid(self, form):
cex_contract_request.create_snapshot()
cex_contract_request.save()
utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',
- current_user.email)
+ current_user.email)
return super().form_valid(form)
-
+
def form_invalid(self, form):
return self.render_to_response(self.get_context_data(form=form))
@@ -39,15 +42,20 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['actualgroup'] = 'external'
return context
-
-
+
def download_rut_file(request, idContract, *args, **kwargs):
# Get the rut and send it as a file
- model_instance = get_object_or_404(CEXContractRequest, id=idContract)
+ model_instance = None
+
+ if CEXContractRequest.objects.filter(id=idContract).exists():
+ model_instance = get_object_or_404(CEXContractRequest, id=idContract)
+ else:
+ model_instance = get_object_or_404(ProvisionOfServicesContractRequest, id=idContract)
if not request.user.has_perm('your_app.view_cexcontractrequest'):
- raise PermissionDenied("You don't have permission to download this file.")
-
+ raise PermissionDenied(
+ "You don't have permission to download this file.")
+
if not model_instance.rut:
raise Http404("The requested file does not exist.")
try:
@@ -55,6 +63,7 @@ def download_rut_file(request, idContract, *args, **kwargs):
except IOError as e:
raise IOError(f"Error reading file: {e}")
- response = HttpResponse(rut_file_data, content_type='application/octet-stream')
+ response = HttpResponse(
+ rut_file_data, content_type='application/octet-stream')
response['Content-Disposition'] = f'attachment; filename="{model_instance.rut.name}"'
- return response
\ No newline at end of file
+ return response
diff --git a/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py b/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py
index 56351c3..e77458c 100644
--- a/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py
+++ b/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py
@@ -27,8 +27,7 @@ def form_valid(self, form):
monitoring_contract_request.save()
- utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',
- current_user.email)
+ utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',current_user.email)
return super().form_valid(form)
def form_invalid(self, form):
diff --git a/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py b/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py
index 46da7d9..9f3bf0f 100644
--- a/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py
+++ b/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py
@@ -9,6 +9,7 @@
from django.shortcuts import get_object_or_404
from django.core.exceptions import PermissionDenied
+
class POSContractRequestView(CreateView):
model = ProvisionOfServicesContractRequest
form_class = ProvisionOfServicesContractRequestForm
@@ -21,6 +22,7 @@ def form_valid(self, form):
estimated_completion_date = datetime.now() + timedelta(days=30)
leader = utilities.findLeaderToAssign()
manager = utilities.findManagerToAssign()
+ form.instance.id_solicitant_name = self.request.user.first_name
form.instance.estimated_completion_date = estimated_completion_date
form.instance.created_by = current_user
form.instance.leader_assigned_to = leader
@@ -35,29 +37,31 @@ def form_valid(self, form):
field_name = key.replace('additionalFields-', '')
field_name = field_name.split('-')[0]
additional_fields[field_name] = value
- if(field_name == 'responsability'):
+ if (field_name == 'responsability'):
additional_fields['pos_contract_request'] = pos_contract_request
- course_schedule = CourseSchedule.objects.create_schedule(**additional_fields)
+ course_schedule = CourseSchedule.objects.create_schedule(
+ **additional_fields)
course_schedule.save()
additional_fields = {}
- utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',
- current_user.email)
+ utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',current_user.email)
return super().form_valid(form)
-
+
def form_invalid(self, form):
return self.render_to_response(self.get_context_data(form=form))
-
+
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['actualgroup'] = 'external'
return context
-
+
def download_rut_file(request, idContract, *args, **kwargs):
# Get the rut and send it as a file
- model_instance = get_object_or_404(ProvisionOfServicesContractRequest, id=idContract)
+ model_instance = get_object_or_404(
+ ProvisionOfServicesContractRequest, id=idContract)
if not request.user.has_perm('your_app.view_poscontractrequest'):
- raise PermissionDenied("You don't have permission to download this file.")
+ raise PermissionDenied(
+ "You don't have permission to download this file.")
if not model_instance.rut:
raise Http404("The requested file does not exist.")
@@ -66,6 +70,7 @@ def download_rut_file(request, idContract, *args, **kwargs):
except IOError as e:
raise IOError(f"Error reading file: {e}")
- response = HttpResponse(rut_file_data, content_type='application/octet-stream')
+ response = HttpResponse(
+ rut_file_data, content_type='application/octet-stream')
response['Content-Disposition'] = f'attachment; filename="{model_instance.rut.name}"'
- return response
\ No newline at end of file
+ return response
diff --git a/hiring_module/hiring_app/views/request_hiring/change_state.py b/hiring_module/hiring_app/views/request_hiring/change_state.py
index f95f18e..9ecd92b 100644
--- a/hiring_module/hiring_app/views/request_hiring/change_state.py
+++ b/hiring_module/hiring_app/views/request_hiring/change_state.py
@@ -33,8 +33,6 @@ def post(self, request, idContract):
contract_request = utilities.getContract(idContract)
new_state = request.POST.get('state')
reason = request.POST.get('reason')
- print(new_state)
- print(reason)
state_actions = {
'incomplete': {
'email_function': self.send_email_file
diff --git a/hiring_module/hiring_app/views/statistical_registers/statistics_view.py b/hiring_module/hiring_app/views/statistical_registers/statistics_view.py
index a746aea..2f662ba 100644
--- a/hiring_module/hiring_app/views/statistical_registers/statistics_view.py
+++ b/hiring_module/hiring_app/views/statistical_registers/statistics_view.py
@@ -5,11 +5,10 @@
from ..utilities import leader_or_admin_redirect_to_manager_statistics, get_manager_metrics, get_leader_metrics, get_average_duration
-
class StatisticsView(View):
template_name = 'statistical_registers/statistics.html'
- #@method_decorator(leader_or_admin_redirect_to_manager_statistics)
+ # @method_decorator(leader_or_admin_redirect_to_manager_statistics)
def dispatch(self, request, *args, **kwargs):
# Get the required metrics
@@ -19,6 +18,6 @@ def dispatch(self, request, *args, **kwargs):
group = {'actualgroup': 'other'}
if self.request.user.groups.first().name == 'admin':
group = {'actualgroup': 'admin'}
-
+
# Pass metrics as context to template
- return render(request, self.template_name, manager_metrics|leader_metrics|average_duration|group)
+ return render(request, self.template_name, manager_metrics | leader_metrics | average_duration | group)
diff --git a/hiring_module/hiring_app/views/utilities.py b/hiring_module/hiring_app/views/utilities.py
index 50d5585..a92ed19 100644
--- a/hiring_module/hiring_app/views/utilities.py
+++ b/hiring_module/hiring_app/views/utilities.py
@@ -50,7 +50,7 @@ def get_manager_metrics():
cex_requests = CEXContractRequest.objects.all()
monitoring_requests = MonitoringContractRequest.objects.all()
- pos_requests = ProvisionOfServicesContractRequest.objects.all()
+ pos_requests = ProvisionOfServicesContractRequest.objects.all()
# Initialize a defaultdict to store requests count for each date
requests_count_by_date = defaultdict(lambda: [0, 0, 0])
@@ -100,12 +100,16 @@ def get_manager_metrics():
) + pos_requests.filter(state='incomplete').count(
)
+ cancelled_requests = cex_requests.filter(state='cancelled').count(
+ ) + monitoring_requests.filter(state='cancelled').count(
+ ) + pos_requests.filter(state='cancelled').count(
+ )
data.append([(manager.first_name + ' ' + manager.last_name), approved_requests,
- review_requests, for_validate_requests])
+ review_requests, for_validate_requests,cancelled_requests])
- best_to_worse_manager.append([(manager.first_name + ' ' + manager.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests)])
+ best_to_worse_manager.append([(manager.first_name + ' ' + manager.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests,cancelled_requests)])
best_to_worse_manager = sorted(best_to_worse_manager, key=lambda x: x[1], reverse=True)
@@ -191,12 +195,17 @@ def get_leader_metrics():
) + pos_requests.filter(state='incomplete').count(
)
+ cancelled_requests = cex_requests.filter(state='cancelled').count(
+ ) + monitoring_requests.filter(state='cancelled').count(
+ ) + pos_requests.filter(state='cancelled').count(
+ )
+
data.append([(leader.first_name + ' ' + leader.last_name), approved_requests,
- review_requests, for_validate_requests])
+ review_requests, for_validate_requests,cancelled_requests])
- best_to_worse_leader.append([(leader.first_name + ' ' + leader.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests)])
+ best_to_worse_leader.append([(leader.first_name + ' ' + leader.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests,cancelled_requests)])
best_to_worse_leader = sorted(best_to_worse_leader, key=lambda x: x[1], reverse=True)
@@ -212,13 +221,13 @@ def get_leader_metrics():
}
-def quality_calculator(aprobadas, en_revision, por_validar):
- total = aprobadas + en_revision + por_validar
+def quality_calculator(approved_requests, under_review_requests, for_validate_requests, cancelled_requests):
+ total = approved_requests + under_review_requests + for_validate_requests + cancelled_requests
if total != 0:
- porcentaje_aprobadas = (aprobadas / total) * 100
- porcentaje_aprobadas = round(porcentaje_aprobadas, 2)
- return porcentaje_aprobadas
+ quality = ((approved_requests + cancelled_requests)/ total) * 100
+ quality = round(quality, 2)
+ return quality
else:
return 0
@@ -229,7 +238,7 @@ def get_average_duration():
list(ProvisionOfServicesContractRequest.objects.filter(Q(state='filed') | Q(state='cancelled')))
)
- total_duration_seconds = sum((request.completion_date - timezone.make_aware(datetime.combine(request.start_date, datetime.min.time()), timezone.utc)).total_seconds() for request in approved_or_cancelled_requests if request.completion_date and request.start_date)
+ total_duration_seconds = sum((request.completion_date - timezone.make_aware(datetime.combine(request.start_date, datetime.min.time()))).total_seconds() for request in approved_or_cancelled_requests if request.completion_date and request.start_date)
total_count = len(approved_or_cancelled_requests)
total_avg_duration_seconds = total_duration_seconds / total_count if total_count > 0 else 0
@@ -262,6 +271,10 @@ def get_resolved_after_estimated_date():
return resolved_after_estimated_date_count
+
+
+
+
diff --git a/hiring_module/requirements.txt b/hiring_module/requirements.txt
index 96ffe06..029d66c 100644
--- a/hiring_module/requirements.txt
+++ b/hiring_module/requirements.txt
@@ -7,3 +7,4 @@ six == 1.16.0
sqlparse == 0.4.3
tzdata == 2022.7
selenium
+openpyxl
\ No newline at end of file
diff --git a/hiring_module/test_db.sqlite3 b/hiring_module/test_db.sqlite3
new file mode 100644
index 0000000..e69de29
{{ request.leader_assigned_to.first_name }}
@@ -46,7 +50,19 @@Listado de solicitudes de contrata
{{ request.manager_assigned_to.first_name }}
{% include 'request_hiring/components/assign_manager.html' with managers=managers contract_request=request form_id_prefix='change_manager_form_' %}
-
-
- {% csrf_token %}
-
-
-
+ {% csrf_token %}
+
Solicitudes de contratos CEX
- -
-
-
-
-
-
-
-
-
-
-
+{% extends 'base.html' %} {% load static %} {% block title %} Solicitudes de
+contratos CEX {% endblock %} {% block content %}
+
+
+
+ Solicitudes de contratos de CEX +
+
+
+
+
+
+
+
+
+ + Información del contratado +
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ + Información financiera +
+
+
+
+
+
-
-
-
+
-
+
+
+ -
-
-
+
-
+
+
+ -
-
-
+
-
+
+
+
+
+
-
-
-
-
-
-
-
+ -
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+ + Información legal para el contrato +
+
+
+
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
-
-
-
-
-
+
-
-
-
-
+
-
- Título de la notificación
- -
-
- Mensaje de notificación
-
-
-
-
+
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html b/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html
index eeb106e..d2ba024 100644
--- a/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html
+++ b/hiring_module/hiring_app/templates/request_creation/monitoring_request_form.html
@@ -1,230 +1,600 @@
-{% extends 'base.html' %}
-{% load static %}
-
-{% block title %}
-Solicitudes de contratos de Monitoría
-{% endblock %}
-
-{% block content %}
-
-
+
+
+
+
+ + Título de la notificación +
+ +
+
+ Mensaje de notificación
+
+
+
-
-
-
- {% if form.errors %}
-
- {% csrf_token %}
-
-
-
-
- {% endif %}
-
- -
- {% for field, error in form.errors.items %}
-
- {{ field }}: {{ error }} - {% endfor %} -
Solicitudes de contratos de Monitoría
- -
-
-
-
-
-
-
-
-
+{% extends 'base.html' %} {% load static %} {% block title %} Solicitudes de
+contratos de Monitoría {% endblock %} {% block content %}
+
+
+
+
+
+ {% csrf_token %}
+
+
+ Solicitudes de contratos de Monitoría +
+
+
+
+
+
+
-
-
+
-
-
- + Información del estudiante +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
-
+
+
-
-
+
-
-
- + Información financiera +
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
-
-
- + Información de la monitoria +
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
-
- Título de la notificación
- -
-
- Mensaje de notificación
-
-
-
-
+
-
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html b/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html
index d251355..f93531c 100644
--- a/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html
+++ b/hiring_module/hiring_app/templates/request_creation/partials/course_schedule.html
@@ -1,34 +1,35 @@
+
+
+
+
+
+ + Título de la notificación +
+ +
+
+ Mensaje de notificación
+
+
+
-
+
-
+
-
+
-
+
-
+
diff --git a/hiring_module/hiring_app/templates/request_creation/pos_request_form.html b/hiring_module/hiring_app/templates/request_creation/pos_request_form.html
index 6430d3d..b187d65 100644
--- a/hiring_module/hiring_app/templates/request_creation/pos_request_form.html
+++ b/hiring_module/hiring_app/templates/request_creation/pos_request_form.html
@@ -1,356 +1,1089 @@
-{% extends 'base.html' %}
-{% load static %}
-
-{% block title %}
-Solicitudes de contratos POS
-{% endblock %}
-
-{% block content %}
-
+{% extends 'base.html' %} {% load static %} {% block title %} Solicitudes de
+contratos POS {% endblock %} {% block content %}
-
-
- {% if form.errors %}
-
- {% csrf_token %}
-
-
-
-
- {% endif %}
-
- -
- {% for field, error in form.errors.items %}
-
- {{ field }}: {{ error }} - {% endfor %} -
Solicitudes de contratos de prestacion de servicio
- -
-
-
-
-
-
-
-
-
-
+
+
+ {% csrf_token %}
+
+
+ Solicitudes de contratos de prestacion de servicio +
+
+
+
+
+
+
-
-
+
+
+ + Información del contratado +
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
+
+
+ + Información financiera +
+
+
+
- -
- -
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+ - -
-
-
-
+
+
+
+
+
+ - -
-
-
+
+
+ +
+
+
+
+ + +
+
+
+
+
-
-
-
+
+
+
+
+
-
-
+
+
+ + Información del contratado +
+
+
+
+
+
+
+
+
+
+
- -
+
+ - -
-
-
-
+
+
+
+
- -
+
+ - -
-
-
-
+
+
+
+
- -
-
- - -
-
-
-
+
+
+
-
-
-
+
+
+
+
+
- -
- -
-
-
+
+
+ +
-
-
-
+
+
+
-
+
+
-
-
+
+ + Información de la clase +
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ + Horario de clases +
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
- Course schedules:
- -
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
-
-
+
+
-
-
-
+
-
-
-
+
-
diff --git a/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html b/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html
index bf9dcca..c3a9ee0 100644
--- a/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html
+++ b/hiring_module/hiring_app/templates/request_hiring/monitoring_information.html
@@ -1,134 +1,218 @@
-
-
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html b/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html
index 0e35df1..9c992aa 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/assign_leader.html
@@ -4,7 +4,7 @@
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html b/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html
index 7e70581..499e58a 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/assign_manager.html
@@ -9,7 +9,7 @@
{% for manager in managers %}
-
+
{% endfor %}
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/change_state.html b/hiring_module/hiring_app/templates/request_hiring/components/change_state.html
index 69a6a2e..81bd475 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/change_state.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/change_state.html
@@ -3,7 +3,22 @@
@@ -20,8 +35,8 @@
-
+
-
- Título de la notificación
- -
-
- Mensaje de notificación
-
-
-
-
+
+
+
+{% endblock %}
diff --git a/hiring_module/hiring_app/templates/request_hiring/cex_information.html b/hiring_module/hiring_app/templates/request_hiring/cex_information.html
index 5e7e20f..4dcc04b 100644
--- a/hiring_module/hiring_app/templates/request_hiring/cex_information.html
+++ b/hiring_module/hiring_app/templates/request_hiring/cex_information.html
@@ -1,140 +1,235 @@
-
+
+
+
+
+ + Título de la notificación +
+ +
+
+ Mensaje de notificación
+
+
+
+
++ Solicitudes de contratos de CEX +
+
+
+
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+ + Información del contratado +
+
+
+
+
+
+
+ Nombre Completo del Contratado
+
+ El nombre completo de la persona contratada.
+
+ |
+ + {{ contract_request.hiree_full_name }} + | +
+ ID del Contratado
+
+ El identificador único asignado al contratado.
+
+ |
+ {{ contract_request.hiree_id }} | +
+ Número de Teléfono del Contratado
+
+ El número de teléfono del contratado.
+
+ |
+ + {{ contract_request.hiree_cellphone }} + | +
+ Correo Electrónico del Contratado
+
+ El correo electrónico de contacto del contratado.
+
+ |
+ + {{ contract_request.hiree_email }} + | +
+ EPS
+
+ La Entidad Promotora de Salud del contratado.
+
+ |
+ {{ contract_request.eps }} | +
+ ARL
+
+ La Administradora de Riesgos Laborales del contratado.
+
+ |
+ {{ contract_request.arl }} | +
+
-
+
+
+
+
+
+ + Información del financiera +
+
+
+
+
+
+
+ Cenco
+
+ Centro de costos asignado al contratado.
+
+ |
+ {{ contract_request.cenco }} | +
+ Entidad Bancaria
+
+ La entidad bancaria a la que está asociada la cuenta bancaria.
+
+ |
+ + {{ contract_request.banking_entity }} + | +
+ + + Tipo de Cuenta Bancaria
+
+ El tipo de cuenta bancaria del contratado.
+
+ |
+
+ + + {{ contract_request.get_bank_account_type_display }} + |
+
+ + + Número de Cuenta Bancaria
+
+ El número de cuenta bancaria del contratado.
+
+ |
+
+ + + {{ contract_request.bank_account_number }} + |
+
+ + Fondo de Pensiones
+
+ El fondo de pensiones del contratado.
+
+ |
+
+ + + {{ contract_request.pension_fund }} + |
+
-
-
-
-
-
-
+
Descripcion | -Datos | -
---|---|
- Nombre Completo del Contratado
- El nombre completo de la persona contratada.
-
- |
- {{ contract_request.hiree_full_name }} | -
- ID del Contratado
- El identificador único asignado al
- contratado.
-
- |
- {{ contract_request.hiree_id }} | -
- Número de Teléfono del Contratado
- El número de teléfono del contratado.
- |
- {{ contract_request.hiree_cellphone }} | -
- Correo Electrónico del Contratado
- El correo electrónico de contacto del
- contratado.
- |
- {{ contract_request.hiree_email }} | -
- Cenco
- Centro de costos asignado al contratado.
-
- |
- {{ contract_request.cenco }} | -
- Motivo de la Solicitud
- El motivo por el cual se realiza la
- solicitud.
-
- |
- {{ contract_request.request_motive }} | -
- Entidad Bancaria
- La entidad bancaria a la que está asociada
- la
- cuenta bancaria.
- |
- {{ contract_request.banking_entity }} | -
- Tipo de Cuenta Bancaria
- El tipo de cuenta bancaria del contratado.
-
- |
- {{ contract_request.get_bank_account_type_display }} | -
- Número de Cuenta Bancaria
- El número de cuenta bancaria del contratado.
-
- |
- {{ contract_request.bank_account_number }} | -
- EPS
- La Entidad Promotora de Salud del
- contratado.
-
- |
- {{ contract_request.eps }} | -
- Fondo de Pensiones
- El fondo de pensiones del contratado.
- |
- {{ contract_request.pension_fund }} | -
- ARL
- La Administradora de Riesgos Laborales del
- contratado.
- |
- {{ contract_request.arl }} | -
- Valor del Contrato
- El valor total del contrato.
- |
- {{ contract_request.contract_value }} | -
- Cuenta de Cobro
- La cuenta bancaria a la que se realizarán
- los
- pagos correspondientes.
- |
- {{ contract_request.charge_account }} | -
- Descargar - Archivo RUT - | -
+ Motivo de la Solicitud
+
+ El motivo por el cual se realiza la solicitud.
+
+ |
+ + {{ contract_request.request_motive }} + | +
Valor del Contrato
+
+ El valor total del contrato.
+
+ Cuenta de Cobro
+
+ La cuenta bancaria a la que se realizarán los pagos
+ correspondientes.
+
+
-
-
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html b/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html
index 55b5cdd..eb1e823 100644
--- a/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html
+++ b/hiring_module/hiring_app/templates/request_hiring/components/modal_change_state.html
@@ -3,13 +3,13 @@
-
Default Bootstrap Modal
+...
-
-
+
+
+
+ Solicitudes de contratos de Monitoría +
+
+
+
+
-
+
+
+
+
+
+ + Información del estudiante +
+
+
+
+
+
+
+
+
+ Código del Estudiante
+
+ El código asignado al estudiante.
+
+ |
+ + {{ contract_request.student_code }} + | +
+ Nombre Completo del Estudiante
+
+ El nombre completo del estudiante.
+
+ |
+ + {{ contract_request.student_full_name }} + | +
+ ID del Estudiante
+
+ El identificador único asignado al estudiante.
+
+ |
+ + {{ contract_request.student_id }} + | +
+ Correo Electrónico del Estudiante
+
+ El correo electrónico de contacto del estudiante.
+
+ |
+ + {{ contract_request.student_email }} + | +
+ Número de Teléfono del Estudiante
+
+ El número de teléfono del estudiante.
+
+ |
+ + {{ contract_request.student_cellphone }} + | +
-
+
+ /',
download_rut_file, name='download_rut'),
path('statistics/', StatisticsView.as_view(), name='statistics'),
+ path('export_requests/', ExportRequestsView.as_view(), name='export_requests')
]
diff --git a/hiring_module/hiring_app/views/__init__.py b/hiring_module/hiring_app/views/__init__.py
index 5ba591d..50fe5f3 100644
--- a/hiring_module/hiring_app/views/__init__.py
+++ b/hiring_module/hiring_app/views/__init__.py
@@ -9,3 +9,4 @@
from .control_board.leader_dashboard_view import LeaderDashboardView
from .control_board.manager_dashboard_view import ManagerDashboardView
from .request_hiring.assign_leader import AssignLeaderView
+from .control_board.export_requests_view import ExportRequestsView
diff --git a/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py b/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py
index 6511824..d34c283 100644
--- a/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py
+++ b/hiring_module/hiring_app/views/control_board/administrator_user_list_view.py
@@ -21,11 +21,23 @@ def dispatch(self, *args, **kwargs):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
users = CustomUser.objects.filter(groups__name__in=['admin', 'leader', 'manager'])
+ admins_ammount = 0
+ leaders_ammount = 0
+ managers_ammount = 0
# Add a role field to each user object
for user in users:
user.role = str(user.groups.first())
+ if user.role == 'admin':
+ admins_ammount += 1
+ elif user.role == 'leader':
+ leaders_ammount += 1
+ elif user.role == 'manager':
+ managers_ammount += 1
context['users'] = users
context['actualgroup'] = 'admin'
+ context['admins_ammount'] = admins_ammount
+ context['leaders_ammount'] = leaders_ammount
+ context['managers_ammount'] = managers_ammount
return context
def post(self, request, *args, **kwargs):
diff --git a/hiring_module/hiring_app/views/control_board/export_requests_view.py b/hiring_module/hiring_app/views/control_board/export_requests_view.py
new file mode 100644
index 0000000..7572999
--- /dev/null
+++ b/hiring_module/hiring_app/views/control_board/export_requests_view.py
@@ -0,0 +1,8 @@
+from django.shortcuts import redirect
+from django.views import View
+from hiring_app.model.user_model import CustomUser
+from .utilities import export_requests
+class ExportRequestsView(View):
+
+ def get(self, request):
+ return export_requests(self.request.user)
\ No newline at end of file
diff --git a/hiring_module/hiring_app/views/control_board/utilities.py b/hiring_module/hiring_app/views/control_board/utilities.py
index 88b8c00..df72451 100644
--- a/hiring_module/hiring_app/views/control_board/utilities.py
+++ b/hiring_module/hiring_app/views/control_board/utilities.py
@@ -7,6 +7,14 @@
from hiring_app.model.cex_contract_request_model import CEXContractRequest
from hiring_app.model.monitoring_contract_request_model import MonitoringContractRequest
from hiring_app.model.provision_of_services_request_model import ProvisionOfServicesContractRequest
+from django.http import HttpResponse
+from openpyxl import Workbook
+
+from datetime import datetime
+from django.db.models import Q
+from django.utils import timezone
+from itertools import chain
+
# Decorator to redirect users to the correct dashboard based on their role
def role_redirect(view_func):
@@ -89,15 +97,57 @@ def get_requests(user):
requests_CEX = CEXContractRequest.objects.filter(manager_assigned_to=user.id)
requests_monitoring = MonitoringContractRequest.objects.filter(manager_assigned_to=user.id)
requests_pos = ProvisionOfServicesContractRequest.objects.filter(manager_assigned_to=user.id)
+
+ for request in requests_CEX:
+ request.request_type = 'CEX'
+
+ for request in requests_monitoring:
+ request.request_type = 'Monitoría'
+
+ for request in requests_pos:
+ request.request_type = 'Honorarios'
groupManager = Group.objects.get(name='manager')
groupLeader = Group.objects.get(name='leader')
managers = list(CustomUser.objects.filter(groups=groupManager))
leaders = list(CustomUser.objects.filter(groups=groupLeader))
+
+ current_date = timezone.now()
+ current_month = current_date.month
+ current_year = current_date.year
+
+ requests = list(requests_CEX) + list(requests_monitoring) + list(requests_pos)
+
+ requests_month = list(
+ chain(
+ requests_CEX.filter(start_date__month=current_month, start_date__year=current_year),
+ requests_monitoring.filter(start_date__month=current_month, start_date__year=current_year),
+ requests_pos.filter(start_date__month=current_month, start_date__year=current_year)
+ )
+ )
+
+ filled_requests = list(
+ chain(
+ requests_CEX.filter(start_date__month=current_month, start_date__year=current_year, state='filed'),
+ requests_monitoring.filter(start_date__month=current_month, start_date__year=current_year, state='filed'),
+ requests_pos.filter(start_date__month=current_month, start_date__year=current_year, state='filed')
+ )
+ )
+
+ reviewed_requests = list(
+ chain(
+ requests_CEX.filter(start_date__month=current_month, start_date__year=current_year, state='review'),
+ requests_monitoring.filter(start_date__month=current_month, start_date__year=current_year, state='review'),
+ requests_pos.filter(start_date__month=current_month, start_date__year=current_year, state='review')
+ )
+ )
+
+
return {
- 'requests': list(requests_CEX) + list(requests_monitoring) + list(requests_pos),
- 'filled_requests': list(requests_CEX.filter(state='filed')) + list(requests_monitoring.filter(state='filed')) + list(requests_pos.filter(state='filed')),
- 'reviewed_requests': list(requests_CEX.filter(state='review')) + list(requests_monitoring.filter(state='review')) + list(requests_pos.filter(state='review')),
+ 'requests': requests,
+ 'requests_month': requests_month,
+ 'filled_requests': filled_requests,
+ 'reviewed_requests': reviewed_requests,
'for_validate_requests': list(requests_CEX.filter(state__in=['pending', 'incomplete'])) + list(requests_monitoring.filter(state__in=['pending', 'incomplete'])) + list(requests_pos.filter(state__in=['pending', 'incomplete'])),
'leaders': leaders,
'managers': managers,
@@ -105,4 +155,257 @@ def get_requests(user):
-
+def export_requests(user):
+ groups = [group.name for group in user.groups.all()]
+ requests_CEX = CEXContractRequest.objects.none()
+ requests_monitoring = MonitoringContractRequest.objects.none()
+ requests_pos = ProvisionOfServicesContractRequest.objects.none()
+
+ if 'admin' in groups:
+ requests_CEX = CEXContractRequest.objects.all()
+ requests_monitoring = MonitoringContractRequest.objects.all()
+ requests_pos = ProvisionOfServicesContractRequest.objects.all()
+ elif 'leader' in groups:
+ requests_CEX = CEXContractRequest.objects.filter(leader_assigned_to=user.id)
+ requests_monitoring = MonitoringContractRequest.objects.filter(leader_assigned_to=user.id)
+ requests_pos = ProvisionOfServicesContractRequest.objects.filter(leader_assigned_to=user.id)
+ elif 'manager' in groups:
+ requests_CEX = CEXContractRequest.objects.filter(manager_assigned_to=user.id)
+ requests_monitoring = MonitoringContractRequest.objects.filter(manager_assigned_to=user.id)
+ requests_pos = ProvisionOfServicesContractRequest.objects.filter(manager_assigned_to=user.id)
+
+
+
+ wb = Workbook()
+
+ ws1 = wb.active
+ ws1.title = "Solicitudes de Contratación"
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ ]
+
+ ws1.append(headers)
+
+ for request in (list(requests_CEX) + list(requests_monitoring) + list(requests_pos)):
+ row_data = [
+ str(request.id),
+ request.start_date.strftime('%Y-%m-%d'),
+ request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if request.completion_date else None,
+ request.estimated_completion_date.strftime('%Y-%m-%d') if request.estimated_completion_date else None,
+ request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ request.state,
+ f'{request.manager_assigned_to.first_name} {request.manager_assigned_to.last_name}' if request.manager_assigned_to else 'sin asignar',
+ f'{request.leader_assigned_to.first_name} {request.leader_assigned_to.last_name}' if request.leader_assigned_to else 'sin asignar',
+ f'{request.created_by.first_name} {request.created_by.last_name}' if request.created_by else 'sin asignar',
+ ]
+ ws1.append(row_data)
+
+
+ ws2 = wb.create_sheet(title="CEX")
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ "Hiree Full Name",
+ "Hiree ID",
+ "Hiree Cellphone",
+ "Hiree Email",
+ "Cenco",
+ "Request Motive",
+ "Banking Entity",
+ "Bank Account Type",
+ "Bank Account Number",
+ "EPS",
+ "Pension Fund",
+ "ARL",
+ "Contract Value",
+ "Charge Account",
+ "RUT"
+ ]
+ ws2.append(headers)
+
+ for cex_request in requests_CEX:
+ row_data = [
+ str(cex_request.id),
+ cex_request.start_date.strftime('%Y-%m-%d'),
+ cex_request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if cex_request.completion_date else None,
+ cex_request.estimated_completion_date.strftime('%Y-%m-%d') if cex_request.estimated_completion_date else None,
+ cex_request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ cex_request.state,
+ f'{cex_request.manager_assigned_to.first_name} {cex_request.manager_assigned_to.last_name}' if cex_request.manager_assigned_to else 'sin asignar',
+ f'{cex_request.leader_assigned_to.first_name} {cex_request.leader_assigned_to.last_name}' if cex_request.leader_assigned_to else 'sin asignar',
+ f'{cex_request.created_by.first_name} {cex_request.created_by.last_name}' if cex_request.created_by else 'sin asignar',
+ cex_request.hiree_full_name,
+ cex_request.hiree_id,
+ cex_request.hiree_cellphone,
+ cex_request.hiree_email,
+ cex_request.cenco,
+ cex_request.request_motive,
+ cex_request.banking_entity,
+ cex_request.bank_account_type,
+ cex_request.bank_account_number,
+ cex_request.eps,
+ cex_request.pension_fund,
+ cex_request.arl,
+ cex_request.contract_value,
+ cex_request.charge_account,
+ cex_request.rut.url if cex_request.rut else ""
+ ]
+ ws2.append(row_data)
+
+ ws3 = wb.create_sheet(title="Monitorías")
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ "Cenco",
+ "Has Money in Cenco",
+ "Cenco Manager",
+ "Monitoring Type",
+ "Student Code",
+ "Student Full Name",
+ "Student ID",
+ "Student Email",
+ "Student Cellphone",
+ "Daviplata",
+ "Course or Project",
+ "Monitoring Description",
+ "Weekly Hours",
+ "Total Value to Pay",
+ "Is Unique Payment"
+ ]
+ ws3.append(headers)
+
+ for monitoring_request in requests_monitoring:
+ row_data = [
+ str(monitoring_request.id),
+ monitoring_request.start_date.strftime('%Y-%m-%d'),
+ monitoring_request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if monitoring_request.completion_date else None,
+ monitoring_request.estimated_completion_date.strftime('%Y-%m-%d') if monitoring_request.estimated_completion_date else None,
+ monitoring_request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ monitoring_request.state,
+ f'{monitoring_request.manager_assigned_to.first_name} {monitoring_request.manager_assigned_to.last_name}' if monitoring_request.manager_assigned_to else 'sin asignar',
+ f'{monitoring_request.leader_assigned_to.first_name} {monitoring_request.leader_assigned_to.last_name}' if monitoring_request.leader_assigned_to else 'sin asignar',
+ f'{monitoring_request.created_by.first_name} {monitoring_request.created_by.last_name}' if monitoring_request.created_by else 'sin asignar',
+ monitoring_request.cenco,
+ monitoring_request.has_money_in_cenco,
+ monitoring_request.cenco_manager,
+ monitoring_request.monitoring_type,
+ monitoring_request.student_code,
+ monitoring_request.student_full_name,
+ monitoring_request.student_id,
+ monitoring_request.student_email,
+ monitoring_request.student_cellphone,
+ monitoring_request.daviplata,
+ monitoring_request.course_or_proyect,
+ monitoring_request.monitoring_description,
+ monitoring_request.weekly_hours,
+ monitoring_request.total_value_to_pay,
+ monitoring_request.is_unique_payment
+ ]
+ ws3.append(row_data)
+
+ ws4 = wb.create_sheet(title="Honorarios")
+
+ headers = [
+ "ID",
+ "Start Date",
+ "Completion Date",
+ "Estimated Completion Date",
+ "Current State Start",
+ "State",
+ "Manager Assigned To",
+ "Leader Assigned To",
+ "Created By",
+ "Hiree Full Name",
+ "Hiree ID",
+ "Hiree Cellphone",
+ "Hiree Email",
+ "Cenco",
+ "Request Motive",
+ "Banking Entity",
+ "Bank Account Type",
+ "Bank Account Number",
+ "EPS",
+ "Pension Fund",
+ "ARL",
+ "Contract Value",
+ "Charge Account",
+ "RUT",
+ "Course Name",
+ "Period",
+ "Group",
+ "Intensity",
+ "Total Hours",
+ "Course Code",
+ "Students Quantity",
+ "Additional Hours"
+ ]
+
+ ws4.append(headers)
+
+ for post_request in requests_pos:
+ row_data = [
+ str(post_request.id),
+ post_request.start_date.strftime('%Y-%m-%d'),
+ post_request.completion_date.strftime('%Y-%m-%d %H:%M:%S') if post_request.completion_date else None,
+ post_request.estimated_completion_date.strftime('%Y-%m-%d') if post_request.estimated_completion_date else None,
+ post_request.current_state_start.strftime('%Y-%m-%d %H:%M:%S'),
+ post_request.state,
+ f'{post_request.manager_assigned_to.first_name} {post_request.manager_assigned_to.last_name}' if post_request.manager_assigned_to else 'sin asignar',
+ f'{post_request.leader_assigned_to.first_name} {post_request.leader_assigned_to.last_name}' if post_request.leader_assigned_to else 'sin asignar',
+ f'{post_request.created_by.first_name} {post_request.created_by.last_name}' if post_request.created_by else 'sin asignar',
+ post_request.hiree_full_name,
+ post_request.hiree_id,
+ post_request.hiree_cellphone,
+ post_request.hiree_email,
+ post_request.cenco,
+ post_request.request_motive,
+ post_request.banking_entity,
+ post_request.bank_account_type,
+ post_request.bank_account_number,
+ post_request.eps,
+ post_request.pension_fund,
+ post_request.arl,
+ post_request.contract_value,
+ post_request.charge_account,
+ post_request.rut.url if post_request.rut else "",
+ post_request.course_name,
+ post_request.period,
+ post_request.group,
+ post_request.intensity,
+ post_request.total_hours,
+ post_request.course_code,
+ post_request.students_quantity,
+ post_request.additional_hours
+ ]
+ ws4.append(row_data)
+
+ response = HttpResponse(content_type='application/ms-excel')
+ response['Content-Disposition'] = 'attachment; filename="solicitudes.xlsx"'
+ wb.save(response)
+
+ return response
\ No newline at end of file
diff --git a/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py b/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py
index 102bff4..32aad4e 100644
--- a/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py
+++ b/hiring_module/hiring_app/views/request_creation/cex_contract_request_view.py
@@ -2,12 +2,14 @@
from django.views.generic import CreateView
from hiring_app.forms import CEXContractRequestForm
from hiring_app.model import CEXContractRequest
+from hiring_app.model import ProvisionOfServicesContractRequest
from django.urls import reverse_lazy
from datetime import datetime, timedelta
from .utilities import utilities
from django.shortcuts import get_object_or_404
from django.core.exceptions import PermissionDenied
+
class CEXContractRequestView(CreateView):
model = CEXContractRequest
form_class = CEXContractRequestForm
@@ -20,6 +22,7 @@ def form_valid(self, form):
estimated_completion_date = datetime.now() + timedelta(days=30)
leader = utilities.findLeaderToAssign()
manager = utilities.findManagerToAssign()
+ form.instance.id_solicitant_name = self.request.user.first_name
form.instance.estimated_completion_date = estimated_completion_date
form.instance.created_by = current_user
form.instance.leader_assigned_to = leader
@@ -29,9 +32,9 @@ def form_valid(self, form):
cex_contract_request.create_snapshot()
cex_contract_request.save()
utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',
- current_user.email)
+ current_user.email)
return super().form_valid(form)
-
+
def form_invalid(self, form):
return self.render_to_response(self.get_context_data(form=form))
@@ -39,15 +42,20 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['actualgroup'] = 'external'
return context
-
-
+
def download_rut_file(request, idContract, *args, **kwargs):
# Get the rut and send it as a file
- model_instance = get_object_or_404(CEXContractRequest, id=idContract)
+ model_instance = None
+
+ if CEXContractRequest.objects.filter(id=idContract).exists():
+ model_instance = get_object_or_404(CEXContractRequest, id=idContract)
+ else:
+ model_instance = get_object_or_404(ProvisionOfServicesContractRequest, id=idContract)
if not request.user.has_perm('your_app.view_cexcontractrequest'):
- raise PermissionDenied("You don't have permission to download this file.")
-
+ raise PermissionDenied(
+ "You don't have permission to download this file.")
+
if not model_instance.rut:
raise Http404("The requested file does not exist.")
try:
@@ -55,6 +63,7 @@ def download_rut_file(request, idContract, *args, **kwargs):
except IOError as e:
raise IOError(f"Error reading file: {e}")
- response = HttpResponse(rut_file_data, content_type='application/octet-stream')
+ response = HttpResponse(
+ rut_file_data, content_type='application/octet-stream')
response['Content-Disposition'] = f'attachment; filename="{model_instance.rut.name}"'
- return response
\ No newline at end of file
+ return response
diff --git a/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py b/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py
index 56351c3..e77458c 100644
--- a/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py
+++ b/hiring_module/hiring_app/views/request_creation/monitoring_contract_request_view.py
@@ -27,8 +27,7 @@ def form_valid(self, form):
monitoring_contract_request.save()
- utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',
- current_user.email)
+ utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',current_user.email)
return super().form_valid(form)
def form_invalid(self, form):
diff --git a/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py b/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py
index 46da7d9..9f3bf0f 100644
--- a/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py
+++ b/hiring_module/hiring_app/views/request_creation/pos_contract_request_view.py
@@ -9,6 +9,7 @@
from django.shortcuts import get_object_or_404
from django.core.exceptions import PermissionDenied
+
class POSContractRequestView(CreateView):
model = ProvisionOfServicesContractRequest
form_class = ProvisionOfServicesContractRequestForm
@@ -21,6 +22,7 @@ def form_valid(self, form):
estimated_completion_date = datetime.now() + timedelta(days=30)
leader = utilities.findLeaderToAssign()
manager = utilities.findManagerToAssign()
+ form.instance.id_solicitant_name = self.request.user.first_name
form.instance.estimated_completion_date = estimated_completion_date
form.instance.created_by = current_user
form.instance.leader_assigned_to = leader
@@ -35,29 +37,31 @@ def form_valid(self, form):
field_name = key.replace('additionalFields-', '')
field_name = field_name.split('-')[0]
additional_fields[field_name] = value
- if(field_name == 'responsability'):
+ if (field_name == 'responsability'):
additional_fields['pos_contract_request'] = pos_contract_request
- course_schedule = CourseSchedule.objects.create_schedule(**additional_fields)
+ course_schedule = CourseSchedule.objects.create_schedule(
+ **additional_fields)
course_schedule.save()
additional_fields = {}
- utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',
- current_user.email)
+ utilities.send_email('Solicitud de contratación radicada', 'Estimado/a, su solicitud de contrato en el aplicativo del módulo de contratación de la unidad de servicios compartidos ha sido radicada satisfactoriamente',current_user.email)
return super().form_valid(form)
-
+
def form_invalid(self, form):
return self.render_to_response(self.get_context_data(form=form))
-
+
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['actualgroup'] = 'external'
return context
-
+
def download_rut_file(request, idContract, *args, **kwargs):
# Get the rut and send it as a file
- model_instance = get_object_or_404(ProvisionOfServicesContractRequest, id=idContract)
+ model_instance = get_object_or_404(
+ ProvisionOfServicesContractRequest, id=idContract)
if not request.user.has_perm('your_app.view_poscontractrequest'):
- raise PermissionDenied("You don't have permission to download this file.")
+ raise PermissionDenied(
+ "You don't have permission to download this file.")
if not model_instance.rut:
raise Http404("The requested file does not exist.")
@@ -66,6 +70,7 @@ def download_rut_file(request, idContract, *args, **kwargs):
except IOError as e:
raise IOError(f"Error reading file: {e}")
- response = HttpResponse(rut_file_data, content_type='application/octet-stream')
+ response = HttpResponse(
+ rut_file_data, content_type='application/octet-stream')
response['Content-Disposition'] = f'attachment; filename="{model_instance.rut.name}"'
- return response
\ No newline at end of file
+ return response
diff --git a/hiring_module/hiring_app/views/request_hiring/change_state.py b/hiring_module/hiring_app/views/request_hiring/change_state.py
index f95f18e..9ecd92b 100644
--- a/hiring_module/hiring_app/views/request_hiring/change_state.py
+++ b/hiring_module/hiring_app/views/request_hiring/change_state.py
@@ -33,8 +33,6 @@ def post(self, request, idContract):
contract_request = utilities.getContract(idContract)
new_state = request.POST.get('state')
reason = request.POST.get('reason')
- print(new_state)
- print(reason)
state_actions = {
'incomplete': {
'email_function': self.send_email_file
diff --git a/hiring_module/hiring_app/views/statistical_registers/statistics_view.py b/hiring_module/hiring_app/views/statistical_registers/statistics_view.py
index a746aea..2f662ba 100644
--- a/hiring_module/hiring_app/views/statistical_registers/statistics_view.py
+++ b/hiring_module/hiring_app/views/statistical_registers/statistics_view.py
@@ -5,11 +5,10 @@
from ..utilities import leader_or_admin_redirect_to_manager_statistics, get_manager_metrics, get_leader_metrics, get_average_duration
-
class StatisticsView(View):
template_name = 'statistical_registers/statistics.html'
- #@method_decorator(leader_or_admin_redirect_to_manager_statistics)
+ # @method_decorator(leader_or_admin_redirect_to_manager_statistics)
def dispatch(self, request, *args, **kwargs):
# Get the required metrics
@@ -19,6 +18,6 @@ def dispatch(self, request, *args, **kwargs):
group = {'actualgroup': 'other'}
if self.request.user.groups.first().name == 'admin':
group = {'actualgroup': 'admin'}
-
+
# Pass metrics as context to template
- return render(request, self.template_name, manager_metrics|leader_metrics|average_duration|group)
+ return render(request, self.template_name, manager_metrics | leader_metrics | average_duration | group)
diff --git a/hiring_module/hiring_app/views/utilities.py b/hiring_module/hiring_app/views/utilities.py
index 50d5585..a92ed19 100644
--- a/hiring_module/hiring_app/views/utilities.py
+++ b/hiring_module/hiring_app/views/utilities.py
@@ -50,7 +50,7 @@ def get_manager_metrics():
cex_requests = CEXContractRequest.objects.all()
monitoring_requests = MonitoringContractRequest.objects.all()
- pos_requests = ProvisionOfServicesContractRequest.objects.all()
+ pos_requests = ProvisionOfServicesContractRequest.objects.all()
# Initialize a defaultdict to store requests count for each date
requests_count_by_date = defaultdict(lambda: [0, 0, 0])
@@ -100,12 +100,16 @@ def get_manager_metrics():
) + pos_requests.filter(state='incomplete').count(
)
+ cancelled_requests = cex_requests.filter(state='cancelled').count(
+ ) + monitoring_requests.filter(state='cancelled').count(
+ ) + pos_requests.filter(state='cancelled').count(
+ )
data.append([(manager.first_name + ' ' + manager.last_name), approved_requests,
- review_requests, for_validate_requests])
+ review_requests, for_validate_requests,cancelled_requests])
- best_to_worse_manager.append([(manager.first_name + ' ' + manager.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests)])
+ best_to_worse_manager.append([(manager.first_name + ' ' + manager.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests,cancelled_requests)])
best_to_worse_manager = sorted(best_to_worse_manager, key=lambda x: x[1], reverse=True)
@@ -191,12 +195,17 @@ def get_leader_metrics():
) + pos_requests.filter(state='incomplete').count(
)
+ cancelled_requests = cex_requests.filter(state='cancelled').count(
+ ) + monitoring_requests.filter(state='cancelled').count(
+ ) + pos_requests.filter(state='cancelled').count(
+ )
+
data.append([(leader.first_name + ' ' + leader.last_name), approved_requests,
- review_requests, for_validate_requests])
+ review_requests, for_validate_requests,cancelled_requests])
- best_to_worse_leader.append([(leader.first_name + ' ' + leader.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests)])
+ best_to_worse_leader.append([(leader.first_name + ' ' + leader.last_name), quality_calculator(approved_requests, review_requests, for_validate_requests,cancelled_requests)])
best_to_worse_leader = sorted(best_to_worse_leader, key=lambda x: x[1], reverse=True)
@@ -212,13 +221,13 @@ def get_leader_metrics():
}
-def quality_calculator(aprobadas, en_revision, por_validar):
- total = aprobadas + en_revision + por_validar
+def quality_calculator(approved_requests, under_review_requests, for_validate_requests, cancelled_requests):
+ total = approved_requests + under_review_requests + for_validate_requests + cancelled_requests
if total != 0:
- porcentaje_aprobadas = (aprobadas / total) * 100
- porcentaje_aprobadas = round(porcentaje_aprobadas, 2)
- return porcentaje_aprobadas
+ quality = ((approved_requests + cancelled_requests)/ total) * 100
+ quality = round(quality, 2)
+ return quality
else:
return 0
@@ -229,7 +238,7 @@ def get_average_duration():
list(ProvisionOfServicesContractRequest.objects.filter(Q(state='filed') | Q(state='cancelled')))
)
- total_duration_seconds = sum((request.completion_date - timezone.make_aware(datetime.combine(request.start_date, datetime.min.time()), timezone.utc)).total_seconds() for request in approved_or_cancelled_requests if request.completion_date and request.start_date)
+ total_duration_seconds = sum((request.completion_date - timezone.make_aware(datetime.combine(request.start_date, datetime.min.time()))).total_seconds() for request in approved_or_cancelled_requests if request.completion_date and request.start_date)
total_count = len(approved_or_cancelled_requests)
total_avg_duration_seconds = total_duration_seconds / total_count if total_count > 0 else 0
@@ -262,6 +271,10 @@ def get_resolved_after_estimated_date():
return resolved_after_estimated_date_count
+
+
+
+
diff --git a/hiring_module/requirements.txt b/hiring_module/requirements.txt
index 96ffe06..029d66c 100644
--- a/hiring_module/requirements.txt
+++ b/hiring_module/requirements.txt
@@ -7,3 +7,4 @@ six == 1.16.0
sqlparse == 0.4.3
tzdata == 2022.7
selenium
+openpyxl
\ No newline at end of file
diff --git a/hiring_module/test_db.sqlite3 b/hiring_module/test_db.sqlite3
new file mode 100644
index 0000000..e69de29
+
-
+
{% endblock %}
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/__init__.py b/hiring_module/hiring_app/tests/functionality/__init__.py
index 2f90783..7cd3312 100644
--- a/hiring_module/hiring_app/tests/functionality/__init__.py
+++ b/hiring_module/hiring_app/tests/functionality/__init__.py
@@ -1,5 +1,5 @@
from .auth import *
-from .control_board import *
+from .left_panel import *
from .request_creation import *
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/admin_user/___init___.py b/hiring_module/hiring_app/tests/functionality/admin_user/___init___.py
deleted file mode 100644
index 5d96140..0000000
--- a/hiring_module/hiring_app/tests/functionality/admin_user/___init___.py
+++ /dev/null
@@ -1 +0,0 @@
-from .admin_user import AdminUserTest
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/admin_user/__init__.py b/hiring_module/hiring_app/tests/functionality/admin_user/__init__.py
new file mode 100644
index 0000000..1a781ed
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/admin_user/__init__.py
@@ -0,0 +1 @@
+from .admin_user import *
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py b/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py
index c076f3a..f13144a 100644
--- a/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py
+++ b/hiring_module/hiring_app/tests/functionality/admin_user/admin_user.py
@@ -22,7 +22,7 @@ def tearDownClass(cls):
super().tearDownClass()
- def test_add_user(self):
+ def test_external_to_manager(self):
self.selenium.get(self.live_server_url)
username_input = self.selenium.find_element(By.NAME,'id')
@@ -38,7 +38,7 @@ def test_add_user(self):
self.selenium.find_element(By.ID, 'UserList').click()
time.sleep(2)
- self.assertEqual('Panel de control', self.selenium.title)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
self.selenium.find_element(By.ID, 'addUser').click()
@@ -52,10 +52,69 @@ def test_add_user(self):
time.sleep(2)
- user = self.selenium.find_element(By.ID, '1106293874').text
+ user = self.selenium.find_element(By.ID, '1106293874_id').text
self.assertIn('1106293874', user)
+ def test_manager_to_leader(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'UserList').click()
+
+ time.sleep(2)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'roleSelect_1111539567').send_keys('leader')
+
+ time.sleep(2)
+
+ self.assertEqual('1111539567', self.selenium.find_element(By.ID, '1111539567_id').text)
+
+ select_element = self.selenium.find_element(By.ID, "roleSelect_1111539567")
+
+ selected_option = select_element.find_element(By.CSS_SELECTOR, "option:checked")
+
+ selected_value = selected_option.get_attribute("value")
+
+ self.assertEqual('leader', selected_value)
+
+ def test_leader_to_admin(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'UserList').click()
+
+ time.sleep(2)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
+
+ self.selenium.find_element(By.ID, 'roleSelect_1109185879').send_keys('administrator')
+
+ time.sleep(2)
+
+ self.assertEqual('1109185879', self.selenium.find_element(By.ID, '1109185879_id').text)
+
+ select_element = self.selenium.find_element(By.ID, "roleSelect_1109185879")
+
+ selected_option = select_element.find_element(By.CSS_SELECTOR, "option:checked")
+
+ selected_value = selected_option.get_attribute("value")
+
+ self.assertEqual('admin', selected_value)
def test_delete_user(self):
@@ -75,15 +134,13 @@ def test_delete_user(self):
self.selenium.find_element(By.ID, 'UserList').click()
time.sleep(2)
- self.assertEqual('Panel de control', self.selenium.title)
+ self.assertEqual('Lista de usuarios', self.selenium.title)
self.selenium.find_element(By.ID, 'roleSelect_1109185879').send_keys('remove')
+
+ time.sleep(2)
-
- try:
- self.selenium.find_element(By.ID, 'addUser').click()
- except StaleElementReferenceException:
- self.selenium.find_element(By.ID, 'addUser').click()
+ self.selenium.find_element(By.ID, 'addUser').click()
self.assertEqual('1109185879', self.selenium.find_element(By.ID, '1109185879_id').text)
diff --git a/hiring_module/hiring_app/tests/functionality/auth/login.py b/hiring_module/hiring_app/tests/functionality/auth/login.py
index 883f639..b5ea3aa 100644
--- a/hiring_module/hiring_app/tests/functionality/auth/login.py
+++ b/hiring_module/hiring_app/tests/functionality/auth/login.py
@@ -65,3 +65,27 @@ def test_login_external_user(self):
password_input.send_keys(Keys.RETURN)
self.assertIn('Panel de control de usuario externo', self.selenium.title)
+
+ def test_login_wrong_password(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Log In', self.selenium.title)
+
+ def test_login_wrong_username(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('111607086')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Log In', self.selenium.title)
diff --git a/hiring_module/hiring_app/tests/functionality/control_board/__init__.py b/hiring_module/hiring_app/tests/functionality/control_board/__init__.py
deleted file mode 100644
index 1ab8cc0..0000000
--- a/hiring_module/hiring_app/tests/functionality/control_board/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from .control_board_external_user import ControlBoardExternalUser
diff --git a/hiring_module/hiring_app/tests/functionality/control_board/control_board_external_user.py b/hiring_module/hiring_app/tests/functionality/control_board/control_board_external_user.py
deleted file mode 100644
index 0bdec89..0000000
--- a/hiring_module/hiring_app/tests/functionality/control_board/control_board_external_user.py
+++ /dev/null
@@ -1,71 +0,0 @@
-from django.contrib.auth.models import User
-from django.contrib.staticfiles.testing import StaticLiveServerTestCase
-from selenium.webdriver.chrome.webdriver import WebDriver
-from selenium.webdriver.common.keys import Keys
-from selenium.webdriver.common.by import By
-
-class ControlBoardExternalUser(StaticLiveServerTestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
- cls.selenium = WebDriver()
- cls.selenium.implicitly_wait(10)
-
- @classmethod
- def tearDownClass(cls):
- cls.selenium.quit()
- super().tearDownClass()
-
-
- def test_get_form_monitoring(self):
- self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
- password_input = self.selenium.find_element(By.NAME, 'password')
- username_input.send_keys('1106293874')
- password_input.send_keys('mariagonzales123')
-
- password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_monitoring_contract')
-
- button_create_monitoring_contract.click()
-
-
- self.assertIn('Solicitudes de contratos de Monitoría', self.selenium.title)
-
-
- def test_get_form_cex(self):
- self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
- password_input = self.selenium.find_element(By.NAME, 'password')
- username_input.send_keys('1106293874')
- password_input.send_keys('mariagonzales123')
-
- password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_cex_contract')
-
- button_create_monitoring_contract.click()
-
-
- self.assertIn('Solicitudes de contratos CEX', self.selenium.title)
-
-
- def test_get_form_pos(self):
- self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
- password_input = self.selenium.find_element(By.NAME, 'password')
- username_input.send_keys('1106293874')
- password_input.send_keys('mariagonzales123')
-
- password_input.send_keys(Keys.RETURN)
-
- button_create_pos_contract = self.selenium.find_element(By.ID, 'create_pos_contract')
-
- button_create_pos_contract.click()
-
-
- self.assertIn('Solicitudes de contratos POS', self.selenium.title)
diff --git a/hiring_module/hiring_app/tests/functionality/left_panel/__init__.py b/hiring_module/hiring_app/tests/functionality/left_panel/__init__.py
new file mode 100644
index 0000000..aca00a3
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/left_panel/__init__.py
@@ -0,0 +1 @@
+from .left_panel_navitagion import *
diff --git a/hiring_module/hiring_app/tests/functionality/left_panel/left_panel_navitagion.py b/hiring_module/hiring_app/tests/functionality/left_panel/left_panel_navitagion.py
new file mode 100644
index 0000000..5795df0
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/left_panel/left_panel_navitagion.py
@@ -0,0 +1,98 @@
+from django.contrib.auth.models import User
+from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from selenium.webdriver.chrome.webdriver import WebDriver
+from selenium.webdriver.common.keys import Keys
+from selenium.webdriver.common.by import By
+from selenium.common.exceptions import NoSuchElementException
+
+class LeftPanelNavigation(StaticLiveServerTestCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.selenium = WebDriver()
+ cls.selenium.implicitly_wait(10)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.selenium.quit()
+ super().tearDownClass()
+
+
+ def test_admin_redirections(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+
+ password_input.send_keys(Keys.RETURN)
+
+ user_list_button = self.selenium.find_element(By.ID, 'UserList')
+
+ user_list_button.click()
+
+
+ self.assertIn('Lista de usuarios', self.selenium.title)
+
+ control_pannel_button = self.selenium.find_element(By.ID, 'ControlPanel')
+
+ control_pannel_button.click()
+
+ self.assertIn('Panel de control', self.selenium.title)
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ def test_leader_redirections(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1107838593')
+ password_input.send_keys('alejandrolondono123')
+
+
+ password_input.send_keys(Keys.RETURN)
+
+ with self.assertRaises(NoSuchElementException):
+ user_list_button = self.selenium.find_element(By.ID, 'UserList')
+
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ control_pannel_button = self.selenium.find_element(By.ID, 'ControlPanel')
+
+ control_pannel_button.click()
+
+ self.assertIn('Panel de control', self.selenium.title)
+
+ def test_external_user_redirections(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ with self.assertRaises(NoSuchElementException):
+ user_list_button = self.selenium.find_element(By.ID, 'UserList')
+
+ with self.assertRaises(NoSuchElementException):
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ control_pannel_button = self.selenium.find_element(By.ID, 'ControlPanel')
+
+ control_pannel_button.click()
+
+ self.assertIn('Panel de control', self.selenium.title)
diff --git a/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py b/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py
index ea391c8..88d5b39 100644
--- a/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py
+++ b/hiring_module/hiring_app/tests/functionality/request_creation/create_hiring_request.py
@@ -5,155 +5,290 @@
from selenium.webdriver.common.by import By
import os
import time
+from selenium.common.exceptions import NoSuchElementException
+
class CreateHiringRequest(StaticLiveServerTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.selenium = WebDriver()
- cls.selenium.implicitly_wait(10)
+ cls.selenium.implicitly_wait(10)
@classmethod
def tearDownClass(cls):
cls.selenium.quit()
super().tearDownClass()
-
def test_create_form_monitoring(self):
self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
password_input = self.selenium.find_element(By.NAME, 'password')
username_input.send_keys('1106293874')
password_input.send_keys('mariagonzales123')
-
+
password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_monitoring_contract')
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_monitoring_contract')
button_create_monitoring_contract.click()
self.selenium.find_element(By.NAME, 'cenco').send_keys('Cenco ABC')
- self.selenium.find_element(By.NAME, 'cenco_manager').send_keys('John Doe')
- monitoring_type = self.selenium.find_element(By.NAME, 'monitoring_type')
- monitoring_type.send_keys('Academic')
+ self.selenium.find_element(
+ By.NAME, 'cenco_manager').send_keys('John Doe')
+ monitoring_type = self.selenium.find_element(
+ By.NAME, 'monitoring_type')
+ monitoring_type.send_keys('Academico')
self.selenium.find_element(By.NAME, 'student_code').send_keys('123456')
- self.selenium.find_element(By.NAME, 'student_full_name').send_keys('Jane Smith')
+ self.selenium.find_element(
+ By.NAME, 'student_full_name').send_keys('Jane Smith')
self.selenium.find_element(By.NAME, 'student_id').send_keys('7890123')
- self.selenium.find_element(By.NAME, 'student_email').send_keys('jane@example.com')
- self.selenium.find_element(By.NAME, 'student_cellphone').send_keys('1234567890')
- self.selenium.find_element(By.NAME, 'daviplata').send_keys('Daviplata XYZ')
- self.selenium.find_element(By.NAME, 'course_or_proyect').send_keys('Project ABC')
- self.selenium.find_element(By.NAME, 'monitoring_description').send_keys('Description of monitoring')
- self.selenium.find_element(By.NAME, 'weekly_hours').send_keys('10') # Assuming 10 weekly hours
- self.selenium.find_element(By.NAME, 'total_value_to_pay').send_keys('100000') # Assuming total value
+ self.selenium.find_element(
+ By.NAME, 'student_email').send_keys('jane@example.com')
+ self.selenium.find_element(
+ By.NAME, 'student_cellphone').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'daviplata').send_keys('Daviplata XYZ')
+ self.selenium.find_element(
+ By.NAME, 'course_or_proyect').send_keys('Project ABC')
+ self.selenium.find_element(By.NAME, 'monitoring_description').send_keys(
+ 'Description of monitoring')
+ self.selenium.find_element(By.NAME, 'weekly_hours').send_keys(
+ '10') # Assuming 10 weekly hours
+ self.selenium.find_element(By.NAME, 'total_value_to_pay').send_keys(
+ '100000') # Assuming total value
self.selenium.find_element(By.NAME, 'is_unique_payment').click()
- self.selenium.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
time.sleep(5)
- notification_message = self.selenium.find_element(By.ID, "notificationMessage").text
-
- self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
- self.assertIn('Solicitudes de contratos de Monitoría', self.selenium.title)
+ self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ self.assertIn('Solicitudes de contratos de Monitoría',
+ self.selenium.title)
def test_create_form_cex(self):
self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
password_input = self.selenium.find_element(By.NAME, 'password')
username_input.send_keys('1106293874')
password_input.send_keys('mariagonzales123')
-
+
password_input.send_keys(Keys.RETURN)
-
- button_create_monitoring_contract = self.selenium.find_element(By.ID, 'create_cex_contract')
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_cex_contract')
button_create_monitoring_contract.click()
-
- self.selenium.find_element(By.NAME, 'solicitant_name').send_keys('John Doe')
- self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys('Faculty of Engineering')
- self.selenium.find_element(By.NAME, 'hiree_full_name').send_keys('Jane Smith')
+
+ self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys(
+ 'Faculty of Engineering')
+ self.selenium.find_element(
+ By.NAME, 'hiree_full_name').send_keys('Jane Smith')
self.selenium.find_element(By.NAME, 'hiree_id').send_keys('123456789')
- self.selenium.find_element(By.NAME, 'hiree_cellphone').send_keys('1234567890')
- self.selenium.find_element(By.NAME, 'hiree_email').send_keys('jane@example.com')
+ self.selenium.find_element(
+ By.NAME, 'hiree_cellphone').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'hiree_email').send_keys('jane@example.com')
self.selenium.find_element(By.NAME, 'cenco').send_keys('Cenco 123')
- self.selenium.find_element(By.NAME, 'request_motive').send_keys('Hiring new employee')
- self.selenium.find_element(By.NAME, 'banking_entity').send_keys('Bank of Example')
- bank_account_type = self.selenium.find_element(By.NAME, 'bank_account_type')
- bank_account_type.send_keys('Savings')
- self.selenium.find_element(By.NAME, 'bank_account_number').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'request_motive').send_keys('Hiring new employee')
+ self.selenium.find_element(
+ By.NAME, 'banking_entity').send_keys('Bank of Example')
+ bank_account_type = self.selenium.find_element(
+ By.NAME, 'bank_account_type')
+ bank_account_type.send_keys('Ahorros')
+ self.selenium.find_element(
+ By.NAME, 'bank_account_number').send_keys('1234567890')
self.selenium.find_element(By.NAME, 'eps').send_keys('EPS Company')
- self.selenium.find_element(By.NAME, 'pension_fund').send_keys('Pension Fund')
+ self.selenium.find_element(
+ By.NAME, 'pension_fund').send_keys('Pension Fund')
self.selenium.find_element(By.NAME, 'arl').send_keys('ARL Company')
- self.selenium.find_element(By.NAME, 'contract_value').send_keys('1000000')
- self.selenium.find_element(By.NAME, 'charge_account').send_keys('Charge account details')
- ruta_documento_pdf = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'documento.pdf')
+ self.selenium.find_element(
+ By.NAME, 'contract_value').send_keys('1000000')
+ self.selenium.find_element(By.NAME, 'charge_account').send_keys(
+ 'Charge account details')
+ ruta_documento_pdf = os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), 'documento.pdf')
- self.selenium.find_element(By.NAME, 'rut').send_keys(ruta_documento_pdf)
+ self.selenium.find_element(
+ By.NAME, 'rut').send_keys(ruta_documento_pdf)
- self.selenium.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
time.sleep(2)
- notification_message = self.selenium.find_element(By.ID, "notificationMessage").text
-
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
+
self.assertEqual(notification_message, "La solicitud fue exitosa.")
self.assertIn('Solicitudes de contratos CEX', self.selenium.title)
-
def test_create_form_pos(self):
self.selenium.get(self.live_server_url)
-
- username_input = self.selenium.find_element(By.NAME,'id')
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
password_input = self.selenium.find_element(By.NAME, 'password')
username_input.send_keys('1106293874')
password_input.send_keys('mariagonzales123')
-
+
password_input.send_keys(Keys.RETURN)
-
- button_create_pos_contract = self.selenium.find_element(By.ID, 'create_pos_contract')
+
+ button_create_pos_contract = self.selenium.find_element(
+ By.ID, 'create_pos_contract')
button_create_pos_contract.click()
-
- self.selenium.find_element(By.NAME, 'solicitant_name').send_keys('John Doe')
- self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys('Faculty of Engineering')
- self.selenium.find_element(By.NAME, 'hiree_full_name').send_keys('Jane Smith')
+
+ self.selenium.find_element(By.NAME, 'solicitant_faculty').send_keys(
+ 'Faculty of Engineering')
+ self.selenium.find_element(
+ By.NAME, 'hiree_full_name').send_keys('Jane Smith')
self.selenium.find_element(By.NAME, 'hiree_id').send_keys('123456789')
- self.selenium.find_element(By.NAME, 'hiree_cellphone').send_keys('1234567890')
- self.selenium.find_element(By.NAME, 'hiree_email').send_keys('jane@example.com')
+ self.selenium.find_element(
+ By.NAME, 'hiree_cellphone').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'hiree_email').send_keys('jane@example.com')
self.selenium.find_element(By.NAME, 'cenco').send_keys('Cenco 123')
- self.selenium.find_element(By.NAME, 'request_motive').send_keys('Hiring new employee')
- self.selenium.find_element(By.NAME, 'banking_entity').send_keys('Bank of Example')
- bank_account_type = self.selenium.find_element(By.NAME, 'bank_account_type')
- bank_account_type.send_keys('Savings')
- self.selenium.find_element(By.NAME, 'bank_account_number').send_keys('1234567890')
+ self.selenium.find_element(
+ By.NAME, 'request_motive').send_keys('Hiring new employee')
+ self.selenium.find_element(
+ By.NAME, 'banking_entity').send_keys('Bank of Example')
+ bank_account_type = self.selenium.find_element(
+ By.NAME, 'bank_account_type')
+ bank_account_type.send_keys('Ahorros')
+ self.selenium.find_element(
+ By.NAME, 'bank_account_number').send_keys('1234567890')
self.selenium.find_element(By.NAME, 'eps').send_keys('EPS Company')
- self.selenium.find_element(By.NAME, 'pension_fund').send_keys('Pension Fund')
+ self.selenium.find_element(
+ By.NAME, 'pension_fund').send_keys('Pension Fund')
self.selenium.find_element(By.NAME, 'arl').send_keys('ARL Company')
- self.selenium.find_element(By.NAME, 'contract_value').send_keys('1000000')
- self.selenium.find_element(By.NAME, 'charge_account').send_keys('Charge account details')
- ruta_documento_pdf = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'documento.pdf')
+ self.selenium.find_element(
+ By.NAME, 'contract_value').send_keys('1000000')
+ self.selenium.find_element(By.NAME, 'charge_account').send_keys(
+ 'Charge account details')
+ ruta_documento_pdf = os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), 'documento.pdf')
- self.selenium.find_element(By.NAME, 'rut').send_keys(ruta_documento_pdf)
- self.selenium.find_element(By.NAME, 'course_name').send_keys('Computer Science')
+ self.selenium.find_element(
+ By.NAME, 'rut').send_keys(ruta_documento_pdf)
+ self.selenium.find_element(
+ By.NAME, 'course_name').send_keys('Computer Science')
self.selenium.find_element(By.NAME, 'period').send_keys('2024 Spring')
self.selenium.find_element(By.NAME, 'group').send_keys('Group A')
self.selenium.find_element(By.NAME, 'intensity').send_keys('20')
self.selenium.find_element(By.NAME, 'total_hours').send_keys('40')
self.selenium.find_element(By.NAME, 'course_code').send_keys('CS101')
- self.selenium.find_element(By.NAME, 'students_quantity').send_keys('30')
+ self.selenium.find_element(
+ By.NAME, 'students_quantity').send_keys('30')
self.selenium.find_element(By.NAME, 'additional_hours').send_keys('10')
- self.selenium.find_element(By.ID, 'add-fields-btn').click()
- additional_fields = self.selenium.find_elements(By.XPATH, '//div[@id="additionalFields"]')
+ additional_fields = self.selenium.find_elements(
+ By.XPATH, '//div[@id="additionalFields"]')
for field in additional_fields:
- field.find_element(By.NAME, 'additionalFields-date').send_keys('2024-05-04')
- field.find_element(By.NAME, 'additionalFields-start_time').send_keys('08:001') # 1 para AM
- field.find_element(By.NAME, 'additionalFields-end_time').send_keys('12:002') # 2 para PM
- field.find_element(By.NAME, 'additionalFields-room').send_keys('Room 101')
- field.find_element(By.NAME, 'additionalFields-responsability').send_keys('Teaching')
+ field.find_element(
+ By.CSS_SELECTOR, "[name^='additionalFields-date']").send_keys('2024-05-04')
+ field.find_element(
+ # 1 para AM
+ By.CSS_SELECTOR, "[name^='additionalFields-start_time']").send_keys('08:001')
+ field.find_element(
+ # 2 para PM
+ By.CSS_SELECTOR, "[name^='additionalFields-end_time']").send_keys('12:002')
+ field.find_element(
+ By.CSS_SELECTOR, "[name^='additionalFields-room']").send_keys('101D')
+ field.find_element(
+ By.CSS_SELECTOR, "[name^='additionalFields-responsability']").send_keys('Teaching')
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+ time.sleep(4)
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
+
+ self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ self.assertIn('Solicitudes de contratos POS', self.selenium.title)
+
+ def test_create_form_monitoring_wrong_data(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_monitoring_contract')
- self.selenium.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
+ button_create_monitoring_contract.click()
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+
time.sleep(2)
- notification_message = self.selenium.find_element(By.ID, "notificationMessage").text
+
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage")
- self.assertEqual(notification_message, "La solicitud fue exitosa.")
+ self.assertEqual(notification_message.text, "")
+
+ self.assertIn('Solicitudes de contratos de Monitoría',
+ self.selenium.title)
+
+ def test_create_form_cex_wrong_data(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ button_create_monitoring_contract = self.selenium.find_element(
+ By.ID, 'create_cex_contract')
+
+ button_create_monitoring_contract.click()
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+
+ time.sleep(2)
+
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage")
+
+ self.assertEqual(notification_message.text, "")
+
+ self.assertIn('Solicitudes de contratos CEX', self.selenium.title)
+
+ def test_create_form_pos_wrong_data(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME, 'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1106293874')
+ password_input.send_keys('mariagonzales123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ button_create_pos_contract = self.selenium.find_element(
+ By.ID, 'create_pos_contract')
+
+ button_create_pos_contract.click()
+
+ self.selenium.find_element(
+ By.CSS_SELECTOR, 'button[type="submit"]').click()
+
+ time.sleep(2)
+
+ notification_message = self.selenium.find_element(
+ By.ID, "notificationMessage").text
+
+ self.assertEqual(notification_message, "")
+
self.assertIn('Solicitudes de contratos POS', self.selenium.title)
+
diff --git a/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py b/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py
index 706144e..883dce8 100644
--- a/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py
+++ b/hiring_module/hiring_app/tests/functionality/request_hiring/request_hiring.py
@@ -18,6 +18,149 @@ def tearDownClass(cls):
cls.selenium.quit()
super().tearDownClass()
+ def test_search_request_hiring_by_id(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ search_input.send_keys(id)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_solicitant(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ solicitant = first_result.find_element(By.XPATH, './td[2]').text
+
+ search_input.send_keys(solicitant)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_state(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ state = "Pendiente"
+
+ search_input.send_keys(state)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_date(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+ id = first_result.find_element(By.XPATH, './td[1]').text
+
+ date = first_result.find_element(By.XPATH, './td[6]').text
+
+ search_input.send_keys(date)
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn(id, self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]/td[1]').text)
+
+ def test_search_request_hiring_by_wrong_id(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys('abcdef-abcdef-abcdef')
+
+ search_input.send_keys(Keys.RETURN)
+
+ self.assertIn('No matching records found', self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr/td').text)
+
+ def test_access_request_hiring(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+
def test_request_hiring_assing_leader(self):
self.selenium.get(self.live_server_url)
@@ -79,9 +222,64 @@ def test_request_hiring_assing_manager(self):
self.assertIn('La solicitud fue exitosa.', self.selenium.find_element(By.ID, 'notificationMessage').text)
+ def test_request_hiring_change_status_pending_review_filled(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
- def test_request_hiring_change_status(self):
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
+ select.select_by_index(1)
+
+
+ time.sleep(2)
+
+ self.assertIn('50%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ with self.assertRaises(NotImplementedError):
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(2)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(3)
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ def test_request_hiring_change_status_pending_incomplete_cancelled(self):
self.selenium.get(self.live_server_url)
username_input = self.selenium.find_element(By.NAME,'id')
@@ -92,6 +290,12 @@ def test_request_hiring_change_status(self):
password_input.send_keys(Keys.RETURN)
self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
@@ -105,17 +309,148 @@ def test_request_hiring_change_status(self):
select = Select(select_element)
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
select.select_by_index(2)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ time.sleep(2)
+
+ self.assertIn('75%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(4)
+
self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+
+ def test_request_hiring_change_status_pending_incomplete_review_cancelled(self):
+ self.selenium.get(self.live_server_url)
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
- self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Save changes"]').click()
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
- time.sleep(2)
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
+
+ with self.assertRaises(NotImplementedError):
+ select.select_by_index(3)
+
+ select.select_by_index(2)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
self.assertIn('75%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+ with self.assertRaises(NotImplementedError):
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(3)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(1)
+
+ self.assertIn('50%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ select.select_by_index(4)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
+
+ def test_request_hiring_change_status_pending_cancelled(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ search_input = self.selenium.find_element(By.CSS_SELECTOR, 'input[type="search"]')
+
+ search_input.send_keys("Pendiente")
+
+ search_input.send_keys(Keys.RETURN)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.ID, 'stateSelect')
+
+ select = Select(select_element)
+
+ # 1 = review
+ # 2 = incomplete
+ # 3 = Filed
+ # 4 = Cancelled
+
+ select.select_by_index(4)
+
+ self.selenium.find_element(By.NAME, 'reason').send_keys("Hola")
+
+ self.selenium.find_element(By.XPATH, '//input[@type="submit" and @value="Enviar"]').click()
+
+ self.assertIn('100%', self.selenium.find_element(By.ID, 'ProgressBar').text)
def test_request_hiring_comment(self):
@@ -180,6 +515,4 @@ def test_request_hiring_snapshot(self):
info = self.selenium.find_element(By.ID, 'pending').text
- print(info)
-
self.assertIn('Estado de la contratacion:\npending', info)
diff --git a/hiring_module/hiring_app/tests/functionality/statistics/__init__.py b/hiring_module/hiring_app/tests/functionality/statistics/__init__.py
new file mode 100644
index 0000000..a7d4d95
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/statistics/__init__.py
@@ -0,0 +1 @@
+from .statistics import *
\ No newline at end of file
diff --git a/hiring_module/hiring_app/tests/functionality/statistics/statistics.py b/hiring_module/hiring_app/tests/functionality/statistics/statistics.py
new file mode 100644
index 0000000..441113a
--- /dev/null
+++ b/hiring_module/hiring_app/tests/functionality/statistics/statistics.py
@@ -0,0 +1,172 @@
+from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from selenium.webdriver.chrome.webdriver import WebDriver
+from selenium.webdriver.common.keys import Keys
+from selenium.webdriver.common.by import By
+from datetime import datetime
+from selenium.webdriver.support.select import Select
+import time
+
+class StatisticsTest(StaticLiveServerTestCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.selenium = WebDriver()
+ cls.selenium.implicitly_wait(10)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.selenium.quit()
+ super().tearDownClass()
+
+ def test_date_range_statistics(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ time.sleep(2)
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ # Get the current date
+ current_date = datetime.now().strftime('%m/%d/%Y')
+
+ # Send the current date to the start_date field
+ start_date = self.selenium.find_element(By.ID, 'start_date')
+ start_date.send_keys(current_date)
+
+ # Send the current date to the end_date field
+ end_date = self.selenium.find_element(By.ID, 'end_date')
+ end_date.send_keys(current_date)
+
+ contratos_cex = self.selenium.find_element(By.ID, 'contratos_cex').text
+ self.assertIn('4', contratos_cex)
+
+ def test_leader_statistics(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ time.sleep(2)
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.NAME, 'leader')
+
+ select = Select(select_element)
+
+ select.select_by_index(1)
+
+ time.sleep(2)
+
+ self.assertIn('La solicitud fue exitosa.', self.selenium.find_element(By.ID, 'notificationMessage').text)
+
+ notificationCloseBtn = self.selenium.find_element(By.ID, 'notificationCloseBtn')
+
+ notificationCloseBtn.click()
+
+ time.sleep(2)
+
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ time.sleep(2)
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+ select_element = self.selenium.find_element(By.ID, "data_leader_select")
+
+ select = Select(select_element)
+
+ select.select_by_index(0)
+
+ solicitudes_por_validar_leader = self.selenium.find_element(By.ID, 'solicitudes_por_validar_leader').text
+
+ self.assertIn('1', solicitudes_por_validar_leader)
+
+ time.sleep(2)
+
+ def test_manager_statistics(self):
+ self.selenium.get(self.live_server_url)
+
+ username_input = self.selenium.find_element(By.NAME,'id')
+ password_input = self.selenium.find_element(By.NAME, 'password')
+ username_input.send_keys('1116070867')
+ password_input.send_keys('juandiaz123')
+
+ password_input.send_keys(Keys.RETURN)
+
+ self.assertIn('Panel de control de Administrador', self.selenium.title)
+
+ first_result = self.selenium.find_element(By.XPATH, '//table[@id="dataTable"]/tbody/tr[1]')
+
+
+ first_cell_text = first_result.find_element(By.XPATH, './td[1]').click()
+
+ time.sleep(2)
+
+ self.assertIn('Solicitud de contratación de', self.selenium.find_element(By.ID, 'titleRequestHiring').text)
+
+ select_element = self.selenium.find_element(By.NAME, 'manager')
+
+ select = Select(select_element)
+
+ select.select_by_index(1)
+
+ time.sleep(2)
+
+ self.assertIn('La solicitud fue exitosa.', self.selenium.find_element(By.ID, 'notificationMessage').text)
+
+ notificationCloseBtn = self.selenium.find_element(By.ID, 'notificationCloseBtn')
+
+ notificationCloseBtn.click()
+
+ time.sleep(2)
+
+ statistics_button = self.selenium.find_element(By.ID, 'Statistics')
+
+ statistics_button.click()
+
+ time.sleep(2)
+
+ self.assertIn('Estadísticas', self.selenium.title)
+
+
+ select_element = self.selenium.find_element(By.ID, "data_manager_select")
+
+ select = Select(select_element)
+
+ select.select_by_index(0)
+
+ solicitudes_por_validar_leader = self.selenium.find_element(By.ID, 'solicitudes_por_validar_manager').text
+
+ self.assertIn('1', solicitudes_por_validar_leader)
+
+
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/urls.py b/hiring_module/hiring_app/urls.py
index a99599b..644bb0c 100644
--- a/hiring_module/hiring_app/urls.py
+++ b/hiring_module/hiring_app/urls.py
@@ -10,6 +10,7 @@
from hiring_app.views.control_board.administrator_user_list_view import AdministratorUserListView
from hiring_app.views.control_board.add_user_view import AddUserView
from hiring_app.views.statistical_registers.statistics_view import StatisticsView
+from hiring_app.views.control_board.export_requests_view import ExportRequestsView
app_name = 'hiring_app'
@@ -43,5 +44,6 @@
path('download_rut/
+
+
diff --git a/hiring_module/hiring_app/templates/request_hiring/pos_information.html b/hiring_module/hiring_app/templates/request_hiring/pos_information.html
index 1dc2aba..c68c6cc 100644
--- a/hiring_module/hiring_app/templates/request_hiring/pos_information.html
+++ b/hiring_module/hiring_app/templates/request_hiring/pos_information.html
@@ -1,244 +1,425 @@
-
+
+
+ + Información del financiera +
+
-
-
-
+
+
+
+
+
+
-
+
+
+Descripcion | -Datos | -
---|---|
- Nombre Completo del Estudiante
- El nombre completo del estudiante.
- |
- {{ contract_request.student_full_name }} | -
- ID del Estudiante
- El identificador único asignado al
- estudiante.
- |
- {{ contract_request.student_id }} | -
- Número de Teléfono del Estudiante
- El número de teléfono del estudiante.
- |
- {{ contract_request.student_cellphone }} | -
- Correo Electrónico del Estudiante
- El correo electrónico de contacto del
- estudiante.
- |
- {{ contract_request.student_email }} | -
- Daviplata
- El número de cuenta Daviplata del
- estudiante.
- |
- {{ contract_request.daviplata }} | -
- Curso o Proyecto
- El curso o proyecto en el que participa el
- estudiante.
- |
- {{ contract_request.course_or_project }} | -
- Descripción de la Monitoria
- Una descripción de la actividad de monitoreo
- del estudiante.
- |
- {{ contract_request.monitoring_description }} | -
- Horas Semanales
- El número de horas que el estudiante
- trabajará por semana.
- |
- {{ contract_request.weekly_hours }} | -
- Valor Total a Pagar
- El valor total que se pagará al estudiante.
-
- |
- {{ contract_request.total_value_to_pay }} | -
- Es Pago Único
- Indica si el pago es único o recurrente.
-
- |
- {{ contract_request.is_unique_payment }} | -
- Tiene Dinero en Cenco
- Indica si el estudiante tiene dinero
- disponible en el cenco.
- |
- {{ contract_request.has_money_in_cenco }} | -
- Gerente de Cenco
- El gerente responsable del cenco.
- |
- {{ contract_request.cenco_manager }} | -
- Tipo de Monitoria
- El tipo de actividad de monitoreo.
- |
- {{ contract_request.monitoring_type }} | -
- Código del Estudiante
- El código asignado al estudiante.
- |
- {{ contract_request.student_code }} | -
- Daviplata
- El número de cuenta Daviplata del
- estudiante.
- |
- {{ contract_request.daviplata }} | -
+ Cenco
+
+ CENCO asignado.
+
+ |
+ {{ contract_request.cenco }} | +
+ Administrador del cenco
+
+ Administrador del cenco asignado.
+
+ |
+ + {{ contract_request.cenco_manager }} + | +
+ Daviplata
+
+ Num de Daviplata del estudiante.
+
+ |
+ + {{ contract_request.daviplata }} + | +
+ Valor total a pagar
+
+ Valor en total del pago.
+
+ |
+ + {{ contract_request.total_value_to_pay }} + | +
+ Hora semanales
+
+ {{ contract_request.weekly_hours }}
+
+ |
+
+ Es pago unico?
+
+ {% if contract_request.is_unique_payment %} Sí {% else %} No
+ {% endif %}
+
+ |
+
+
\ No newline at end of file
+
+
+
-
+
+
+ + Información de la monitoria +
+
+
+
+
+
+
+ Tipo de Monitoria
+
+ El tipo de actividad de monitoreo.
+
+ |
+ + {{ contract_request.monitoring_type }} + | +
+ Curso o Proyecto
+
+ El curso o proyecto en el que participa el estudiante.
+
+ |
+ + {{ contract_request.course_or_project }} + | +
+ Descripción de la Monitoria
+
+ Una descripción de la actividad de monitoreo del estudiante.
+
+ |
+ + {{ contract_request.monitoring_description }} + | +
-
-
-
-
-
+
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html
index 55f4fb2..90f10e2 100644
--- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html
+++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_manager_quality.html
@@ -3,8 +3,8 @@
-
+
- var dailySelect = document.getElementById('data_select');
+
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/hiring_module/hiring_app/templates/statistical_registers/statistics.html b/hiring_module/hiring_app/templates/statistical_registers/statistics.html
index d21caf1..c1b28c3 100644
--- a/hiring_module/hiring_app/templates/statistical_registers/statistics.html
+++ b/hiring_module/hiring_app/templates/statistical_registers/statistics.html
@@ -23,28 +23,25 @@
-
-
diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_daily_requests.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_daily_requests.html
deleted file mode 100644
index 726e9dc..0000000
--- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_daily_requests.html
+++ /dev/null
@@ -1,77 +0,0 @@
-{% load static %}
-
-
-
-
-
+Descripcion | -Datos | -
---|---|
- Nombre Completo del Contratado
- El nombre completo de la persona contratada.
-
- |
- {{ contract_request.hiree_full_name }} | -
- ID del Contratado
- El identificador único asignado al
- contratado.
-
- |
- {{ contract_request.hiree_id }} | -
- Número de Teléfono del Contratado
- El número de teléfono del contratado.
- |
- {{ contract_request.hiree_cellphone }} | -
- Correo Electrónico del Contratado
- El correo electrónico de contacto del
- contratado.
- |
- {{ contract_request.hiree_email }} | -
- Cenco
- Centro de costos asignado al contratado.
-
- |
- {{ contract_request.cenco }} | -
- Motivo de la Solicitud
- El motivo por el cual se realiza la
- solicitud.
-
- |
- {{ contract_request.request_motive }} | -
- Entidad Bancaria
- La entidad bancaria a la que está asociada
- la
- cuenta bancaria.
- |
- {{ contract_request.banking_entity }} | -
- Tipo de Cuenta Bancaria
- El tipo de cuenta bancaria del contratado.
-
- |
- {{ contract_request.get_bank_account_type_display }} | -
- Número de Cuenta Bancaria
- El número de cuenta bancaria del contratado.
-
- |
- {{ contract_request.bank_account_number }} | -
- EPS
- La Entidad Promotora de Salud del
- contratado.
-
- |
- {{ contract_request.eps }} | -
- Fondo de Pensiones
- El fondo de pensiones del contratado.
- |
- {{ contract_request.pension_fund }} | -
- ARL
- La Administradora de Riesgos Laborales del
- contratado.
- |
- {{ contract_request.arl }} | -
- Valor del Contrato
- El valor total del contrato.
- |
- {{ contract_request.contract_value }} | -
- Cuenta de Cobro
- La cuenta bancaria a la que se realizarán
- los
- pagos correspondientes.
- |
- {{ contract_request.charge_account }} | -
- Descargar - Archivo RUT - | -|
- Nombre de curso
- El nombre de curso del contrato.
- |
- {{ contract_request.course_name }} | -
- Periodo
- El periodo del curso.
- |
- {{ contract_request.period }} | -
- Grupo
- El grupo del curso.
- |
- {{ contract_request.group }} | -
- Intensidad horaria
- La intensidad horaria de las clases del curso.
- |
- {{ contract_request.intensity }} | -
- Horas totales
- La cantidad de horas totales del curso.
- |
- {{ contract_request.total_hours }} | -
- Codigo del curso
- El codigo del curso.
- |
- {{ contract_request.course_code }} | -
- Cantidad de estudiantes
- La cantidad de estudiantes del curso.
- |
- {{ contract_request.students_quantity }} | -
- Horas adicionales
- Las horas adicionales del curso.
- |
- {{ contract_request.additional_hours }} | -
- Clase
- |
- |
- Fecha
- La fecha de la clase.
- |
- {{ schedule.date }} | -
- Hora de inicio
- La hora de inicio de la clase.
- |
- {{ schedule.start_time }} | -
- Hora de fin
- La hora de fin de la clase.
- |
- {{ schedule.end_time }} | -
- Salón
- El salón de la clase.
- |
- {{ schedule.room }} | -
- Responsabilidad
- Codigo de la responsabilidad de la clase.
- |
- {{ schedule.responsability }} | -
+ Solicitudes de contratos de CEX +
+
+
+
+
+
+
+
\ No newline at end of file
+
+
+
-
+
+
+ + Información del contratado +
+
+
+
+
+
+ Nombre Completo del Contratado
+
+ El nombre completo de la persona contratada.
+
+ |
+ + {{ contract_request.hiree_full_name }} + | +
+ ID del Contratado
+
+ El identificador único asignado al contratado.
+
+ |
+ {{ contract_request.hiree_id }} | +
+ Número de Teléfono del Contratado
+
+ El número de teléfono del contratado.
+
+ |
+ + {{ contract_request.hiree_cellphone }} + | +
+ Correo Electrónico del Contratado
+
+ El correo electrónico de contacto del contratado.
+
+ |
+ + {{ contract_request.hiree_email }} + | +
+ EPS
+
+ La Entidad Promotora de Salud del contratado.
+
+ |
+ {{ contract_request.eps }} | +
+ ARL
+
+ La Administradora de Riesgos Laborales del contratado.
+
+ |
+ {{ contract_request.arl }} | +
+
+
+
+
+
+
+
+
+ + Información del financiera +
+
+
+
+
+
+
+ Cenco
+
+ Centro de costos asignado al contratado.
+
+ |
+ {{ contract_request.cenco }} | +
+ Entidad Bancaria
+
+ La entidad bancaria a la que está asociada la cuenta bancaria.
+
+ |
+ + {{ contract_request.banking_entity }} + | +
+ + + Tipo de Cuenta Bancaria
+
+ El tipo de cuenta bancaria del contratado.
+
+ |
+
+ + + {{ contract_request.get_bank_account_type_display }} + |
+
+ + + Número de Cuenta Bancaria
+
+ El número de cuenta bancaria del contratado.
+
+ |
+
+ + + {{ contract_request.bank_account_number }} + |
+
+ + Fondo de Pensiones
+
+ El fondo de pensiones del contratado.
+
+ |
+
+ + + {{ contract_request.pension_fund }} + |
+
+
+
+
+
+
+
+
+
+
+ + Información legal del contrato +
+
+
+
+
+
+
+ Nombre de curso
+
+ El nombre de curso del contrato.
+
+ |
+ + {{ contract_request.course_name }} + | +
+ Periodo
+
+ El periodo del curso.
+
+ |
+ {{ contract_request.period }} | +
+ Grupo
+
+ El grupo del curso.
+
+ |
+ {{ contract_request.group }} | +
+ Intensidad horaria
+
+ La intensidad horaria de las clases del curso.
+
+ |
+ {{ contract_request.intensity }} | +
+ Horas totales
+
+ La cantidad de horas totales del curso.
+
+ |
+ + {{ contract_request.total_hours }} + | +
+ Codigo del curso
+
+ El codigo del curso.
+
+ |
+ + {{ contract_request.course_code }} + | +
+ Cantidad de estudiantes
+
+ La cantidad de estudiantes del curso.
+
+ |
+ + {{ contract_request.students_quantity }} + | +
+ Horas adicionales
+
+ Las horas adicionales del curso.
+
+ |
+ + {{ contract_request.additional_hours }} + | +
+
+
+
+
+
+
+
+
+ + Información legal del contrato +
+
+
+
+
+
+
+ + + Motivo de la Solicitud
+
+ El motivo por el cual se realiza la solicitud.
+
+ |
+
+ + + {{ contract_request.request_motive }} + |
+
+ + + Valor del Contrato
+
+ El valor total del contrato.
+
+ |
+
+ + + {{ contract_request.contract_value }} + |
+
+ + + Cuenta de Cobro
+
+ La cuenta bancaria a la que se realizarán los pagos
+ correspondientes.
+
+ |
+
+ + + {{ contract_request.charge_account }} + |
+
+ + + Descargar Archivo RUT + + + |
+
+
+
+
+
+
+
+
+ + Información legal del contrato +
+
+
+
+ {% for schedule in course_schedules %}
+
+
+
+ Clase
+ |
+ |
+ Fecha
+
+ La fecha de la clase.
+
+ |
+ {{ schedule.date }} | +
+ Hora de inicio
+
+ La hora de inicio de la clase.
+
+ |
+ {{ schedule.start_time }} | +
+ Hora de fin
+
+ La hora de fin de la clase.
+
+ |
+ {{ schedule.end_time }} | +
+ Salón
+
+ El salón de la clase.
+
+ |
+ {{ schedule.room }} | +
+ Responsabilidad
+
+ Codigo de la responsabilidad de la clase.
+
+ |
+ {{ schedule.responsability }} | +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Solicitudes CEX: 0
-
-
-
- - Solicitudes Monitorias: 0 - -
-
- - Solicitudes Prestacion de Servicios: 0 - -
- -
- - Solicitudes Monitorias: 0 - -
-
- - Solicitudes Prestacion de Servicios: 0 - -
{{ daily_requests }}
- - - - - - \ No newline at end of file diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_date_range_requests.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_date_range_requests.html new file mode 100644 index 0000000..7212774 --- /dev/null +++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_date_range_requests.html @@ -0,0 +1,87 @@ +{% load static %} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Solicitudes CEX:
+ 0
+
+
+
+ + Solicitudes Monitorias: + 0 + +
+
+ + Solicitudes Prestacion de + Servicios: 0 + +
+ +
+ + Solicitudes Monitorias: + 0 + +
+
+ + Solicitudes Prestacion de + Servicios: 0 + +
{{ daily_requests }}
+ + + + diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html index a75c6ec..394e494 100644 --- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html +++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html @@ -1,10 +1,9 @@ {% load static %}
-
@@ -41,22 +44,23 @@
-
+
-
-
- Solicitudes Aprobadas: {{ leader_data.0.1 }}
+ Solicitudes Aprobadas:
+ {{ leader_data.0.1 }}
+
+
+
+ + Solicitudes En revisión: + {{ leader_data.0.2 }}
- Solicitudes En revisión: {{ leader_data.0.2 }} + Solicitudes por validar: + {{ leader_data.0.3 }}
- Solicitudes por validar: {{ leader_data.0.3 }} + Solicitudes canceladas: + {{ leader_data.0.4 }}
+
+ + Solicitudes En revisión: + {{ leader_data.0.2 }}
- Solicitudes En revisión: {{ leader_data.0.2 }} + Solicitudes por validar: + {{ leader_data.0.3 }}
- Solicitudes por validar: {{ leader_data.0.3 }} + Solicitudes canceladas: + {{ leader_data.0.4 }}
-
-