summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/facture
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-04-16 22:21:38 +0000
committerKarl Berry <karl@freefriends.org>2017-04-16 22:21:38 +0000
commitca335820d525cec5e0c68237c97333b952e61778 (patch)
treeb026c8d97a2345c850181f65f02fc8e57ad84694 /Master/texmf-dist/tex/xelatex/facture
parent93b672829910ccaed7c6d80cdd9a1530dbe44f27 (diff)
facture (14apr17)
git-svn-id: svn://tug.org/texlive/trunk@43865 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/facture')
-rw-r--r--Master/texmf-dist/tex/xelatex/facture/facture.cls82
1 files changed, 43 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/xelatex/facture/facture.cls b/Master/texmf-dist/tex/xelatex/facture/facture.cls
index 3616a6be70f..83530cfc872 100644
--- a/Master/texmf-dist/tex/xelatex/facture/facture.cls
+++ b/Master/texmf-dist/tex/xelatex/facture/facture.cls
@@ -11,7 +11,7 @@
%% http://creativecommons.org/licenses/by-sa/2.0/fr/
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{facture}[16/01/2015 v1.2]
+\ProvidesClass{facture}[2017/04/12/04 v1.2.2]
\LoadClass[a4paper]{article}%On se base sur la classe article
\RequirePackage{fontspec}
\RequirePackage{xunicode}
@@ -27,8 +27,6 @@
\RequirePackage{colortbl}
\RequirePackage{advdate}%Pour manipuler les dates
\RequirePackage{xargs}%Pour des arguments conditionnels
-\newif\ifsansreduction
-\DeclareOption{sansreduction}{\sansreductiontrue}
\newif\ifsansTVA
\DeclareOption{sansTVA}{\sansTVAtrue}
\newif\ifsansremise
@@ -66,8 +64,14 @@
\newcommand{\postTotaux}{}
\fi
\newcommand{\largeurDescriptif}{0.2\textwidth}
-\newcommand{\largeurChiffres}{0.2\textwidth}
-\newcommand{\largeurChiffresAvecTVA}{0.1\textwidth}
+\newcommand{\largeurTVA}{0.2\textwidth}
+\ifsansremise
+ \newcommand{\largeurChiffresAvecTVA}{\dimexpr (\textwidth-\largeurDescriptif-\largeurTVA)/4\relax}
+ \newcommand{\largeurChiffres}{\dimexpr (\textwidth-\largeurDescriptif)/3 \relax}
+\else
+ \newcommand{\largeurChiffresAvecTVA}{\dimexpr (\textwidth-\largeurDescriptif-\largeurTVA)/5\relax}
+ \newcommand{\largeurChiffres}{\dimexpr (\textwidth-\largeurDescriptif)/4 \relax}
+\fi
\npaddmissingzero
\nprounddigits{2}
\def\@TVAdefaut{19,6}
@@ -94,8 +98,8 @@
\noindent\node (b)[xshift=0.5\textwidth,text width=0.5\textwidth, right]{%
\@adresseemet%
};
- \coordinate[xshift=-1\textwidth,yshift=1ex] (a) at (b.north);
- \coordinate[xshift=1em,yshift=-1ex] (c) at (b.south);
+ \coordinate[xshift=-\textwidth-\epaisseurcadre,yshift=1ex] (a) at (b.north);
+ \coordinate[xshift=-\epaisseurcadre,yshift=-1ex] (c) at (b.south);
\draw[color=encadre,line width=\epaisseurcadre] (a) rectangle (c);
\end{tikzpicture}
@@ -129,8 +133,8 @@
\libelle{{\datetxt}} \today \\
\ifdef{\@numero}{%
\libelle{{\@type\ntxt}} \@numero
+ \\
}{}
- \\
\ifdef{\@codedest}{%
\libelle{{\codeclient}} \@codedest
}{}
@@ -151,14 +155,18 @@
\newenvironment{facture}{%
\setlength{\extrarowheight}{0.5ex}
\setlength{\tabcolsep}{0.5em}
+ \edef\@largeurDescriptif{\dimexpr\largeurDescriptif -2\tabcolsep\relax}
+ \edef\@largeurChiffres{\dimexpr\largeurChiffres -2\tabcolsep\relax}
+ \edef\@largeurTVA{\dimexpr\largeurTVA -2\tabcolsep\relax}
+ \edef\@largeurChiffresAvecTVA{\dimexpr\largeurChiffresAvecTVA -2\tabcolsep\relax}
\arrayrulecolor{encadre}
\ifsansTVA%
\ifsansremise%
\begin{longtable}{%
- |p{\largeurDescriptif}%Descriptif
- |P{\largeurChiffres}%Qt
- |P{\largeurChiffres}%Prix
- |P{\largeurChiffres}|%Total
+ |p{\@largeurDescriptif}%Descriptif
+ |P{\@largeurChiffres}%Qt
+ |P{\@largeurChiffres}%Prix
+ |P{\@largeurChiffres}|%Total
}%
\hline%
\rowcolor{entetes}%
@@ -169,11 +177,11 @@
\tabularnewline[1ex]%
\else%
\begin{longtable}{%
- |p{\largeurDescriptif}%Descriptif
- |P{\largeurChiffres}%Qt
- |P{\largeurChiffres}%Prix
- |P{\largeurChiffres}%Remise
- |P{\largeurChiffres}|%Total
+ |p{\@largeurDescriptif}%Descriptif
+ |P{\@largeurChiffres}%Qt
+ |P{\@largeurChiffres}%Prix
+ |P{\@largeurChiffres}%Remise
+ |P{\@largeurChiffres}|%Total
}%
\hline%
\rowcolor{entetes}%
@@ -187,12 +195,12 @@
\else%
\ifsansremise%
\begin{longtable}{%
- |p{\largeurDescriptif}|%Descriptif
- P{\largeurChiffresAvecTVA}|%Qt
- P{\largeurChiffresAvecTVA}|%HT unitaire
- P{\largeurChiffresAvecTVA}|%Totalht
- P{\largeurChiffresAvecTVA}|%TVA
- P{\largeurChiffresAvecTVA}|%Total TTC
+ |p{\@largeurDescriptif}|%Descriptif
+ P{\@largeurChiffresAvecTVA}|%Qt
+ P{\@largeurChiffresAvecTVA}|%HT unitaire
+ P{\@largeurChiffresAvecTVA}|%Totalht
+ P{\@largeurTVA}|%TVA
+ P{\@largeurChiffresAvecTVA}|%Total TTC
}%
\hline%
\rowcolor{entetes}
@@ -205,13 +213,13 @@
\else%
\begin{longtable}{%
- |p{\largeurDescriptif}|%Descriptif
- P{\largeurChiffresAvecTVA}|%Qt
- P{\largeurChiffresAvecTVA}|%HT unitaire
- P{\largeurChiffresAvecTVA}|%Remise
- P{\largeurChiffresAvecTVA}|%Totalht
- P{\largeurChiffresAvecTVA}|%TVA
- P{\largeurChiffresAvecTVA}|%Total TTC
+ |p{\@largeurDescriptif}|%Descriptif
+ P{\@largeurChiffresAvecTVA}|%Qt
+ P{\@largeurChiffresAvecTVA}|%HT unitaire
+ P{\@largeurChiffresAvecTVA}|%Remise
+ P{\@largeurChiffresAvecTVA}|%Totalht
+ P{\@largeurTVA}|%TVA
+ P{\@largeurChiffresAvecTVA}|%Total TTC
}%
\hline%
\rowcolor{entetes}
@@ -230,18 +238,14 @@
}%
{%
\end{longtable}
- \begin{tikzpicture}
- \draw[color=white] (0,0) circle (0.001);
- \node[right,xshift=0.66\textwidth,text width=0.33\textwidth]{%
\ifsansTVA%
- \hfill \libelle{\tottxt:} \numprint[\unite]{\tot}\\%
+ \noindent\hspace{0.66\textwidth}\hfill \libelle{\tottxt:} \numprint[\unite]{\tot}\\%
\else%
- \libelle{\totHTtxt:}\hfill \numprint[\unite]{\totHT} \\%
- \libelle{\totTVAtxt:}\hfill \numprint[\unite]{\totTVA} \\%
- \libelle{\totTTCtxt:}\hfill \numprint[\unite]{\totTTC} \\
+ \noindent\hspace{0.66\textwidth}\libelle{\totHTtxt:}\hfill \numprint[\unite]{\totHT}\\%
+ \hbox{}\hspace{0.66\textwidth}\libelle{\totTVAtxt:}\hfill \numprint[\unite]{\totTVA}\\%
+ \hbox{}\noindent\hspace{0.66\textwidth}\libelle{\totTTCtxt:}\hfill \numprint[\unite]{\totTTC}\\
\fi
- \postTotaux};
- \end{tikzpicture}
+ \hspace{0.66\textwidth}\postTotaux
}
\newcommand{\lignesansTVA}[5]{