{% set TotalTTC = 0 %} {% set TotalHT = 0 %} {% set discountPrdTotal = 0 %} {% set echangePrds = document.documentdeclinationproduits|filter(prod => prod.type == "declinationEchange") %} {% if echangePrds|length %} {% endif %} {% for key, documentdeclinationproduit in echangePrds %} {% set discountPrd = 0 %} {% endfor %} {% if echangePrds|length %} {% endif %} {% for key, documentdeclinationproduit in document.documentdeclinationproduits|filter(prod => prod.type!= "declinationEchange") %} {% set discountPrd = 0 %} {% set discountPrd =(documentdeclinationproduit.discountType == 'percent')? (documentdeclinationproduit.priceHT * documentdeclinationproduit.discount) /100 : documentdeclinationproduit.discount %} {% set discountPrdTotal = discountPrdTotal + (discountPrd *documentdeclinationproduit.quantity) %} {% set TotalTTC = TotalTTC + documentdeclinationproduit.totalAmountTtc + (discountPrd *documentdeclinationproduit.quantity) %} {% endfor %} {% set discount = (document.discountType=='percent')?((TotalTTC * document.discount)/100):document.discount %}
{##}

{% if document.type == 'echange' and document.status in ["en-attente","accepte"] %} BON D'ECHANGE {% elseif document.type == 'facture' %} Facture {% elseif document.type == 'achat' %} BON D'ACHAT {% elseif document.type == 'reception' %} BON DE RÉCEPTION {% elseif document.type == 'retour' %} BON DE RETOUR {% elseif document.type == 'commande' and document.status in ["en-attente","accepte"] %} Bon de commande {% else %} BON de livraison {% endif %}

N° : {{ document.internalnbr }}
Date: {{ document.createdat|date("d/m/Y")}}
{{ company.name | upper}}
ETABLISSEMENT INSCRIT AU REGISTRE DE COMMERCE. M.F {{ company.tvaCode ?: '-' }}
{{ company.address }}
Tél : {{ company.phone }}
Email: {{ company.mail }}
Site Web: {{ company.website}}
CLIENT :

{{ document.client.civility }} {{ document.client.firstname }}
Adresse : {{ document.adress }} {% if document.client.region not in document.adress %} {{ document.client.region }}{% endif %} {% if document.client.city not in document.adress %} {{ document.client.city }}{% endif %} {% if document.client.country not in document.adress %} {{ document.client.country }}{% endif %}
Tél : {{ document.client.phone}} {% if document.client.secondphone %} | {{ document.client.secondphone}}{% endif %}
NATURE ET MOYEN DE LIVRAISON SUIVI DE LA LIVRAISON
Société de livraison : {{ document.delivery.name}} NBR DE COLIS : {{ document.packagesNbr}}
ADRESSE : {{ document.delivery.address}} N° DES COLIS : {{ document.parcelTrackingNbr}}
.M.F : {{ document.delivery.tva}} Tél : {{ document.delivery.phone}}
Image Référence Description Qte PU.HT TTC
Liste des articles retournés
{#{% set picture = absolute_url(asset('/images/galery_placeholder_200.png')) %}#} {% set picture = publicPath ~ '/images/galery_placeholder_200.png' %} {% for image in documentdeclinationproduit.produitdeclinationvalue.picture %} {% if image.isselected %} {#{% set picture = app.request.getschemeandhttphost() ~ '/images/web/' ~ image.imageName %}#} {% set picture = publicPath ~ '/images/web/' ~ image.imageName %} {% endif %} {% endfor %} {{ documentdeclinationproduit.reference }} {{ documentdeclinationproduit.description }} {{ documentdeclinationproduit.quantity }} {% if documentdeclinationproduit.priceHT == documentdeclinationproduit.totalAmountTtc %} {% set TotalHT = TotalHT - (documentdeclinationproduit.priceHT / (1.19)) %} {{ (documentdeclinationproduit.priceHT / (1.19)) |number_format(3,',','') }} {% else %} {% set TotalHT = TotalHT - (documentdeclinationproduit.priceHT ) %} {{ documentdeclinationproduit.priceHT|number_format(3,',','') }} {% endif %} TND {% set discountPrd = (documentdeclinationproduit.discountType == 'percent')? (documentdeclinationproduit.priceHT * documentdeclinationproduit.discount) /100 : documentdeclinationproduit.discount %} {% set discountPrdTotal = discountPrdTotal + discountPrd %} {{ documentdeclinationproduit.totalAmountTtc|number_format(3,',','') }} TND {% set TotalTTC = TotalTTC - documentdeclinationproduit.totalAmountTtc %}
liste des articles de l'echange
{#{% set picture = absolute_url(asset('/images/galery_placeholder_200.png')) %}#} {% set picture = publicPath ~ '/images/galery_placeholder_200.png' %} {% for image in documentdeclinationproduit.produitdeclinationvalue.picture %} {% if image.isselected %} {#{% set picture = app.request.getschemeandhttphost() ~ '/images/web/' ~ image.imageName %}#} {% set picture = publicPath ~ '/images/web/' ~ image.imageName %} {% endif %} {% endfor %} {{ documentdeclinationproduit.reference }} {% if (documentdeclinationproduit.discount > 0) %}
(Remise de {{ documentdeclinationproduit.discount }} {{ (documentdeclinationproduit.discountType == 'percent')?"%":"TND" }}) {% endif %}
{{ documentdeclinationproduit.description }} {{ documentdeclinationproduit.quantity }} {% if documentdeclinationproduit.priceHT == (documentdeclinationproduit.totalAmountTtc+(discountPrd *documentdeclinationproduit.quantity)) %} {% set TotalHT = TotalHT + (documentdeclinationproduit.priceHT / (1.19)) %} {{ (documentdeclinationproduit.priceHT / (1.19)) |number_format(3,',','') }} {% else %} {% set TotalHT = TotalHT + documentdeclinationproduit.priceHT %} {{ documentdeclinationproduit.priceHT|number_format(3,',','') }} {% endif %} TND {{ (documentdeclinationproduit.totalAmountTtc +(discountPrd *documentdeclinationproduit.quantity)) |number_format(3,',','') }}TND
Total HT {{ TotalHT |number_format(3,',','') }}TND
Total TVA {{ (TotalTTC-TotalHT) |number_format(3,',','') }} TND
Total TTC {{ TotalTTC |number_format(3,',','') }} TND
Remise {% if document.discountType=='percent' %}({{ document.discount ~ "%" }}){% endif %} {% if document.totalAmountTtc == (TotalTTC+ document.deliveryTotal -(discount + discountPrdTotal)) %} {{ (discount + discountPrdTotal)|number_format(3,',','') }} {% else %} {{ (TotalTTC + document.deliveryTotal-document.totalAmountTtc) | number_format(3,',','') }} {% endif %} TND
Frais de port {{ document.deliveryTotal|number_format(3,',','') }}TND
Net a Payer {{ document.totalAmountTtc|number_format(3,',','') }} TND