From e2d71ec3007e1d1f338ddf91b5a9ed0c3e080172 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 18 Sep 2014 22:57:06 +0000 Subject: facture (18sep14) git-svn-id: svn://tug.org/texlive/trunk@35196 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/xelatex/facture/facture.cls | 45 +++++++++++++---------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'Master/texmf-dist/tex/xelatex/facture') diff --git a/Master/texmf-dist/tex/xelatex/facture/facture.cls b/Master/texmf-dist/tex/xelatex/facture/facture.cls index a0c99ab02c6..5d4a9da116e 100644 --- a/Master/texmf-dist/tex/xelatex/facture/facture.cls +++ b/Master/texmf-dist/tex/xelatex/facture/facture.cls @@ -12,7 +12,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{facture}[2011/09/10 v1.0] -\LoadClass{article}%On se base sur la classe article +\LoadClass[a4paper]{article}%On se base sur la classe article \RequirePackage{fontspec} \RequirePackage{xunicode} \RequirePackage{polyglossia} @@ -22,8 +22,6 @@ \RequirePackage{tikz} % tikz est utilisé pour tracer des boites, par exemple \RequirePackage{graphicx} % Pour insérer des images. Utiliser le format jpg pour plus de simplicité. \RequirePackage{fancyhdr} % Pour entête et pied de page -\RequirePackage[paper=a4paper,top=2 cm, bottom=2 cm, left=1.5 cm, right=2.5 cm]{geometry} % On peut modifier ces valeurs pour augmenter ou réduire les marges. -\RequirePackage{ifthen} \RequirePackage{array} \RequirePackage{longtable} \RequirePackage{colortbl} @@ -37,6 +35,8 @@ \definecolor{encadre}{RGB}{111,111,111} \newcommand{\libelle}[1]{\textcolor{entetes}{\textbf#1}} \setlength{\tabcolsep}{1pt} +\newlength{\epaisseurcadre} +\setlength{\epaisseurcadre}{1.5mm} \newcommand{\codeclient}{Code client :} \newcommand{\datetxt}{Date:} \newcommand{\datelimitetxt}{À payer avant:} @@ -62,20 +62,23 @@ \newcommand{\totTTCtxt}{Total TTC} \newcommand{\postTotaux}{} \fi +\newcommand{\largeurDescriptif}{0.2\textwidth} +\newcommand{\largeurChiffres}{0.2\textwidth} +\newcommand{\largeurChiffresAvecTVA}{0.1\textwidth} \npaddmissingzero \nprounddigits{2} -\gdef\@TVAdefaut{19,6} -\gdef\@type{\facturetxt} +\def\@TVAdefaut{19,6} +\def\@type{\facturetxt} \renewcommand{\date}[1]{\SetDate[#1]} -\newcommand{\TVAdefaut}[1]{\gdef\@TVAdefaut{#1}} -\newcommand{\datelimite}[1]{\newcommand{\@datelimite}{#1}} -\newcommand{\dest}[1]{\newcommand{\@dest}{#1}} -\newcommand{\fact}[1]{\newcommand{\@fact}{#1}} -\newcommand{\adresseemet}[1]{\gdef\@adresseemet{#1}} -\newcommand{\nomemet}[1]{\gdef\@nomemet{#1}} -\newcommand{\type}[1]{\gdef\@type{#1}} -\newcommand{\numero}[1]{\gdef\@numero{#1}} -\newcommand{\codedest}[1]{\gdef\@codedest{#1}} +\newcommand{\TVAdefaut}[1]{\def\@TVAdefaut{#1}} +\newcommand{\datelimite}[1]{\def\@datelimite{#1}} +\newcommand{\dest}[1]{\def\@dest{#1}} +\newcommand{\fact}[1]{\def\@fact{#1}} +\newcommand{\adresseemet}[1]{\def\@adresseemet{#1}} +\newcommand{\nomemet}[1]{\def\@nomemet{#1}} +\newcommand{\type}[1]{\def\@type{#1}} +\newcommand{\numero}[1]{\def\@numero{#1}} +\newcommand{\codedest}[1]{\def\@codedest{#1}} \newcommand{\entete}{ @@ -90,7 +93,7 @@ }; \coordinate[xshift=-1\textwidth,yshift=1ex] (a) at (b.north); \coordinate[xshift=1em,yshift=-1ex] (c) at (b.south); - \draw[color=encadre,line width=1.5mm] (a) rectangle (c); + \draw[color=encadre,line width=\epaisseurcadre] (a) rectangle (c); \end{tikzpicture} \vspace{3ex} @@ -147,11 +150,11 @@ \setlength{\tabcolsep}{0.5em} \arrayrulecolor{encadre} \ifsansTVA% - \begin{longtable}{|p{0.2\textwidth}|P{0.2\textwidth}|P{0.2\textwidth}|P{0.2\textwidth}|P{0.2\textwidth}|}% + \begin{longtable}{|p{\largeurDescriptif}|P{\largeurChiffres}|P{\largeurChiffres}|P{\largeurChiffres}|P{\largeurChiffres}|}% \hline% \rowcolor{entetes}\centering\textbf\produit & \centering\textbf\quantite & \centering\textbf\prixtxt & \centering\textbf\remise & \centering\textbf\tottxt \tabularnewline[1ex]% \else% - \begin{longtable}{|p{0.2\textwidth}|P{0.1\textwidth}|P{0.1\textwidth}|P{0.1\textwidth}|P{0.1\textwidth}|P{0.2\textwidth}|P{0.1\textwidth}|}% + \begin{longtable}{|p{\largeurDescriptif}|P{\largeurChiffresAvecTVA}|P{\largeurChiffresAvecTVA}|P{\largeurChiffresAvecTVA}|P{\largeurChiffresAvecTVA}|P{\largeurChiffres}|P{\largeurChiffresAvecTVA}|}% \hline% \rowcolor{entetes}\centering\textbf\produit & \centering\textbf\quantite & \centering\textbf\prixHT & \centering\textbf\remise & \centering\textbf\totHTtxt & \centering\textbf\TVAtxt & \textbf\prixTTC \tabularnewline[1ex]% \fi% @@ -176,6 +179,7 @@ } \newcommand{\lignesansTVA}[5]{#1 & #2 & #3 & #4 & #5 \tabularnewline[1ex]} + \newcommand{\afficheTVA}[1]{\raggedleft{\numprint[\%]{#1}} \hfill $\triangleright$ \numprint[\unite]{\TVA}} \newcommandx{\ligne}[5][2=1,5=\@TVAdefaut,4=0,usedefault]{% \ifsansTVA @@ -209,11 +213,14 @@ \fi \hline } +\AtBeginDocument{ \pagestyle{fancy} \fancyhf{} \renewcommand{\headrule}{}%Pas de règle après l'entête -\lfoot{\ifnumgreater{\thepage}{1}{\thepage}{}}%Indiquer le numéro de page, sauf sur la première -\newcommand{\pied}[1]{\rfoot{#1}}%Le pied définissable par l'utilisateur +\lfoot{\ifnum \value{page}>1 \thepage\fi}%Indiquer le numéro de page, sauf sur la première +\rfoot{\@pied} +} +\newcommand{\pied}[1]{\def\@pied{#1}}%Le pied définissable par l'utilisateur \endinput %% %% End of file `facture.cls'. -- cgit v1.2.3