{% extends "pdf/layout.html" %}
{% load static %}
{% block content %}
<header>
    {% include "pdf/cop.html" %}
</header>
<main>
    <h1 align="center">INFORMASAUN LICENSA</h1>
    <table border="1" class="" id="#" width="100%" cellspacing="0">
        <thead>
            <tr>
                <th colspan="4" align="left" style="background-color: #e7e7e7;">
                    <h2>APLIKANTE</h2>
                </th>
            </tr>
            <tr>
                <th>Naran</th>
                <th style="color: rgb(52, 52, 157); font-weight: 600;">{{leave.employee}}</th>
                <th rowspan="2">Data Aplikasaun</th>
                <th rowspan="2">{{ leave.datetime|date:"d-F-Y" }}</th>
            </tr>
            <tr>
                <th>ID</th>
                <th>{{ leave.employee.emp_id }}</th>
            </tr>
            <tr>
                <th>Pozisaun</th>
                <th>{{ leave.employee.curempposition.position }}</th>
                <th rowspan="2">Divizaun/Ekipa</th>
                <th rowspan="2">
                {% if leave.employee.curempdivision.department %}
                    {{ leave.employee.curempdivision.department }}<br/>
                    {{ leave.employee.curempdivision.department.unit.code }}
                {% elif leave.employee.curempdivision.unit %}
                    {{ leave.employee.curempdivision.unit }}
                {% endif %}
                </th>
            </tr>
            <tr>
                <th style="text-align: center;">No. Telemovel</th><td>
                    {% if leave.employee.contactinfo.phone1 %}
                        {{ leave.employee.contactinfo.phone1 }}
                    {% else %}
                        -
                    {% endif %}
                </td>
            </tr>
        </thead>
    </table>
    <table border="1" class="" id="#" width="100%" cellspacing="0" style="margin-top: 20px;">
        <thead>
            <tr>
                <th colspan="6" align="left" style="background-color: #e7e7e7;">
                    <h2>INFORMASAUN LICENSA</h2>
                </th>
            </tr>
            <tr>
                <th rowspan="2" width="25%">Deskrisaun</th>
                <th rowspan="2" width="10%">Tipu Licensa</th>
                <th colspan="2">Loron</th>
                <th rowspan="2" width="15%">Total loron ne'ebe foti</th>
                <th rowspan="2" width="10%">Balansu loron</th>
            </tr>
            <tr align="center">
                <th>Husi</th><th>To'o</th>
            </tr>
            <tr align="center">
                <th>{{ leave.description }}</th>
                <th>{{ leave.leave_type }}</th>
                <th style="color: rgb(124, 26, 26);">{{ leave.start_date|date:"d-F-Y" }}</th>
                <th style="color: rgb(124, 26, 26);">{{ leave.end_date|date:"d-F-Y" }}</th>
                <th style="color: rgb(124, 26, 26);">{{ leave.days }}</th>
                <th>{{ leave.employee.leavecount.all.last.balance }}</th>
            </tr>
        </thead>
    </table>
    <table border="1" class="" id="#" width="100%" cellspacing="0" style="margin-top: 20px;">
        <thead>
            <tr>
                <th colspan="3" align="left" style="background-color: #e7e7e7;">
                    <h2>DESIZAUN</h2>
                </th>
            </tr>
            <tr>
                <th>Naran</th>
                <th>Pozisaun</th>
                <th>Desizaun</th>
            </tr>
            
            {% if leavedep.user %}
            <tr>
                <th>{{leavedep.user.employeeuser.employee|title}}</th>
                <th>{{leavedep.user.employeeuser.employee.empposition.all.last.position.name|upper}} - {{leavedep.user.employeeuser.employee.curempdivision.department.name|title}}</th>
                <th>
                    {% if leavedep.obs == 'Sim' %}
                    <span style="color: rgb(16, 164, 2);">APROVA</span>
                    {% endif %}
                </th>
            </tr>
            {% endif %}
            {% if leaveunit.user %}
            <tr>
                <th>{{leaveunit.user.employeeuser.employee|title}}</th>
                <th>{{leaveunit.user.employeeuser.employee.empposition.all.last.position.name|upper}} - {{leaveunit.user.employeeuser.employee.empposition.all.last.unit.name|title}}</th>
                <th>
                    {% if leaveunit.obs == 'Sim' %}
                    <span style="color: rgb(16, 164, 2);">APROVA</span>
                    {% endif %}
                </th>
            </tr>
            {% endif %}
            {% if leavede.user %}
            <tr>
                <th>{{leavede.user.employeeuser.employee|title}}</th>
                <th>{{leavede.user.employeeuser.employee.empposition.all.last.position.name|upper}} </th>
                <th>
                    {% if leavede.obs == 'Sim' %}
                        <span style="color: rgb(16, 164, 2);">APROVA</span>
                    {% endif %}
                </th>
            </tr>
            {% endif %}
        </thead>
    </table>
    <table border="1" class="" id="#" width="100%" cellspacing="0" style="margin-top: 20px;">
        <thead>
            <tr>
                <th colspan="3" align="left"  style="background-color: #e7e7e7;">
                    <h2>KOMENTARIO HUSI RECURSO HUMANO</h2>
                </th>
            </tr>
            <tr>
                <th>Naran</th>
                <th>Pozisaun</th>
                <th>Komentario</th>
            </tr>
            
            {% if leavehr.user %}
            <tr>
                <th>{{leavehr.user.employeeuser.employee|title}}</th>
                <th>{{leavehr.user.employeeuser.employee.curempdivision.department.name|title}}</th>
                <th>
                    <span>{{leavehr.comment|safe}}</span>
                </th>
            </tr>
            {% endif %}
        </thead>
    </table>
    <table border="0" class="" id="#" width="100%" cellspacing="0" style="margin-top: 20px;">
        <thead>
            {% if leavede.user %}
            <tr>
                <td></td>
                <td style="text-align: center;">
                    <img src="{{signature_path}}" style="width: 90px; height: 160px;" alt="">
                </td>
            </tr>
            <tr>
                <td></td>
                <td style="text-align: center;"><h3>{{leavede.user.employeeuser.employee|title}}</h3></td>
            </tr>
            <tr>
                <td></td>
                <td style="text-align: center;">Data Aprova: <strong>{{leavede.datetime|date:"d F Y"}}</strong> </td>
            </tr>
            {% endif %}
            {% if leaveunit.user %}
            <tr>
                <td></td>
                <td style="text-align: center;">
                    <img src="{{signature_path}}" style="width: 90px; height: 160px;" alt="">
                </td>
            </tr>
            <tr>
                <td></td>
                <td style="text-align: center;"><h3>{{leaveunit.user.employeeuser.employee|title}}</h3></td>
            </tr>
            <tr>
                <td></td>
                <td style="text-align: center;">Data Aprova: <strong>{{leaveunit.datetime|date:"d F Y"}}</strong> </td>
            </tr>
            {% endif %}
        </thead>
    </table>
</main>
<footer >
    <div >
    </div>
</footer>

    






{% endblock %}
{% block scripts %}
<style>
    
    table h2 {
        padding: 10px 10px 2px 10px;
        margin-bottom: 0;
    }
    table th {
        padding: 4px 4px 0 4px;
    }
    

</style>
{% endblock %}