Fixe la génération du code LaTeX

This commit is contained in:
Paul Schneider 2016-11-10 01:03:49 +01:00
commit 5b19cb2984
2 changed files with 77 additions and 17 deletions

View file

@ -69,28 +69,28 @@
\def\FactureNum {@Model.Id.ToString()} % Numéro de facture
\def\FactureAcquittee {non} % Facture acquittée : oui/non
\def\FactureLieu {@proaddrn} % Lieu de l'édition de la facture
\def\FactureObjet {Facture : @Model.Title} % Objet du document
\def\FactureObjet {Facture : @TeXHelpers.ToTeX(Model.Title)} % Objet du document
% Description de la facture
\def\FactureDescr {
@Model.Description
@TeXHelpers.ToTeX(Model.Description)
}
% Infos Client
\def\ClientNom{@to.UserName} % Nom du client
\def\ClientNom{@TeXHelpers.ToTeX(to.UserName)} % Nom du client
\def\ClientAdresse{
% Adresse du client
@if (!string.IsNullOrWhiteSpace(PostalAddress)) {
<text> @PostalAddress\\</text> }
<text> @TeXHelpers.ToTeX(PostalAddress)\\</text> }
@if (!string.IsNullOrWhiteSpace(to.PhoneNumber)) {<text>
@to.PhoneNumber <text>\\</text>
@TeXHelpers.ToTeX(to.PhoneNumber)<text>\\</text>
</text>}
E-mail: @to.Email
E-mail: @TeXHelpers.ToTeX(to.Email)
}
% Liste des produits facturés : Désignation, prix
@if (Model.Bill!=null) { foreach (CommandLine line in Model.Bill) {
<text>\AjouterService{@line.Description}{@line.Count}{@line.UnitaryCost.ToString("F2",CultureInfo.InvariantCulture)}
<text>\AjouterService{@TeXHelpers.ToTeX(line.Description)}{@line.Count}{@line.UnitaryCost.ToString("F2",CultureInfo.InvariantCulture)}
</text>} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -106,24 +106,24 @@
\setlength{\parindent}{0pt}
\renewcommand{\headrulewidth}{0pt}
\cfoot{ @if (!string.IsNullOrWhiteSpace(from.UserName)) { @from.UserName }
@if (!string.IsNullOrWhiteSpace(proaddrm)) { <text> - @proaddrm </text> } \newline
\small{ E-mail: @from.Email
@if (!string.IsNullOrWhiteSpace(from.PhoneNumber)) { <text> - Téléphone fixe: @from.PhoneNumber </text> }
\cfoot{ @TeXHelpers.ToTeX(from.UserName) @if (!string.IsNullOrWhiteSpace(proaddrm)) { <text> - @TeXHelpers.ToTeX(proaddrm) </text> } \newline
\small{ E-mail: @TeXHelpers.ToTeX(from.Email) @if (!string.IsNullOrWhiteSpace(from.PhoneNumber)) { <text> - Téléphone fixe: @TeXHelpers.ToTeX(from.PhoneNumber) </text> }
}
}
\begin{document}
% Logo de la société
@if (from.Avatar != null) {<text>
\includegraphics{@from.Avatar}</text>
} else { <text>
%\includegraphics{logo.png}</text>
@if (from.Avatar != null) {
<text>\includegraphics{@from.Avatar}
</text>
} else {
<text>%\includegraphics{logo.png}
</text>
}
% Nom et adresse de la société
@from.UserName \\
@proaddrn
@TeXHelpers.ToTeX(from.UserName) \\
@TeXHelpers.ToTeX(proaddrn)
Facture n°\FactureNum