{% extends 'base.html' %}
{% from 'macros.html' import render_messages %}

{% block content %}
<div class="container">
    {{ render_messages() }}

    <div class="d-flex justify-content-between align-items-center mb-4">
        <h2><i class="bi bi-plus-circle me-2"></i>{{ _('Nueva Liquidación') }}</h2>
        <a href="{{ url_for('liquidacion.index') }}" class="btn btn-outline-secondary">
            <i class="bi bi-arrow-left me-1"></i>{{ _('Volver') }}
        </a>
    </div>

    <div class="card">
        <div class="card-body">
            <form method="POST">
                <div class="mb-3">
                    <label class="form-label" for="empleado_id">{{ _('Empleado') }}</label>
                    <select class="form-select" id="empleado_id" name="empleado_id" required>
                        <option value="">{{ _('-- Seleccionar --') }}</option>
                        {% for e in empleados %}
                            <option value="{{ e.id }}">{{ e.codigo_empleado }} - {{ e.primer_nombre }} {{ e.primer_apellido }}</option>
                        {% endfor %}
                    </select>
                </div>

                <div class="mb-3">
                    <label class="form-label" for="concepto_id">{{ _('Concepto') }}</label>
                    <select class="form-select" id="concepto_id" name="concepto_id">
                        <option value="">{{ _('-- Seleccionar --') }}</option>
                        {% for c in conceptos %}
                            <option value="{{ c.id }}">{{ c.nombre }}</option>
                        {% endfor %}
                    </select>
                </div>

                <div class="mb-3">
                    <label class="form-label" for="fecha_calculo">{{ _('Fecha de Cálculo') }}</label>
                    <input class="form-control" type="date" id="fecha_calculo" name="fecha_calculo" value="{{ fecha_calculo }}" />
                </div>

                <div class="d-flex gap-2">
                    <button type="submit" class="btn btn-primary">{{ _('Calcular') }}</button>
                    <a href="{{ url_for('liquidacion.index') }}" class="btn btn-secondary">{{ _('Cancelar') }}</a>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}
