<style>
.table_detail_document_vente tbody tr {
background-color: white !important;
}
.table_detail_document_vente tbody tr:nth-of-type(2n+1) {
background-color: white !important;
}
.detail_commande thead th {
background-color: #2A3F54 !important;
color:white;
}
.detail_commande tbody tr {
background-color: #f8f8f8 !important;
}
.detail_commande tbody tr:nth-of-type(2n+1) {
background-color: white !important;
}
.detail_commande thead th,.detail_commande thead td {
border-color:transparent;
}
#tableau-panier tbody tr {
background-color: rgba(0,0,0,.05);
background-color: #f5f5f5;
}
#tableau-panier tbody tr:nth-of-type(2n+1) {
background-color: rgba(0,0,0,.05);
background-color: white;
}
</style>
<div style="max-height:600px;overflow-y:auto;border-bottom:2px solid black;">
{% if commande.origine == "ERP" or commande.origineSaisie == "MODIFIE_ERP" %}
<embed src="{{ path('dtc_commande_pdf', {id: commande.id}) }}" type="application/pdf" width="100%" height="800px">
{% else %}
<table id="tableau-panier" class="table table-hover mb-0 _table-striped table-bordered _table-hover">
<thead class="thead">
<tr>
<th style="background:#e2e2e2;vertical-align:middle;width:17%;padding-left:15px;padding-right:15px;">Image</th>
<th style="background:#e2e2e2;padding-right:5px;line-height:20px;">Produit</th>
</tr>
</thead>
<tbody>
{% for p in commande.articleCommande %}
{% include 'GestionComerciale/Panier/ligne_deplier.html.twig' with( {'p': p} )%}
{% endfor %}
</tbody>
</table>
<style>
@media (max-width: 768px) {
.table_detail_document_vente td {
width : 100%;
display: block;
width: 100%;
}
}
</style>
<table style="width:100%;margin-bottom:10px;border:0px;background:white;" class="_table table_detail_document_vente">
<tr style="background-color:transparent;border:0px;padding:10px;">
{% if commande.origine != "ERP" and commande.origineSaisie != "MODIFIE_ERP" %}
<td style="border:0px;">
<div><u>Adresse de livraison</u></div>
<div><b>{{ commande.libelleLivraison }}</b></div>
<div>{{ commande.numeroLivraison }} {{ commande.rueLivraison }}</div>
<div>{{ commande.complementLivraison }}</div>
<div>{{ commande.complementLivraison2 }}</div>
<div>{{ commande.codePostalLivraisonTxt }} {{ commande.villeLivraisonTxt }}</div>
<div>{{ commande.paysLivraisonTxt }}</div>
</td>
<td style="border:0px;">
<div><u>Récapitulatif</u></div>
{% set totalTva = commande.totalTva+commande.TotalTvaFraisPort %}
<div>Transporteur : {{ commande.transporteur.libelle }} ({{ commande.totalFraisPort|price|raw }} € HT)</div>
<div>TOTAL HT : {{ commande.total|price|raw }} €</div>
<div>TVA HT : {{ totalTva|price|raw }} €</div>
<div>TOTAL TTC : {{ commande.totalTtc|price|raw }} €</div>
</td>
{% endif %}
{% if commande.typeDocumentCommercial ==1 %}
<td style="border:0px;">
<ul class="to_do dark">
<li style="padding-top:1px;padding-bottom:1px;padding-left:0px;padding-right:0px;">
<span style="cursor:pointer;padding-top:0px;padding-bottom:0px;" class="open-modal-form dropdown-item" data-link="{{ path ("dtc_devis_transformer_panier", {"id":commande.id,"action":"commander"} ) }}" data-taille="modal-lg" data-target="#blocModal" data-toggle="modal">
<i class="fa fa-shopping-cart"></i> Commander
</span>
</li>
<li style="padding-top:1px;padding-bottom:1px;padding-left:0px;padding-right:0px;">
<span style="cursor:pointer;padding-top:0px;padding-bottom:0px;" class="open-modal-form dropdown-item" data-link="{{ path ("dtc_devis_transformer_panier", {"id":commande.id,"action":"editer"} ) }}" data-taille="modal-lg" data-target="#blocModal" data-toggle="modal">
<i class="fa fa-edit"></i> Éditer
</span>
</li>
<li style="padding-top:1px;padding-bottom:1px;padding-left:0px;padding-right:0px;">
<span style="cursor:pointer;padding-top:0px;padding-bottom:0px;" class="dropdown-item">
<i class="fa fa-envelope"></i> Recevoir devis par email
</span>
</li>
<li style="padding-top:1px;padding-bottom:1px;padding-left:0px;padding-right:0px;">
<span data-link="{{ path ("dtc_contact_modal", {"devis":commande.id} ) }}" class="dropdown-item open-modal-form" data-taille="" data-target="#blocModal" data-toggle="modal" style="cursor:pointer;padding-top:0px;padding-bottom:0px;">
<i class="fa fa-question"></i> Demande d'informations
</span>
</li>
</ul>
</td>
{% endif %}
</tr>
</table>
<table style="width:100%;margin-bottom:0px;" class="off detail_commande table table-bordered ">
{% if 1 == 1 %}
<thead>
<tr>
<th class="{% if mode != "simplifie" %}off{% endif %}">{% trans %}Img{% endtrans %}</th>
<th style="padding-left:20px;">{% trans %}REF{% endtrans %}</th>
<th>{% trans %}DESIGNATION{% endtrans %}</th>
<th class="{% if mode == "simplifie" %}off{% endif %}">{% trans %}PU HT{% endtrans %}</th>
<th class="{% if mode == "simplifie" %}off{% endif %}">{% trans %}TX REMISE{% endtrans %}</th>
<th class="{% if mode == "simplifie" %}off{% endif %}">{% trans %}PU TTC{% endtrans %}</th>
<th>{% trans %}QTE{% endtrans %}</th>
<th class="{% if mode == "simplifie" %}off{% endif %}">{% trans %}TOTAL HT{% endtrans %}</th>
<th class="{% if mode == "simplifie" %}off{% endif %}">{% trans %}TOTAL TTC{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% set colspan = 7 %}
{% for a in commande.articleCommande %}
{% if a.article.estCommentaire %}
<tr>
<td style="padding-left:20px;" colspan="{{ colspan }}">
<b>{{ a.commentaireSuppl }}</b>
</td>
</tr>
{% else %}
{% if commande.typeDocumentCommercial == constant('App\\Model\\GestionCommerciale\\TypeDocumentCommercial::DEVIS') %}
{% set qteDejaLivree = 0 %}
{% else %}
{% set qteDejaLivree = dtc_article.qteDejaLivree2(a) %}
{% endif %}
<tr class="{% if a.quantite == qteDejaLivree and commande.typeDocumentCommercial != 1 %}ligne_livre_totalement{% endif %}">
{% if a.quantite != 0 %}
{% set prixFinal = a.totalHtV2 / a.quantite %}
{% set prixFinal = a.prixBase %}
{% else %}
{% set prixFinal = a.totalHtV2 %}
{% set prixFinal = a.prixBase %}
{% endif %}
{% set prixFinalTtc = prixFinal + (prixFinal * a.tva / 100) %}
{% set totalHtFinal = (a.totalHtV2) %}
{% set totalTtcFinal = a.totalHtV2 + a.tvaVente %}
{% if a.prixUnitaireTtc != '' %}
{% set prixFinalTtc = a.prixUnitaireTtc %}
{% endif %}
{% if a.totalWithTax != '' %}
{% set totalTtcFinal = a.totalWithTax %}
{% endif %}
<td class="text-center {% if mode != "simplifie" %}off{% endif %}">
{% set break_image = false %}
{% set image_trouve = false %}
{% if a.article.images|length > 0 %}
{% for img in a.article.images %}
{% if not break_image %}
{% set chemin_test = kernelRootDir~"/public/"~img.getUploadDir ~ '/' ~ a.article.id ~ '/small/' ~ img.url %}
{% if chemin_test|file_exists == 1 %}
{% set break_image = true %}
{% set image_trouve = true %}
<a data-gallery="" href="{{ asset(img.getUploadDir ~ '/' ~ a.article.id ~ '/large/' ~ img.url) }}">
<img src="{{ asset(img.getUploadDir ~ '/' ~ a.article.id ~ '/medium/' ~ img.url) }}" style="max-width:50px;">
</a>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% if a.article.images|length == 0 or image_trouve == false %}
<span style="font-size:3em;max-width: 50px;display: inline-flex; align-items: center;" class="fa fa-photo"></span>
{% endif %}
</td>
{% set slug = dtc_article.getslugifArticle(a.article) %}
<td style="padding-left:20px;">
<a class="dark" href="{{ path("dtc_article_afficher" , { 'id': a.article.id,'slug':slug }) }}">
{% if a.article.divers == 1 %}
<b>{{ a.article.referenceClient }}</b>
{% else %}
<b>{{ a.article.reference }}</b>
{% endif %}
</a>
</td>
<td>
<a class="dark" href="{{ path("dtc_article_afficher" , { 'id': a.article.id,'slug':slug }) }}">
{{ a.libelle }}
</a>
</td>
<td class="text-right prix {% if mode == "simplifie" %}off{% endif %}">{{ prixFinal|price|raw }} €</td>
<td class="text-right prix {% if mode == "simplifie" %}off{% endif %}">{{ a.remise|price|raw }} %</td>
<td class="text-right prix {% if mode == "simplifie" %}off{% endif %}">{{ prixFinalTtc|price|raw }} €</td>
<td style="text-align:center;">{{ a.quantite }} </td>
<td class="text-right prix {% if mode == "simplifie" %}off{% endif %}">{{ totalHtFinal|price|raw }} €</td>
<td class="text-right prix {% if mode == "simplifie" %}off{% endif %}">{{ totalTtcFinal|price|raw }} €</td>
</tr>
{% endif %}
{% endfor %}
{% if commande.totalFraisPort != 0 and mode != "simplifie" %}
<tr style="{% if mode == "simplifie" %}off{% endif %}">
<td style="padding-left:20px;">{% if commande.transporteur.libelle is defined %}{{ commande.transporteur.libelle }}{% else %}Transporteur{% endif %}</td>
<td></td>
<td class="prix text-right">{{ commande.totalFraisPort|price|raw }} €</td>
<td></td>
<td class="prix text-right">{{ commande.TotalFraisPortTtc|price|raw }} €</td>
<td></td>
<td></td>
<td class="prix text-right">{{ commande.TotalFraisPortTtc|price|raw }} €</td>
</tr>
{% endif %}
{% if commande.fraisPortSupplementaire != 0 and mode != "simplifie" %}
<tr class="{% if mode == "simplifie" %}off{% endif %}">
<td style="padding-left:20px;">Frais de port suppl.</td>
<td></td>
<td></td>
<td></td>
<td class="prix">{{ commande.fraisPortSupplementaire|price|raw }}</td>
<td></td>
<td></td>
<td class="prix">{{ commande.fraisPortSupplementaire|price|raw }}</td>
</tr>
{% endif %}
{% endif %}
</tbody>
</table>
{% endif %}
</div>