nk20/apps/treasury/templates/treasury/invoice_sample.tex

193 lines
5.5 KiB
TeX

{% load escape_tex i18n %}
{% language fr %}
\documentclass[a4paper,11pt]{article}
\usepackage{fontspec}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{fp}
\usepackage{eso-pic}
\usepackage{ifthen}
\def\TVA{0} % Taux de la TVA
\def\TotalHT{0}
\def\TotalTVA{0}
\newcommand{\AjouterProduit}[4]{% Arguments : Désignation, quantité, prix unitaire HT, prix total HT
\FPround{\prix}{#3}{2}
\FPround{\montant}{#4}{2}
\FPadd{\TotalHT}{\TotalHT}{\montant}
}
\newcommand{\AfficheResultat}{%
\ListeProduits
\FPmul{\TotalTVA}{\TotalHT}{\TVA}
\FPdiv{\TotalTVA}{\TotalTVA}{100}
\FPadd{\TotalTTC}{\TotalHT}{\TotalTVA}
\FPround{\TotalHT}{\TotalHT}{2}
\FPround{\TotalTVA}{\TotalTVA}{2}
\FPround{\TotalTTC}{\TotalTTC}{2}
\global\let\TotalHT\TotalHT
\global\let\TotalTVA\TotalTVA
\global\let\TotalTTC\TotalTTC
\cr \hline
Total HT & & & \TotalHT \cr
TVA \TVA~\% & & & \TotalTVA \cr
\hline \hline
\textbf{Total TTC} & & & \TotalTTC
}
\newcommand {\ListeProduits}{
{% for product in products %}
{{ product.designation|escape_tex }} & {{ product.amount_euros }} & {{ product.quantity }} & {{ product.total_euros }} \cr
{% endfor %}
}
% Logo du BDE
\AddToShipoutPicture*{
\put(0,0){
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
\includegraphics[width=\textwidth]{../../apps/treasury/static/img/{{ obj.bde }}_bg.jpg}
\vfill
}
}
}
%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%
% Infos Association
\def\MonNom{{"{"}}{{ obj.my_name|escape_tex }}} % Nom de l'association
\def\MonAdresseRue{{"{"}}{{ obj.my_address_street|escape_tex }}} % Adresse de l'association
\def\MonAdresseVille{{"{"}}{{ obj.my_city|escape_tex }}}
% Informations bancaires de l'association
\def\CodeBanque{{"{"}}{{ obj.bank_code|stringformat:".05d" }}}
\def\CodeGuichet{{"{"}}{{ obj.desk_code|stringformat:".05d" }}}
\def\NCompte{{"{"}}{{ obj.account_number|stringformat:".011d" }}}
\def\CleRib{{"{"}}{{ obj.rib_key|stringformat:".02d" }}}
\def\IBAN{FR76\CodeBanque\CodeGuichet\NCompte\CleRib}
\def\CodeBic{{"{"}}{{ obj.bic }}}
\def\FactureNum {{"{"}}{{ obj.id }}} % Numéro de facture
\def\FactureAcquittee {% if obj.acquitted %} {oui} {% else %} {non} {% endif %} % Facture acquittée : oui/non
\def\Devis {% if obj.quotation %} {oui} {% else %} {non} {% endif %}
% Devis : oui/non
\def\FactureLieu {{"{"}}{{ obj.place|escape_tex }}} % Lieu de l'édition de la facture
\def\FactureDate {{"{"}}{{ obj.date }}} % Date de l'édition de la facture
\def\FacturePaymentDate {{"{"}}{{ obj.payment_date|escape_tex }}} % Date de paiement de la facture
\def\FactureObjet {{"{"}}{{ obj.object|escape_tex }} } % Objet du document
% Description de la facture
\def\FactureDescr {{"{"}}{{ obj.description|escape_tex }}}
% Infos Client
\def\ClientNom{{"{"}}{{ obj.name|escape_tex }}} % Nom du client
\def\ClientAdresse{{"{"}}{{ obj.address|escape_tex }}} % Adresse du client
% Liste des produits facturés : Désignation, quantité, prix unitaire HT
{% for product in products %}
\AjouterProduit{{"{"}}{{ product.designation|escape_tex }}} {{"{"}}{{ product.quantity }}} {{"{"}}{{ product.amount_euros }}} {{"{"}}{{ product.total_euros }}}
{% endfor %}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}
\setlength{\parindent}{1pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
\thispagestyle{fancy}
\pagestyle{fancy}
\setlength{\parindent}{0pt}
\renewcommand{\headrulewidth}{0pt}
\cfoot{
\small{\MonNom ~--~ \MonAdresseRue ~ \MonAdresseVille ~--~ Téléphone : +33(0)7 78 17 22 34\newline
Site web : bde.ens-cachan.fr ~--~ E-mail : tresorerie.bde@lists.crans.org \newline Numéro SIRET : 399 485 838 00029
}
}
\begin{document}
% Logo de la société
% \includegraphics{logo.jpg}
% Nom et adresse de la société
\MonNom \\
\MonAdresseRue \\
\MonAdresseVille \\
\ifthenelse{\equal{\Devis}{oui}}{
Devis n°\FactureNum
}{
Facture n°\FactureNum
}
{\addtolength{\leftskip}{10.5cm} %in ERT
\ClientNom \\
\ClientAdresse \\
} %in ERT
\hspace*{10.5cm}
\FactureLieu, le \FactureDate
~\\~\\
\textbf{Objet : \FactureObjet \\}
\textnormal{\FactureDescr}
~\\
\begin{center}
\begin{tabular}{lrrr}
\textbf{Désignation ~~~~~~} & \textbf{Prix unitaire} & \textbf{Quantité} & \textbf{Montant (EUR)} \\
\hline
\AfficheResultat{}
\end{tabular}
\end{center}
~\\
\ifthenelse{\equal{\FactureAcquittee}{oui}}{
Facture acquittée.
}{
Echéance de paiement : \FacturePaymentDate
Conditions d'escompte : Aucune
Taux de pénalité en cas de non paiement ou retard de paiement : 0 \%
À régler par chèque ou par virement bancaire :
\begin{center}
\begin{tabular}{|c c c c|}
\hline
\textbf{Code banque} & \textbf{Code guichet} & \textbf{N° de Compte} & \textbf{Clé RIB}\\
\CodeBanque & \CodeGuichet & \NCompte & \CleRib \\
\hline
\textbf{IBAN N°} & \multicolumn{3}{|l|} \IBAN \\
\hline
\textbf{Code BIC} & \multicolumn{3}{|l|}\CodeBic \\
\hline
\end{tabular}
\end{center}
}
\begin{center}
TVA non applicable, article 293 B du CGI.
\end{center}
\end{document}
{% endlanguage %}