{% extends "base.html" %}
{% load i18n static %}

{% block title %}{{ _("Quotations") }}{% endblock title %}

{% block content %}
<div class="container mt-4">
    <h3 class="text-center">{% trans "Quotations" %}</h3>
    <div class="table-responsive">
        <table class="table table-striped align-middle">
            <thead>
                <tr>
                    <th>#</th>
                    <th>{% trans "Customer" %}</th>
                    <th>{% trans "Total Cars" %}</th>
                    <th>{% trans "Total Amount" %}</th>
                    <th>{% trans "Created At" %}</th>
                    <th>{% trans "Actions" %}</th>
                </tr>
            </thead>
            <tbody>
                {% for quotation in quotations %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ quotation.customer.get_full_name }}</td>
                    <td>{{ quotation.quotation_cars.count }}</td>
                    <td>{{ quotation.quotation_cars.get_financial_details.total_amount }}</td>
                    <td>{{ quotation.created_at|date:"d/m/Y H:i" }}</td>
                    <td>
                        <a href="{% url 'quotation_detail' quotation.id %}" class="btn btn-sm btn-info">
                            {% trans "View" %}
                        </a>
                  
                    </td>
                </tr>
                {% empty %}
                <tr>
                    <td colspan="6" class="text-center">{% trans "No Quotations Found" %}</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="d-flex justify-content-center">
        
    </div>
</div>
{% endblock %}