{% extends "base.html" %} {% load i18n %} {% load short_name %} {% load contract_filters %} {% load static %} {% block head %} {% endblock head %} {% block content %}

{% translate "Détail de la commande" %}

{% if messages %} {% for message in messages %} {% endfor %} {% endif %}
{% translate "Commande" %} : {{ order.order_code }}
{{ order.get_order_status_display }} {% if order.order_status == 'pending' and is_order_edit_allowed == True %} {% endif %}

{% translate "Contrat lié" %} : {{ order.contract.contract_number }} - {{ order.contract }}

{% if order.description %}

{% translate "Description" %} : {{ order.description }}

{% endif %}

{% translate "Date de commande" %} : {{ order.order_date|date:"d/m/Y" }}

{% translate "Date de livraison" %} : {{ order.delivery_date|date:"d/m/Y" }}


{% translate "Montant prévisionnel" %} : {% translate "Non renseigné" as not_set %} {{ order.total_amount|default:not_set }} €

{% translate 'Montant "presté"' %}
{{ order.get_total_realized_amount|floatformat:2 }} €
{% if order.total_amount %} {{ order.realized_percent|floatformat:0 }}% {% endif %}
{% translate "Montant validé" %}
{{ order.get_total_validated_amount|floatformat:2 }} €
{{ order.validated_percent|floatformat:0 }}%

{% translate "Devis" %}
{% if quote %}

{% translate "Montant total" %} : {{ quote_total|floatformat:2 }} €

{% if quote.is_finalized %}

{% translate "Devis figé" %} {% if quote.finalized_at %} ({{ quote.finalized_at|date:'d/m/Y H:i' }}) {% endif %}

{% endif %}

{% blocktrans count item_count=quote.items.count %} {{ item_count }} poste dans le devis. {% plural %} {{ item_count }} postes dans le devis. {% endblocktrans %}

{% else %}

{% translate "Aucun devis n'est associé à cette commande pour le moment." %}

{% endif %}

{% if order.ordered_by %}

{% translate "Commandé par" %} : {{ order.ordered_by|short_name }}

{% endif %}

{% translate "Fichier de commande" %} : {% if order.order_file %} 📄 {% translate "Télécharger le fichier" %} {% endif %}

{% translate "Documents" %}

{% if is_order_edit_allowed %} {% endif %}
{% if attachments %}
{% for att in attachments %}
{{ att.upload_date|date:"d/m/Y H:i" }}
{{ att.uploaded_by|short_name }}
{% endfor %}
{% else %}

{% translate "Aucun document associé à cette commande." %}

{% endif %}
{% if is_order_edit_allowed %} {% endif %}

{% translate "Documents financiers" %}

{% translate "Générer un draft de l'état de travaux" %} {% translate "Générer un draft de la déclaration de créance" %}

{% if is_generate_documents_allowed %}

{% translate "Générer la déclaration de créance" %}
{% translate 'Cette opération va générer un état de travaux, une déclaration de créance et faire passer les interventions validées au statut "comptabilisé".' %}

{% endif %}
    {% regroup documents by progress_state.index as docs_by_state %} {% for group in docs_by_state %} {% if group.grouper %}
  • {% blocktrans with num=group.grouper %}État d'avancement {{ num }}{% endblocktrans %}
  • {% else %}
  • {% translate "Autres documents" %}
  • {% endif %} {% for doc in group.list %}
  • {% if doc.document.name|lower|slice:"-5:" == ".xlsx" or doc.document.name|lower|slice:"-4:" == ".xls" %} {% else %} {% endif %} {{ doc.title }}
    {% translate "Type" %} : {{ doc.get_document_type_display }} | {% translate "Ajouté le" %} {{ doc.uploaded_at|date:"d/m/Y H:i" }} {% if doc.document_type == 'claim_declaration' %} | {{ doc.attachments.count }} {% translate "justificatif(s)" %} {% endif %}
    {% if doc.document_type == 'claim_declaration' %} {% translate "Justificatifs" %}{% if doc.attachments.count %} {{ doc.attachments.count }}{% endif %} {% endif %}
  • {% endfor %} {% endfor %}

{% translate "Consommation des postes" %}

{% if consumption_summary %}
{% if quote %} {% endif %} {% for ps in progress_states %} {% endfor %} {% if quote %} {% endif %} {% for item in consumption_summary %} {% if quote %} {% endif %} {% for ps in progress_states %} {% endfor %} {% if quote %} {% endif %} {% endfor %}
{% translate "Poste" %} {% translate "Code" %} {% translate "Description" %}{% translate "Quantité prévue" %} {% translate "État" %} {{ forloop.counter }}
{{ ps.created_at|date:"d/m/Y" }}
{% translate "Quantité consommée" %}{% translate "Quantité restante" %}{% translate "Prix unitaire" %} {% translate "Montant consommé" %}
{{ item.contract_post.order_number }} {{ item.contract_post.code }} {% if LANGUAGE_CODE == "nl" %} {{ item.contract_post.description_nl|default:item.contract_post.description_fr }} {% else %} {{ item.contract_post.description_fr|default:item.contract_post.description_nl }} {% endif %} {{ item.planned_quantity|floatformat:2 }} {% if item.progress_states %} {{ item.progress_states|dict_get:ps.id|floatformat:2|default:"0.00" }} {% else %} 0.00 {% endif %} {{ item.consumed_quantity|floatformat:2 }}{{ item.remaining_quantity|floatformat:2 }}{{ item.contract_post.unit_price|floatformat:2 }} € {{ item.consumed_amount|floatformat:2 }} €
{% else %}

{% translate "Aucune consommation enregistrée pour cette commande." %}

{% endif %}
{% if order.projects.exists %}
{% translate "Projets associés" %} : {% for project in order.projects.all %} {{ project.code }} - {{ project.name }}{% if not forloop.last %}, {% endif %} {% endfor %}
{% endif %}

{% translate "Commandes directes" %}

{% if can_manage_direct_posts %} {% endif %}

{% translate "Les commandes directes permettent d'enregistrer des postes de marché consommés sans passer par une intervention. Les postes validés sont inclus dans les totaux, les états d'avancement et les déclarations de créance." %}

{% for dp in direct_posts %} {% empty %} {% endfor %}
{% translate "N°" %} {% translate "Code" %} {% translate "Description" %} {% translate "Unité" %} {% translate "Prix unit." %} {% translate "Quantité" %} {% translate "Qté facturée" %} {% translate "Montant" %} {% translate "Commentaire" %} {% translate "Statut" %} {% translate "Actions" %}
{{ dp.contract_post.order_number }} {{ dp.contract_post.code }} {% if LANGUAGE_CODE == "nl" %} {{ dp.contract_post.description_nl|default:dp.contract_post.description_fr }} {% else %} {{ dp.contract_post.description_fr|default:dp.contract_post.description_nl }} {% endif %} {{ dp.contract_post.unit }} {{ dp.contract_post.unit_price|floatformat:2 }} € {{ dp.quantity|floatformat:2 }} {{ dp.invoiced_quantity|floatformat:2 }} {{ dp.total_price|floatformat:2 }} € {{ dp.comment|default:"" }} {% if dp.control_status == 'validated' %} {% translate "Approuvé" %} {% if dp.validated_by %}
{{ dp.validated_by.get_full_name }} – {{ dp.validated_at|date:"d/m/Y" }} {% endif %} {% elif dp.control_status == 'refused' %} {% translate "Refusé" %} {% elif dp.control_status == 'invoiced' %} {% translate "Facturé" %} {% else %} {% translate "En attente" %} {% endif %}
{% if can_manage_direct_posts and dp.control_status != 'validated' %} {% if not dp.invoiced_quantity or dp.invoiced_quantity <= 0 %} {% endif %} {% endif %} {% if can_validate_direct_posts %} {% if dp.control_status != 'validated' %} {% endif %} {% if dp.control_status != 'refused' %} {% endif %} {% if dp.control_status != 'pending' %} {% endif %} {% endif %}
{% translate "Aucune commande directe enregistrée." %}
{% if can_manage_direct_posts %} {% endif %}

Interventions

{% if can_add_intervention_for_order %} {% endif %}
{% for intervention in interventions %} {% endfor %}
{% translate "Code" %} {% translate "Titre" %} {% translate "Début" %} {% translate "Statut" %}
{{ intervention.code }} {{ intervention.title }} {{ intervention.begin_time|date:"d-m-Y H:i" }} {{ intervention.get_status_display }}
{% if can_add_intervention_for_order %} {% with order.id|stringformat:"s" as order_id %} {% with extra_query_params='&order_id='|add:order_id|add:'&redirect_to_order=true' %} {% include "home/_intervention_type_modal.html" %} {% endwith %} {% endwith %} {% endif %}
{% endblock %} {% block script %} {{ status_choices|json_script:"status_choices" }} {% endblock script %}