{% load i18n %} {% load basefilters %}
{% if user_leaves %}
{% for user_leave in user_leaves %} {% if perms.leave.view_leavetype or perms.leave.view_leaverequest or request.user|check_manager:employee_leave or request.user == user_leave.employee_id.employee_user_id %}
{% if user_leave.leave_type_id.icon %} Leave Icon {% else %} Leave Icon {% endif %}
{{user_leave.leave_type_id}} {% trans "Available Leave Days" %} : {% if user_leave.leave_type_id.limit_leave %}{{user_leave.available_days}}{% else %}{% trans "No Limit" %}{% endif %}
{% trans "Carryforward Leave Days" %} : {{user_leave.carryforward_days}}
{% trans "Total Leave Days" %} : {% if user_leave.leave_type_id.limit_leave %}{{user_leave.total_leave_days}}{% else %}{% trans "No Limit" %}{% endif %}
{% trans "Total Leave taken" %} :{{user_leave.leave_taken}}
{% endif %} {% endfor %}
{% elif employee_leaves %}
{% for employee_leave in employee_leaves %} {% if perms.leave.view_leavetype or perms.leave.view_leaverequest or request.user|check_manager:employee_leave or request.user == employee_leave.employee_id.employee_user_id %}
{% if employee_leave.leave_type_id.icon %} Leave Icon {% else %} Leave Icon {% endif %}
{{employee_leave.leave_type_id}} {% trans "Available Leave Days" %} : {% if employee_leave.leave_type_id.limit_leave %}{{employee_leave.available_days}}{% else %}{% trans "No Limit" %}{% endif %}
{% trans "Carryforward Leave Days" %} : {{employee_leave.carryforward_days}}
{% trans "Total Leave Days" %} : {% if employee_leave.leave_type_id.limit_leave %}{{employee_leave.total_leave_days}}{% else %}{% trans "No Limit" %}{% endif %}
{% trans "Total Leave taken" %} :{{employee_leave.leave_taken}}
{% endif %} {% endfor %}
{% else %}
{% trans "No Leave Types have been assigned." %}
{% endif %} {% if employee_leaves or user_leaves %}
{% if employee.leaverequest_set.all %}
{% trans "Leave Type" %}
{% trans "Start Date" %}
{% trans "End Date" %}
{% trans "Requested days" %}
{% trans "Status" %}
{% if perms.leave.change_leaverequest %}
{% endif %}
{% for leave_request in employee.leaverequest_set.all %}
{% if leave_request.leave_type_id.icon %} Leave Type Icon {% else%} Leave type icon {% endif %}
{{leave_request.leave_type_id}}
{{leave_request.start_date}}
{{leave_request.end_date}}
{{leave_request.requested_days}}
{{leave_request.get_status_display}}
{% if perms.leave.change_leaverequest %}
{% if leave_request.status == 'cancelled' %} {% if leave_request.end_date >= current_date %} {% else %} {% endif %} {% else %} {% if leave_request.is_approved and leave_request.status == 'requested' and leave_request.end_date >= current_date %} current_date.month %} onclick = "leaveRequestConfirm('This leave request is for the month of {{leave_request.start_date|date:'F'}}. Approval depends on the {{leave_request.employee_id.get_full_name}} having available leave days for this month.',event);" {% else %} onclick = "return confirm('Do You really want to Approve this request?')"; {% endif %}> {% else %} {% endif %} {% if leave_request.status != 'rejected' and leave_request.end_date >= current_date %} {% else %} {% endif %} {% endif %}
{% endif %}
{% endfor %}
{% else %}
{% trans "No Leave requests have been generated." %}
{% endif %}
{% endif %} {% if perms.leave.add_leaverequest or request.user == employee.employee_user_id or request.user|check_manager:employee %} {% endif %}