{% if document.type == 'commande' and document.status in ["en-attente","accepté"] %} Bon de commande {% elseif document.type == 'commande' and document.status in ["expédie0","paye","a-payer"] %} Bon de livraison {% elseif document.type == 'facture' %} Facture {% elseif document.type == 'achat' %} BONS D'ACHAT {% elseif document.type == 'reception' %} BONS DE RÉCEPTION {% elseif document.type == 'retour' %} BONS DE RETOUR {% endif %} {{ document.internalnbr }}
En date du : {{ document.createdat|date("m/d/y")}}

SUNSHINE ELEGANCE
{% if document.category == 'client' %}
Réf. client : {{ document.client.username }}

{{ document.client.civility }} {{ document.client.firstname }}
N° téléphone: {{ document.client.phone}}
{% if document.client.secondphone %}
N° téléphone 2: {{ document.client.secondphone}}
{% endif %}
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 %}
{% endif %}

Info de livraison
Société de livraison : {{ document.delivery.name}}
N° suivi colis : {{ document.parceltrackingnbr}}
N° colis : {{ document.packagesnbr}}
{% if document.promisedAt %}
Date de livraison éstimé: {{ document.promisedAt|date("d/m/y") }}
{% endif %}

{% set TotalTTC = 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 %} {% set TotalTTC = TotalTTC +documentdeclinationproduit.totalAmountTtc %} {% endfor %} {% if echangePrds|length %} {% endif %} {% for key, documentdeclinationproduit in document.documentdeclinationproduits|filter(prod => prod.type!= "declinationEchange") %} {% set discountPrd = 0 %} {% set TotalTTC = TotalTTC +documentdeclinationproduit.totalAmountTtc %} {% endfor %} {% set discount = (document.discountType=='percent')?((TotalTTC * document.discount)/100):document.discount %} {# #} {# #} {# #} {# #} {# #} {# #} {# #} {# #}
Image Nom Description Qte Remise TTC
Liste des articles retournés
{% set picture = absolute_url(asset('/images/galery_placeholder_200.png')) %} {% for image in documentdeclinationproduit.produitdeclinationvalue.picture %} {% if image.isselected %} {% set picture = app.request.getschemeandhttphost() ~ vich_uploader_asset(image, 'file') %} {% endif %} {% endfor %} {{ documentdeclinationproduit.reference }} {{ documentdeclinationproduit.description }} {{ documentdeclinationproduit.quantity }} {{ documentdeclinationproduit.discount|number_format(3,',','') }} {% if documentdeclinationproduit.discountType == 'percent' %} % {% set discountPrd = (documentdeclinationproduit.priceHT * documentdeclinationproduit.discount) /100 %} {% else %} TND {% set discountPrd = documentdeclinationproduit.discount %} {% endif %} {% set discountPrdTotal = discountPrdTotal + discountPrd %} {{ documentdeclinationproduit.totalAmountTtc|number_format(3,',','') }} TND
liste des articles de l'echange
{% set picture = absolute_url(asset('/images/galery_placeholder_200.png')) %} {% for image in documentdeclinationproduit.produitdeclinationvalue.picture %} {% if image.isselected %} {% set picture = app.request.getschemeandhttphost() ~ vich_uploader_asset(image, 'file') %} {% endif %} {% endfor %} {{ documentdeclinationproduit.reference }} {{ documentdeclinationproduit.description }} {{ documentdeclinationproduit.quantity }} {{ documentdeclinationproduit.discount|number_format(3,',','') }} {% if documentdeclinationproduit.discountType == 'percent' %} % {% set discountPrd = (documentdeclinationproduit.priceHT * documentdeclinationproduit.discount) /100 %} {% else %} TND {% set discountPrd = documentdeclinationproduit.discount %} {% endif %} {% set discountPrdTotal = discountPrdTotal + discountPrd %} {{ documentdeclinationproduit.totalAmountTtc|number_format(3,',','') }}TND
frais de port{{ document.delivery.name }}1{{ document.deliverydiscount }} {% if document.deliverydiscounttype == 'percent' %}%{% else %}tnd{% endif %}{{ document.deliverytotal }}
{% if document.documentcomments is not empty %} {% for key, documentcomment in document.documentcomments %}
{{ documentcomment.description }}
{% endfor %} {% endif %}
{% if document.totalTva is not null %} {% endif %}
Total HT {{ document.totalAmountHt |number_format(3,',','') }}TND
Total TVA {{ document.totalTva|number_format(3,',','') }} TND
Total TTC {{ (document.totalAmountHt+document.totalTva)|number_format(3,',','') }} TND
Remise {% if document.discountType=='percent' %} ({{ document.discount ~ "%" }}) {{ (discount + discountPrdTotal)|number_format(3,',','') }} TND
Frais de port {{ document.deliveryTotal|number_format(3,',','') }}TND
Net a Payer {{ document.totalAmountTtc|number_format(3,',','') }} TND
{% else %}
Total HT {{ ((document.totalAmountTtc - document.deliveryTotal)/1.19)|number_format(3,',','') }} TND
Total TVA (19%) {{ (((document.totalAmountTtc - document.deliveryTotal)/1.19)*0.19)|number_format(3,',','') }} TND
Total TTC {{ (document.totalAmountTtc - document.deliveryTotal)|number_format(3,',','') }} TND
Frais de port {{ document.deliveryTotal|number_format(3,',','') }} TND
Net a Payé {{ document.totalAmountTtc|number_format(3,',','') }} TND
{% endif %}
{% set company = Globals.getCompany() %}
{% if company.name %}{{ company.name }}{% endif %} {% if company.address %} {% if company.name %} - {% endif %}{{ company.address }} {% endif %}
{% if company.tvaCode %}
TVA : {{ company.tvaCode }}
{% endif %} {% set contactPhones = [] %} {% if company.phone %}{% set contactPhones = contactPhones|merge([company.phone]) %}{% endif %} {% if company.mobile %}{% set contactPhones = contactPhones|merge([company.mobile]) %}{% endif %} {% if contactPhones|length or company.mail or company.website %}
{% if contactPhones|length %} Tel : {{ contactPhones|join(' | ') }} {% endif %} {% if company.mail %} {% if contactPhones|length %} | {% endif %}email : {{ company.mail }} {% endif %} {% if company.website %} {% if contactPhones|length or company.mail %} | {% endif %}Site internet : {{ company.website }} {% endif %}
{% endif %}