{% load static custom_filters i18n %}
{% if is_duplicata %}
DUPLICATA
{% endif %}

{{ config.nom_entreprise|default:""|upper }}

{% if document_point_de_vente %}
Point de vente : {{ document_point_de_vente.nom }}
{% endif %} {% if document_point_de_vente.adresse %}
Adresse : {{ document_point_de_vente.adresse|linebreaksbr }}
{% endif %}
NIF : {{ config.nif|default:"-" }} · RCCM : {{ config.rccm|default:"-" }}
{% if config.id_nat %}
Id. Nat : {{ config.id_nat }}
{% endif %} {% if config.telephone %}
Tél. : {{ config.telephone }}
{% endif %} {% if config.email %}
{{ config.email }}
{% endif %}
Logo

{{ facture_title }}

N° {{ commande.numero }} {% if is_credit_note %}
Type : {{ commande.avoir_nature_resolue|default:"-" }}{% if commande.avoir_reference_resolue %} · Réf. : {{ commande.avoir_reference_resolue|format_def_code }}{% endif %}
{% if commande.facture_origine %}
Facture source : {{ commande.facture_origine.numero }}
{% endif %} {% if commande.avoir_motif_detail_resolu %}
Motif : {{ commande.avoir_motif_detail_resolu }}
{% endif %} {% endif %}
{{ commande.date_commande|date:"d/m/Y H:i" }}
Opérateur : {{ commande.vendeur.username|default:"-"|upper }}

CLIENT

{% if client %}
NIF : {{ client.nif|default:"-" }}
{% if client.client_type.code == "PP" %}Nom du client :{% else %}Raison sociale :{% endif %} {{ client.nom_complet|default:client.name|default:"Client de passage"|upper }}
Type de client : {% if client.client_type %}{{ client.client_type.name|default:client.client_type.code }}{% if client.client_type.name and client.client_type.code %} ({{ client.client_type.code }}){% endif %}{% else %}-{% endif %}
Adresse : {{ client.adresse|default:client.address|default:"-" }}
Téléphone : {{ client.telephone|default:client.contact|default:"-" }}
Email : {{ client.email|default:"-" }}
{% else %}
NIF : -
Nom du client : CLIENT DE PASSAGE
Type de client : -
Adresse : -
Téléphone : -
Email : -
{% endif %}
{% if commande.commentaire %}
{{ commande.commentaire|linebreaksbr }}
{% endif %} {% for ligne in lignes_facture %} {% empty %}{% endfor %} {% for tax in tax_details %} {% if tax.rate > 0 or tax.display_as_taxable %} {% else %} {% endif %} {% if tax.ts_valeur > 0 %}{% endif %} {% endfor %}
N°DésignationPrix unitaire ({{ mode_dgi_display }})QuantitéMontant ({{ mode_dgi_display }})
{{ forloop.counter }} {{ ligne.produit.nom|default:"" }}{% if ligne.conditionnement_libelle_affiche %} — {{ ligne.conditionnement_libelle_affiche }}{% endif %} [{{ ligne.tax_group_code_affiche|default:"A" }}] [{{ ligne.type_article_code_affiche|default:"BIE" }}]{% if ligne.remise > 0 %}
Remise : -{{ ligne.remise|money:"FC" }}
{% endif %}
{{ ligne.prix_unitaire_affiche|money:"FC" }} {% if is_credit_note %}-{% endif %}{{ ligne.quantite }} {% if is_credit_note %}-{% endif %}{{ ligne.montant_affiche|money:"FC" }}
Aucune ligne
Nombre d'articles : {{ lignes_facture|length }}
H.T. [{{ tax.code }}] Taxable {{ tax.rate|format_amount:2 }}%{% if is_credit_note %}-{% endif %}{{ tax.ht|money:"FC" }}
TVA [{{ tax.code }}] Taxable {{ tax.rate|format_amount:2 }}%{% if is_credit_note %}-{% endif %}{{ tax.tva|money:"FC" }}
Total [{{ tax.code }}] {{ tax.group_display_label }}{% if is_credit_note %}-{% endif %}{{ tax.ht|money:"FC" }}
T.S. [{{ tax.code }}] {{ tax.group_display_label }}{% if is_credit_note %}-{% endif %}{{ tax.ts_valeur|money:"FC" }}
TOTAL TVA{% if is_credit_note %}-{% endif %}{{ total_tva|money:"FC" }}
NET A PAYER (TTC){% if is_credit_note %}-{% endif %}{{ total_ttc|money:"FC" }}
Reste à payer{% if is_credit_note and solde_a_payer %}-{% endif %}{{ solde_a_payer|money:"FC" }}
Arrêtée la présente facture à la somme de :
{{ total_ttc|as_words_be|upper }} FRANCS CONGOLAIS
Modes de paiement : {% for paiement in paiements_document %}{{ paiement.mode_paiement }} : {{ paiement.montant_verse|money:paiement.devise }}{% empty %}{% for payment_mode in credit_note_payment_modes %}{{ payment_mode }}{% empty %}Aucun paiement enregistré{% endfor %}{% endfor %}
Soit {{ commande.montant_total_usd|money:"USD" }} (Taux: {{ taux_change|money:"FC" }}/USD)
{% if donnees_fiscales.code_def_dgi or donnees_fiscales.nim or donnees_fiscales.qr_code %}

-- ELEMENT SECURITE DE LA FACTURE NORMALISEE --

ISF : {{ config.isf_dgi|default:"-" }}
CODE DEF/DGI : {{ donnees_fiscales.code_def_dgi|format_def_code|default:"-" }}
DEF NID : {{ donnees_fiscales.nim|default:"-" }}
DEF Compteurs : {{ donnees_fiscales.counters|default:"-" }}
DEF Heure : {{ donnees_fiscales.date_time|default:"-" }}
{% if donnees_fiscales.qr_code %}QR Code DGI{% endif %}
{% endif %} {% if mcf_modification_security_logs %}

ELEMENTS DE SECURITE DES CORRECTIONS MCF

{% for correction in mcf_modification_security_logs %}
{{ correction.correction_numero|default:"Correction MCF" }} — CODE DEF/DGI : {{ correction.security.code_def_dgi|format_def_code|default:"-" }} · DEF NID : {{ correction.security.nim|default:"-" }} · Compteurs : {{ correction.security.counters|default:"-" }}
{% endfor %}
{% endif %}