estimate to LaTeX

This commit is contained in:
Paul Schneider 2016-11-06 02:03:36 +01:00
commit d1ae27074e
29 changed files with 1294 additions and 148 deletions

View file

@ -35,6 +35,10 @@
</dl>
</div>
<p>
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
<a asp-action="Index">Back to List</a>
<a asp-action="Edit" asp-route-id="@Model.Id">@SR["Edit"]</a> |
<a asp-action="Index">@SR["Back to List"]</a> |
@{ var filenametex = $"estimate-{Model.Id}.tex" ;
var filenamepdf = $"estimate-{Model.Id}.pdf" ;}
<a href="~/do/@filenametex" >Export au format LaTeX</a>
<a href="~/do/@filenamepdf" >Export au format LaTeX</a>
</p>

View file

@ -1,9 +1,14 @@
@model Estimate
@using Yavsc.Helpers
@{
Layout = null;
var pro = Model.Query.PerformerProfile;
var from = Model.Query.PerformerProfile.Performer;
var to = Model.Query.Client;
var PostalAddress = (to.PostalAddress!=null) ? to.PostalAddress.Address.Replace("\n","\\\\\n") : null ;
var proaddr = Model.Query?.PerformerProfile.OrganizationAddress.Address;
var proaddrn = (proaddr!=null) ? proaddr.NewLinesWith("\\\\\n") : null ;
var proaddrm = (proaddr!=null) ? proaddr.NewLinesWith(" - ") : null ;
}
\documentclass[french,11pt]{article}
\usepackage{babel}
@ -62,7 +67,7 @@
\def\FactureNum {@Model.Id.ToString()} % Numéro de facture
\def\FactureAcquittee {non} % Facture acquittée : oui/non
\def\FactureLieu {@Model.Query.PerformerProfile.OrganizationAddress} % Lieu de l'édition de la facture
\def\FactureLieu {@proaddrn} % Lieu de l'édition de la facture
\def\FactureObjet {Facture : @Model.Title} % Objet du document
% Description de la facture
\def\FactureDescr {
@ -70,18 +75,16 @@
}
% Infos Client
\def\ClientNom{@ViewBag.To.UserName} % Nom du client
\def\ClientNom{@to.UserName} % Nom du client
\def\ClientAdresse{
% Adresse du client
@if (ViewBag.To.PostalAddress!=null) {
@ViewBag.To.PostalAddress.Address.Replace("\n","\\\\\n")
}
@if (!string.IsNullOrWhiteSpace(ViewBag.To.PhoneNumber)) {<text>
\\ Téléphone fixe: @ViewBag.To.PhoneNumber
@if (!string.IsNullOrWhiteSpace(PostalAddress)) {
<text> @PostalAddress\\</text> }
@if (!string.IsNullOrWhiteSpace(to.PhoneNumber)) {<text>
@to.PhoneNumber <text>\\</text>
</text>}
@if (!string.IsNullOrWhiteSpace(ViewBag.To.Email)) {<text>
\\ E-mail: @ViewBag.To.Email </text>}
E-mail: @to.Email
}
% Liste des produits facturés : Désignation, prix
@ -106,12 +109,10 @@
\setlength{\parindent}{0pt}
\renewcommand{\headrulewidth}{0pt}
\cfoot{
@if (!string.IsNullOrWhiteSpace(ViewBag.From.UserName)) { @ViewBag.From.UserName }
@if (!string.IsNullOrWhiteSpace(ViewBag.From.PostalAddress)) { <text> - @ViewBag.From.PostalAddress.Address </text> } } \newline
\small{
@if (!string.IsNullOrWhiteSpace(ViewBag.From.Email)) { <text> E-mail: @ViewBag.From.Email </text> }
@if (!string.IsNullOrWhiteSpace(ViewBag.From.PhoneNumber)) { <text> - Téléphone fixe: @ViewBag.From.PhoneNumber </text> }
\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> }
}
}
@ -125,7 +126,7 @@
}
% Nom et adresse de la société
@from.UserName \\
@pro.OrganizationAddress.Address
@proaddrn
Facture n°\FactureNum

View file

@ -1,91 +0,0 @@
\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
\thispagestyle{fancy}
\pagestyle{fancy}
\setlength{\parindent}{0pt}
\renewcommand{\headrulewidth}{0pt}
\cfoot{
@if (!string.IsNullOrWhiteSpace(ViewBag.From.Name)) { @ViewBag.From.Name }
@if (!string.IsNullOrWhiteSpace(ViewBag.From.Address)) { <text> - @ViewBag.From.Address </text> }
@if (!string.IsNullOrWhiteSpace(ViewBag.From.CityAndState)) { <text> - @ViewBag.From.CityAndState </text> } \newline
\small{
@if (!string.IsNullOrWhiteSpace(ViewBag.From.Email)) { <text> E-mail: @ViewBag.From.Email </text> }
@if (!string.IsNullOrWhiteSpace(ViewBag.From.Mobile)) { <text> - Téléphone mobile: @ViewBag.From.Mobile </text> }
@if (!string.IsNullOrWhiteSpace(ViewBag.From.Phone)) { <text> - Téléphone fixe: @ViewBag.From.Phone </text> }
}
}
\begin{document}
% Logo de la société
%\includegraphics{logo.jpg}
% Nom et adresse de la société
from.Name \\
from.Address \\
from.ZipCode from.CityAndState\\
Facture n°\FactureNum
{\addtolength{\leftskip}{10.5cm} %in ERT
\textbf{\ClientNom} \\
\ClientAdresse \\
} %in ERT
\hspace*{10.5cm}
\FactureLieu, le \today
~\\~\\
\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}
\begin{flushright}
\textit{Auto entreprise en franchise de TVA}\\
\end{flushright}
~\\
\ifthenelse{\equal{\FactureAcquittee}{oui}}{
Facture acquittée.
}{
À régler par chèque ou par virement bancaire :
\begin{center}
\begin{tabular}{|c c c c|}
if (!string.IsNullOrWhiteSpace(from.BankCode) && !string.IsNullOrWhiteSpace(from.WicketCode)
&& !string.IsNullOrWhiteSpace(from.AccountNumber) ) {
\hline \textbf{Code banque} & \textbf{Code guichet} & \textbf{N° de Compte} & \textbf{Clé RIB} \\
from.BankCode & from.WicketCode & from.AccountNumber & from.BankedKey \\
}
if (!string.IsNullOrWhiteSpace(from.IBAN) && !string.IsNullOrWhiteSpace(from.BIC)) {
\hline \textbf{IBAN N°} & \multicolumn{3}{|l|}{ from.IBAN } \\
\hline \textbf{Code BIC} & \multicolumn{3}{|l|}{ from.BIC }
} \\
\hline
\end{tabular}
\end{center}
}
\end{document}

View file

@ -0,0 +1,65 @@
@model Yavsc.ViewModels.Manage.AddBankInfoViewModel
@{
ViewData["Title"] = SR["Fill in your Bank Info"];
}
<h2>@ViewData["Title"].</h2>
<form asp-controller="Manage" asp-action="AddBankInfo" method="post" class="form-horizontal" role="form">
<h4>Vous pouvez valider vos coordonnée bancaire ci après.</h4>
<hr />
<div asp-validation-summary="ValidationSummary.All" class="text-danger"></div>
<fieldset>
<div class="form-group">
<label asp-for="Data.BIC" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Data.BIC" class="form-control" />
<span asp-validation-for="Data.BIC" class="text-danger"></span>
</div>
<label asp-for="Data.IBAN" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Data.IBAN" class="form-control" />
<span asp-validation-for="Data.IBAN" class="text-danger"></span>
</div>
</div>
</fieldset>
<fieldset>
<div class="form-group">
<label asp-for="Data.AccountNumber" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Data.AccountNumber" class="form-control" />
<span asp-validation-for="Data.AccountNumber" class="text-danger"></span>
</div>
<label asp-for="Data.BankCode" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Data.BankCode" class="form-control" />
<span asp-validation-for="Data.BankCode" class="text-danger"></span>
</div>
<label asp-for="Data.WicketCode" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Data.WicketCode" class="form-control" />
<span asp-validation-for="Data.WicketCode" class="text-danger"></span>
</div>
<label asp-for="Data.BankedKey" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Data.BankedKey" class="form-control" />
<span asp-validation-for="Data.BankedKey" class="text-danger"></span>
</div>
</div>
</fieldset>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<button type="submit" class="btn btn-default">Enregistrer ces informations bancaires</button>
</div>
</div>
</form>
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}

View file

@ -28,12 +28,11 @@
else
{<a asp-controller="Manage"
asp-action="SetPassword">@SR["Create"]</a>}]</dd>
<dt>@SR["External Logins"]:</dt>
<dd>
@Model.Logins.Count [<a asp-controller="Manage" asp-action="ManageLogins">@SR["Manage"]</a>]
</dd>
<dt>@SR["Full name"]:</dt>
<dd>@Model.FullName [<a asp-controller="Manage" asp-action="SetFullName"
@ -56,7 +55,11 @@
[<a asp-controller="Manage" asp-action="SetActivity"
>@SR[@Model.Activity==null?"Set":"Modify settings"]</a>]
</dd>
<dt>@SR["Bank info"]:</dt>
<dd>@Html.DisplayFor(m => m.BankInfo) [<a asp-controller="Manage" asp-action="AddBankInfo"
>@SR[@Model.BankInfo==null?"Set":"Modify"]</a>]</dd>
<dt>@SR["YourPosts"]:</dt>
<dd>@Model.PostsCounter
[<a asp-controller="Blogspot" asp-action="UserPosts"