diff --git a/base/static/base/toggleColumn.js b/base/static/base/toggleColumn.js index 429d96e8d..f812e149a 100644 --- a/base/static/base/toggleColumn.js +++ b/base/static/base/toggleColumn.js @@ -32,8 +32,8 @@ function toggleColumns(tableId, fieldContainer) { } let selectButtons = $(`
- - + +
`) $(`#${fieldContainer}`).parent().prepend(selectButtons) diff --git a/base/templates/base/mail_templates/leave_request_template.html b/base/templates/base/mail_templates/leave_request_template.html index 75fe1c9d9..ce44a0db9 100644 --- a/base/templates/base/mail_templates/leave_request_template.html +++ b/base/templates/base/mail_templates/leave_request_template.html @@ -77,7 +77,7 @@ diff --git a/base/templates/base/rotating_shift/rotating_shift_assign_view.html b/base/templates/base/rotating_shift/rotating_shift_assign_view.html index f2a2c3c09..d9d64435f 100644 --- a/base/templates/base/rotating_shift/rotating_shift_assign_view.html +++ b/base/templates/base/rotating_shift/rotating_shift_assign_view.html @@ -398,5 +398,4 @@ if (!localStorageroratingShiftCells) { $("#roratingShiftCells").find("[type=checkbox]").prop("checked", true); } - $("[type=checkbox]").change(); diff --git a/base/templates/work_type_request/htmx/requests.html b/base/templates/work_type_request/htmx/requests.html index 762497161..221b13fcf 100755 --- a/base/templates/work_type_request/htmx/requests.html +++ b/base/templates/work_type_request/htmx/requests.html @@ -427,5 +427,4 @@ if (!localStorageWorkTypeReqCells) { $("#workTypeRequestCells").find("[type=checkbox]").prop("checked", true); } - $("[type=checkbox]").change(); diff --git a/base/views.py b/base/views.py index bb2d94afc..c23b2f318 100644 --- a/base/views.py +++ b/base/views.py @@ -239,22 +239,21 @@ def load_demo_database(request): "base_data.json", "work_info_data.json", ] - optional_apps = { - "attendance": "attendance_data.json", - "leave": "leave_data.json", - "asset": "asset_data.json", - "recruitment": "recruitment_data.json", - "onboarding": "onboarding_data.json", - "offboarding": "offboarding_data.json", - "pms": "pms_data.json", - "payroll": "payroll_data.json", - } + optional_apps = [ + ("attendance", "attendance_data.json"), + ("leave", "leave_data.json"), + ("asset", "asset_data.json"), + ("recruitment", "recruitment_data.json"), + ("onboarding", "onboarding_data.json"), + ("offboarding", "offboarding_data.json"), + ("pms", "pms_data.json"), + ("payroll", "payroll_data.json"), + ("payroll", "payroll_loanaccount_data.json"), + ] # Add data files for installed apps data_files += [ - file - for app, file in optional_apps.items() - if apps.is_installed(app) + file for app, file in optional_apps if apps.is_installed(app) ] # Load all data files diff --git a/biometric/anviz.py b/biometric/anviz.py index 8001c4ba1..82159b985 100644 --- a/biometric/anviz.py +++ b/biometric/anviz.py @@ -2,7 +2,7 @@ CrossChexCloudAPI module for Anviz Biometric Integration This module provides a wrapper for interacting with the CrossChex Cloud API to manage -authentication, attendance data retrieval, and token handling. It allows for secure +authentication, attendance data retrieval, and token handling. It allows for secure communication with the API, including fetching and validating tokens, and retrieving attendance records . """ diff --git a/biometric/dahua.py b/biometric/dahua.py index b336138b1..063a93175 100644 --- a/biometric/dahua.py +++ b/biometric/dahua.py @@ -1,21 +1,20 @@ """ DahuaAPI module for interacting with Dahua biometric and access control devices. -This module provides a set of methods for managing and configuring Dahua devices, -including retrieving system information, managing users, setting up network configurations, -and interacting with attendance logs. It communicates with Dahua devices via HTTP requests +This module provides a set of methods for managing and configuring Dahua devices, +including retrieving system information, managing users, setting up network configurations, +and interacting with attendance logs. It communicates with Dahua devices via HTTP requests and supports basic operations such as system reboot, setting time, and language configuration. """ import re -from typing import Any, Dict -from datetime import datetime, timezone from collections import defaultdict +from datetime import datetime, timezone +from typing import Any, Dict import requests from requests.auth import HTTPDigestAuth - key_map = { "AttendanceState": "attendance_state", "CardID": "card_id", diff --git a/biometric/templates/biometric_users/dahua/add_dahua_user.html b/biometric/templates/biometric_users/dahua/add_dahua_user.html index 5b0be1fc3..7d741defc 100644 --- a/biometric/templates/biometric_users/dahua/add_dahua_user.html +++ b/biometric/templates/biometric_users/dahua/add_dahua_user.html @@ -30,4 +30,4 @@ $(this).closest("select")[0].dispatchEvent(new Event("change")); }); }); - \ No newline at end of file + diff --git a/biometric/templates/biometric_users/dahua/list_dahua_employees.html b/biometric/templates/biometric_users/dahua/list_dahua_employees.html index 706cbef5d..47daba0d2 100644 --- a/biometric/templates/biometric_users/dahua/list_dahua_employees.html +++ b/biometric/templates/biometric_users/dahua/list_dahua_employees.html @@ -60,4 +60,4 @@ {% endfor %} - \ No newline at end of file + diff --git a/biometric/templates/biometric_users/dahua/map_dahua_users.html b/biometric/templates/biometric_users/dahua/map_dahua_users.html index 3bff8865e..eb68055bc 100644 --- a/biometric/templates/biometric_users/dahua/map_dahua_users.html +++ b/biometric/templates/biometric_users/dahua/map_dahua_users.html @@ -22,4 +22,4 @@ - \ No newline at end of file + diff --git a/biometric/templates/biometric_users/dahua/nav_dahua_employees.html b/biometric/templates/biometric_users/dahua/nav_dahua_employees.html index 0eb4e472a..effecb406 100644 --- a/biometric/templates/biometric_users/dahua/nav_dahua_employees.html +++ b/biometric/templates/biometric_users/dahua/nav_dahua_employees.html @@ -57,4 +57,4 @@ - \ No newline at end of file + diff --git a/biometric/templates/biometric_users/dahua/view_dahua_employees.html b/biometric/templates/biometric_users/dahua/view_dahua_employees.html index 6dae111b3..97e6e80a1 100644 --- a/biometric/templates/biometric_users/dahua/view_dahua_employees.html +++ b/biometric/templates/biometric_users/dahua/view_dahua_employees.html @@ -20,4 +20,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/employee/cbv/allocations.py b/employee/cbv/allocations.py index db40d8a34..16427083f 100644 --- a/employee/cbv/allocations.py +++ b/employee/cbv/allocations.py @@ -4,39 +4,37 @@ employee/cbv/allocations.py Detailed view to manage all modules employee information """ -import logging import ast -from django.http import HttpResponse +import logging from datetime import datetime + from django.contrib import messages +from django.db.models import Q +from django.db.models.signals import post_save +from django.dispatch import receiver +from django.http import HttpResponse from django.shortcuts import render from django.urls import reverse_lazy -from django.db.models.signals import post_save from django.utils.decorators import method_decorator -from django.dispatch import receiver -from django.db.models import Q from django.utils.translation import gettext as _ from django.views.generic import View -from employee.models import ( - Employee, - EmployeeWorkInformation, - EmployeeBankDetails, - models as django_models, -) -from employee.methods.methods import get_model_class -from horilla_views.cbv_methods import render_template, login_required -from horilla_views.generic.cbv.views import ( - HorillaDetailedView, - HorillaListView, - TemplateView, - HorillaFormView, -) -from horilla.horilla_middlewares import _thread_locals -from horilla.horilla_settings import APPS, NO_PERMISSION_MODALS + from base.forms import AddToUserGroupForm, ModelForm, forms from base.methods import paginator_qry from base.templatetags.horillafilters import app_installed from base.views import get_models_in_app +from employee.methods.methods import get_model_class +from employee.models import Employee, EmployeeBankDetails, EmployeeWorkInformation +from employee.models import models as django_models +from horilla.horilla_middlewares import _thread_locals +from horilla.horilla_settings import APPS, NO_PERMISSION_MODALS +from horilla_views.cbv_methods import login_required, render_template +from horilla_views.generic.cbv.views import ( + HorillaDetailedView, + HorillaFormView, + HorillaListView, + TemplateView, +) if app_installed("asset"): from asset.cbv.request_and_allocation import Asset @@ -45,18 +43,17 @@ if app_installed("asset"): from asset.views import asset_allocate_return from asset.forms import AssetReturnForm - from onboarding.cbv_decorators import ( all_manager_can_enter, recruitment_manager_can_enter, ) if app_installed("leave"): - from leave.cbv.leave_types import LeaveTypeListView, LeaveType, AvailableLeave + from leave.cbv.leave_types import AvailableLeave, LeaveType, LeaveTypeListView if app_installed("payroll"): - from payroll.cbv.allowances import AllowanceListView, Allowance - from payroll.cbv.deduction import DeductionListView, Deduction + from payroll.cbv.allowances import Allowance, AllowanceListView + from payroll.cbv.deduction import Deduction, DeductionListView logger = logging.getLogger(__name__) @@ -557,11 +554,14 @@ if app_installed("leave"): avaiable_instance.available_days = leave_type.total_days try: avaiable_instance.save() - messages.success(self.request, _("Assigned ") + f" {leave_type.name}") + messages.success( + self.request, _("Assigned ") + f" {leave_type.name}" + ) except: messages.error( self.request, - _("Cannot Assign or Already Assigned") + f" `{leave_type.name}`", + _("Cannot Assign or Already Assigned") + + f" `{leave_type.name}`", ) if not types: messages.info(self.request, _("Select Types to Assign")) @@ -937,7 +937,9 @@ if app_installed("payroll"): allowance.exclude_employees.add(self.instance) allowance.specific_employees.remove(self.instance) - messages.success(self.request, _("Allowance excluded") + f" {allowance}") + messages.success( + self.request, _("Allowance excluded") + f" {allowance}" + ) else: ids = ast.literal_eval(self.request.POST["ids"]) allowances = Allowance.objects.filter(pk__in=ids) @@ -1040,7 +1042,9 @@ if app_installed("payroll"): deduction.exclude_employees.add(self.instance) deduction.specific_employees.remove(self.instance) - messages.success(self.request, _("Deduction excluded") + f" {deduction}") + messages.success( + self.request, _("Deduction excluded") + f" {deduction}" + ) else: ids = ast.literal_eval(self.request.POST["ids"]) deductions = Deduction.objects.filter(pk__in=ids) diff --git a/employee/templates/cbv/allocations/allocations.html b/employee/templates/cbv/allocations/allocations.html index 78b2e070b..18a88df72 100644 --- a/employee/templates/cbv/allocations/allocations.html +++ b/employee/templates/cbv/allocations/allocations.html @@ -39,7 +39,7 @@ {% endif %} {% endfor %} - + diff --git a/employee/templates/cbv/allocations/asset/allocation_status.html b/employee/templates/cbv/allocations/asset/allocation_status.html index d2a932b78..21021d97d 100644 --- a/employee/templates/cbv/allocations/asset/allocation_status.html +++ b/employee/templates/cbv/allocations/asset/allocation_status.html @@ -13,4 +13,4 @@ {% endcomment %} Available -{% endif %} \ No newline at end of file +{% endif %} diff --git a/employee/templates/cbv/allocations/asset/assets.html b/employee/templates/cbv/allocations/asset/assets.html index 2e5fad309..82200235f 100644 --- a/employee/templates/cbv/allocations/asset/assets.html +++ b/employee/templates/cbv/allocations/asset/assets.html @@ -3,15 +3,15 @@
-
@@ -31,7 +31,7 @@ \ No newline at end of file + + diff --git a/employee/templates/cbv/allocations/asset/return_form.html b/employee/templates/cbv/allocations/asset/return_form.html index 9b2dc7f90..87f4c520a 100644 --- a/employee/templates/cbv/allocations/asset/return_form.html +++ b/employee/templates/cbv/allocations/asset/return_form.html @@ -63,7 +63,7 @@ > {% trans "Add Report" %} - {% if "payroll"|app_installed %} + {% if "payroll"|app_installed %} {% if perms.payroll.add_loanaccount %} {% endif %} diff --git a/employee/templates/cbv/allocations/auth/perm.html b/employee/templates/cbv/allocations/auth/perm.html index 4c6afc499..8a68a19b8 100644 --- a/employee/templates/cbv/allocations/auth/perm.html +++ b/employee/templates/cbv/allocations/auth/perm.html @@ -49,7 +49,7 @@ }) {% if perms.auth.add_permission or perms.auth.change_permission or perms.auth.delete_permission %} - {% load i18n %} + {% load i18n %} {% for perm in permissions %}
@@ -176,7 +176,7 @@ if (!$(this).is(':checked')) { $(this).closest('.oh-sticky-table__tr').find('.row-permission').prop('checked',false) } - " + " data-group-id="{{group.id}}" data-group-name="{{group.name}}" /> @@ -211,7 +211,7 @@
{% endfor %} - + {% endif %} @@ -363,4 +363,4 @@ } }) } - \ No newline at end of file + diff --git a/employee/templates/cbv/allocations/employee/form_structure.html b/employee/templates/cbv/allocations/employee/form_structure.html index e76e75ca0..d97880e0e 100644 --- a/employee/templates/cbv/allocations/employee/form_structure.html +++ b/employee/templates/cbv/allocations/employee/form_structure.html @@ -35,7 +35,7 @@
{{ field|add_class:'oh-switch__checkbox' }}
- {% else %} + {% else %}
{{ field|add_class:'form-control' }} {{ field.errors }} diff --git a/employee/templates/cbv/allocations/employee/forms.html b/employee/templates/cbv/allocations/employee/forms.html index 8210163c1..e325b9401 100644 --- a/employee/templates/cbv/allocations/employee/forms.html +++ b/employee/templates/cbv/allocations/employee/forms.html @@ -46,4 +46,4 @@ $(".oh-inner-sidebar-content__header:visible .oh-general__tab:first span").click(); }, 100); }); - \ No newline at end of file + diff --git a/employee/templates/cbv/allocations/payroll/allowance/allowance_view.html b/employee/templates/cbv/allocations/payroll/allowance/allowance_view.html index 68b3e3cea..fdbb4ae6b 100644 --- a/employee/templates/cbv/allocations/payroll/allowance/allowance_view.html +++ b/employee/templates/cbv/allocations/payroll/allowance/allowance_view.html @@ -26,6 +26,5 @@
- + - \ No newline at end of file diff --git a/employee/templates/cbv/allocations/payroll/deduction/deduction_view.html b/employee/templates/cbv/allocations/payroll/deduction/deduction_view.html index a57e3a15c..a1429c678 100644 --- a/employee/templates/cbv/allocations/payroll/deduction/deduction_view.html +++ b/employee/templates/cbv/allocations/payroll/deduction/deduction_view.html @@ -26,6 +26,5 @@ - + - \ No newline at end of file diff --git a/employee/templates/cbv/allocations/summary.html b/employee/templates/cbv/allocations/summary.html index 083c3ae2f..2b7b8d2cf 100644 --- a/employee/templates/cbv/allocations/summary.html +++ b/employee/templates/cbv/allocations/summary.html @@ -124,7 +124,7 @@
-
+
diff --git a/employee/views.py b/employee/views.py index e3fa945e2..cf0e84869 100755 --- a/employee/views.py +++ b/employee/views.py @@ -2917,7 +2917,7 @@ def get_employees_birthday(request): else f"{default_avatar_url}{emp.employee_first_name}+{emp.employee_last_name}" ), "name": f"{emp.employee_first_name} {emp.employee_last_name}", - "dob": emp.dob.strftime("%d %b %Y"), + "dob": emp.dob.strftime("%d %b"), "daysUntilBirthday": ( _("Today") if emp.days_until_birthday == 0 diff --git a/horilla_backup/migrations/__init__.py b/horilla_backup/migrations/__init__.py index 4898c42f8..1a186e937 100644 --- a/horilla_backup/migrations/__init__.py +++ b/horilla_backup/migrations/__init__.py @@ -4,14 +4,17 @@ import atexit def shutdown_function(): from horilla_backup.models import GoogleDriveBackup, LocalBackup - if GoogleDriveBackup.objects.exists(): - google_drive_backup = GoogleDriveBackup.objects.first() - google_drive_backup.active = False - google_drive_backup.save() - if LocalBackup.objects.exists(): - local_backup = LocalBackup.objects.first() - local_backup.active = False - local_backup.save() + try: + if GoogleDriveBackup.objects.exists(): + google_drive_backup = GoogleDriveBackup.objects.first() + google_drive_backup.active = False + google_drive_backup.save() + if LocalBackup.objects.exists(): + local_backup = LocalBackup.objects.first() + local_backup.active = False + local_backup.save() + except: + pass try: diff --git a/load_data/payroll_data.json b/load_data/payroll_data.json index a5f7a4bdb..3c5e64b9a 100644 --- a/load_data/payroll_data.json +++ b/load_data/payroll_data.json @@ -1592,32 +1592,5 @@ "status": "requested", "description": "Software license for Sublime Text (1-year subscription for team development)." } - }, - { - "model": "payroll.loanaccount", - "pk": 1, - "fields": { - "created_at": "2024-12-12T09:45:26.097Z", - "created_by": 1, - "modified_by": 1, - "is_active": true, - "type": "loan", - "title": "Medical Loan", - "employee_id": 18, - "loan_amount": 60000.0, - "provided_date": "2024-12-01", - "allowance_id": 5, - "description": "Loan for parents medical case", - "is_fixed": true, - "rate": 0.0, - "installment_amount": 5000.0, - "installments": 12, - "installment_start_date": "2025-01-01", - "apply_on": "end_of_month", - "settled": false, - "settled_date": null, - "asset_id": null, - "deduction_ids": [22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33] - } } ] diff --git a/load_data/payroll_loanaccount_data.json b/load_data/payroll_loanaccount_data.json new file mode 100644 index 000000000..010859414 --- /dev/null +++ b/load_data/payroll_loanaccount_data.json @@ -0,0 +1,29 @@ +[ + { + "model": "payroll.loanaccount", + "pk": 1, + "fields": { + "created_at": "2024-12-12T09:45:26.097Z", + "created_by": 1, + "modified_by": 1, + "is_active": true, + "type": "loan", + "title": "Medical Loan", + "employee_id": 18, + "loan_amount": 60000.0, + "provided_date": "2024-12-01", + "allowance_id": 5, + "description": "Loan for parents medical case", + "is_fixed": true, + "rate": 0.0, + "installment_amount": 5000.0, + "installments": 12, + "installment_start_date": "2025-01-01", + "apply_on": "end_of_month", + "settled": false, + "settled_date": null, + "asset_id": null, + "deduction_ids": [1,2,3] + } + } +] \ No newline at end of file diff --git a/payroll/signals.py b/payroll/signals.py index 42b37a95d..df0695882 100644 --- a/payroll/signals.py +++ b/payroll/signals.py @@ -18,7 +18,8 @@ def employeeworkinformation_pre_save(sender, instance, **_kwargs): instance.employee_id if instance.employee_id.is_active == True else None ) if active_employee is not None: - contract_exists = active_employee.contract_set.exists() + all_contracts = Contract.objects.entire() + contract_exists = all_contracts.filter(employee_id_id=active_employee).exists() if not contract_exists: contract = Contract() contract.contract_name = f"{active_employee}'s Contract" @@ -50,12 +51,12 @@ def create_installments(sender, instance, created, **kwargs): loan.amount = instance.loan_amount loan.only_show_under_employee = True loan.is_fixed = True + loan.is_fixed = True loan.one_time_date = instance.provided_date loan.is_loan = True - loan.save() loan.include_active_employees = False - loan.specific_employees.add(instance.employee_id) loan.save() + loan.specific_employees.add(instance.employee_id) instance.allowance_id = loan super(LoanAccount, instance).save() else: diff --git a/payroll/templates/payroll/payslip/payslip_table.html b/payroll/templates/payroll/payslip/payslip_table.html index e9484d4af..88aa0fa13 100644 --- a/payroll/templates/payroll/payslip/payslip_table.html +++ b/payroll/templates/payroll/payslip/payslip_table.html @@ -246,10 +246,9 @@ }); }); // toggle columns // - toggleColumns("payslip_column_tab", "payslipCells") + toggleColumns("payslip-column-table", "payslipCells") localStoragepayslipCells = localStorage.getItem("payslip_column_tab") if (!localStoragepayslipCells) { $("#payslipCells").find("[type=checkbox]").prop("checked", true) } - $("[type=checkbox]").change() diff --git a/recruitment/templates/candidate/interview_form.html b/recruitment/templates/candidate/interview_form.html index f40f359b3..da9170bc3 100644 --- a/recruitment/templates/candidate/interview_form.html +++ b/recruitment/templates/candidate/interview_form.html @@ -1,46 +1,52 @@ {% load i18n %} -
+{% if messages %} + +{% endif %} + {{form.as_p}}
+======= + +>>>>>>> a557b8a4c05c90515a575c7585620c822d2503d6 diff --git a/recruitment/templates/candidate/interview_list.html b/recruitment/templates/candidate/interview_list.html index 6e65342bf..ae39f9dd1 100644 --- a/recruitment/templates/candidate/interview_list.html +++ b/recruitment/templates/candidate/interview_list.html @@ -2,26 +2,27 @@ {% include 'filter_tags.html' %} {% if messages %} -
+
{% for message in messages %}
- {{ message }} + {{ message }}
{% endfor %} -
+
{% endif %} - {% if data %} +{% if data %}
- +
@@ -38,67 +39,60 @@
{% trans "Candidate" %}
{% trans "Interviewer" %}
+ class="oh-sticky-table__th">{% trans "Interviewer" %}
{% trans "Interview Date" %}
+ hx-get="{% url 'interview-filter-view' %}?{{pd}}&sortby=interview_date" + hx-target="#section">{% trans "Interview Date" %}
{% trans "Interview Time" %}
+ class="oh-sticky-table__th">{% trans "Interview Time" %}
{% trans "Description" %}
-
{% trans "Status" %}
-
{% trans "Actions" %}
+ class="oh-sticky-table__th">{% trans "Description" %}
+
+ {% trans "Status" %}
+
{% trans "Actions" %}
{% for interview in data %} -
-
+
+
{{interview.candidate_id}}
{% for employee in interview.employee_id.all %} -
- -
-
- Baby C. +
+ +
+
+ Baby C. +
+ {{employee.get_full_name|truncatechars:15}}
- {{employee.get_full_name|truncatechars:15}} -
- {% if perms.recruitment.change_interviewschedule or request.user.employee_get in interview.employee_id.all %} - - - - {% endif %} - -
+ {% if perms.recruitment.change_interviewschedule or request.user.employee_get in interview.employee_id.all %} + + + + {% endif %} + +
{% endfor %} {{interview.employee_id.all|length}} {% trans "Interviewers" %} @@ -139,103 +133,94 @@
{% endif %}
-
-
+
+
- {% if perms.recruitment.change_interviewschedule or request.user.employee_get in interview.employee_id.all %} - - {% endif %} + data-toggle="oh-modal-toggle" class="oh-btn oh-btn--light-bkg w-100"> + {% endif %} - {% if perms.recruitment.delete_interviewschedule %} -
- {% csrf_token %} - -
- {% endif %} -
+ {% if perms.recruitment.delete_interviewschedule %} +
+ {% csrf_token %} + +
+ {% endif %}
+
{% endfor %}
-
+
- -
- - {% trans "Page" %} {{ data.number }} {% trans "of" %} {{ data.paginator.num_pages }}. - - -
- {% else %} -
- - groups - -
{% trans "No Interviews Found." %}
-
- {% endif %} - - +
+ + {% trans "Page" %} {{ data.number }} {% trans "of" %} {{ data.paginator.num_pages }}. + + +
+{% else %} +
+ + groups + +
{% trans "No Interviews Found." %}
+
+{% endif %} + diff --git a/recruitment/templates/candidate/interview_view.html b/recruitment/templates/candidate/interview_view.html index 944e7ccc4..633700c15 100644 --- a/recruitment/templates/candidate/interview_view.html +++ b/recruitment/templates/candidate/interview_view.html @@ -29,7 +29,7 @@ {% include 'candidate/interview_nav.html' %}
-
+
{% include 'candidate/interview_list.html' %}
diff --git a/recruitment/views/dashboard.py b/recruitment/views/dashboard.py index 6fbb0b1d8..2401ac7bc 100644 --- a/recruitment/views/dashboard.py +++ b/recruitment/views/dashboard.py @@ -104,8 +104,8 @@ def dashboard(request): if stage_chart_count >= 1: stage_chart_count = 1 - onboarding_count = Candidate.objects.filter(start_onboard=True) - onboarding_count = onboarding_count.count() + accepted = Candidate.objects.filter(offer_letter_status="accepted") + accepted_count = accepted.count() recruitment_manager_mapping = {} @@ -139,7 +139,7 @@ def dashboard(request): hired_ratio = f"{((total_hired_candidates / total_vacancy) * 100):.1f}" total_candidate_ratio = f"{((total_candidates / total_vacancy) * 100):.1f}" if total_hired_candidates != 0: - acceptance_ratio = f"{((onboarding_count / total_hired_candidates) * 100):.1f}" + acceptance_ratio = f"{((accepted_count / total_hired_candidates) * 100):.1f}" skill_zone = SkillZone.objects.filter(is_active=True) return render( diff --git a/recruitment/views/views.py b/recruitment/views/views.py index 883859aca..ee21a9ceb 100644 --- a/recruitment/views/views.py +++ b/recruitment/views/views.py @@ -1398,7 +1398,7 @@ def interview_filter_view(request): previous_data = request.GET.urlencode() - if request.user.has_perm("view_interviewschedule"): + if request.user.has_perm("recruitment.view_interviewschedule"): interviews = InterviewSchedule.objects.all().order_by("-interview_date") else: interviews = InterviewSchedule.objects.filter( @@ -1434,7 +1434,7 @@ def interview_view(request): """ previous_data = request.GET.urlencode() - if request.user.has_perm("view_interviewschedule"): + if request.user.has_perm("recruitment.view_interviewschedule"): interviews = InterviewSchedule.objects.all().order_by("-interview_date") else: interviews = InterviewSchedule.objects.filter( @@ -2035,7 +2035,6 @@ def create_interview_schedule(request): ) messages.success(request, "Interview Scheduled successfully.") - return HttpResponse("") return render(request, template, {"form": form}) @@ -2044,21 +2043,23 @@ def create_interview_schedule(request): @manager_can_enter(perm="recruitment.delete_interviewschedule") def interview_delete(request, interview_id): """ - This method is used to delete interview + Deletes an interview schedule. Args: - interview_id : interview schedule instance id + interview_id: InterviewSchedule instance ID """ + view = request.GET.get("view", "false") - view = request.GET.get("view") - interview = InterviewSchedule.objects.get(id=interview_id) - interview.delete() - messages.success(request, "Interview deleted successfully.") - if view == "true": - # return HttpResponse("") - return redirect(reverse("interview-list-view")) - else: - # return redirect(reverse("interview-detail-view", kwargs={'pk': interview_id})) - return HttpResponse("") + try: + InterviewSchedule.objects.get(id=interview_id).delete() + messages.success(request, _("Interview deleted successfully.")) + except: + messages.error(request, _("Scheduled Interview not found")) + + return HttpResponse( + "" + if view == "true" + else "" + ) @login_required diff --git a/static/css/style.css b/static/css/style.css index c912dff5a..b16694c20 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -601,3 +601,16 @@ form label { border: solid 1px; border-radius: 5px; } + +#c { + position: absolute; + top: 0; + left: 0; + width: 100%; + /* Make sure the canvas fills the modal */ + height: 100%; + z-index: 1000; + /* Ensure it's above the blurred background */ + pointer-events: none; + /* Ensure clicks pass through to underlying content */ +} diff --git a/templates/dashboard.html b/templates/dashboard.html index 14360d30a..90ec5e205 100755 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -105,15 +105,6 @@ z-index: 1000; /* Ensure it's behind the canvas */ } - #c { - position: absolute; - top: 0; - left: 0; - width: 100%; /* Make sure the canvas fills the modal */ - height: 100%; - z-index: 1000; /* Ensure it's above the blurred background */ - pointer-events: none; /* Ensure clicks pass through to underlying content */ - } @@ -153,12 +144,6 @@
- {% if is_birthday %} -
-
- -
- {% endif %}
diff --git a/templates/index.html b/templates/index.html index d183dff23..df2b6eb78 100755 --- a/templates/index.html +++ b/templates/index.html @@ -67,6 +67,12 @@ {% endfor %}
{% endif %} + {% if is_birthday %} +
+
+ +
+ {% endif %} {% include "generic/components.html" %}