WIP estimate tex
This commit is contained in:
parent
1b2b2ba612
commit
4abf8db596
5 changed files with 155 additions and 31 deletions
|
|
@ -32,7 +32,10 @@ namespace Yavsc.Controllers
|
||||||
public IActionResult Index()
|
public IActionResult Index()
|
||||||
{
|
{
|
||||||
var uid = User.GetUserId();
|
var uid = User.GetUserId();
|
||||||
return View(_context.Estimates.Where(
|
return View(_context.Estimates.Include(e=>e.Query)
|
||||||
|
.Include(e=>e.Query.PerformerProfile)
|
||||||
|
.Include(e=>e.Query.PerformerProfile.Performer)
|
||||||
|
.Where(
|
||||||
e=>e.OwnerId == uid || e.ClientId == uid
|
e=>e.OwnerId == uid || e.ClientId == uid
|
||||||
).ToList());
|
).ToList());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,13 +89,22 @@ namespace Yavsc.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
[Produces("text/x-tex"), Authorize,
|
[Produces("text/x-tex"), Authorize,
|
||||||
Route("Release/Estimate-{id}.tex")]
|
Route("estimate-{id}.tex")]
|
||||||
public Estimate Estimate(long id)
|
public ViewResult Estimate(long id)
|
||||||
{
|
{
|
||||||
var estimate = _context.Estimates.Include(x=>x.Query).
|
var estimate = _context.Estimates.Include(x=>x.Query)
|
||||||
Include(x=>x.Query.Client).FirstOrDefault(x=>x.Id==id);
|
.Include(x=>x.Query.Client)
|
||||||
var adc = estimate.Query.Client.UserName;
|
.Include(x=>x.Query.PerformerProfile)
|
||||||
return estimate;
|
.Include(x=>x.Query.PerformerProfile.OrganizationAddress)
|
||||||
|
.Include(x=>x.Query.PerformerProfile.Performer)
|
||||||
|
.Include(e=>e.Bill).FirstOrDefault(x=>x.Id==id);
|
||||||
|
// var poa = estimate.Query.PerformerProfile.OrganizationAddress;
|
||||||
|
// var adc = estimate.Query.Client.UserName;
|
||||||
|
ViewBag.From = estimate.Query.PerformerProfile.Performer;
|
||||||
|
ViewBag.To = estimate.Query.Client;
|
||||||
|
Response.ContentType = "text/x-tex";
|
||||||
|
// estimate.Query.Client.PostalAddress.
|
||||||
|
return View("Estimate.tex", estimate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -20,6 +20,15 @@
|
||||||
<th>
|
<th>
|
||||||
@Html.DisplayNameFor(model => model.Title)
|
@Html.DisplayNameFor(model => model.Title)
|
||||||
</th>
|
</th>
|
||||||
|
<th>
|
||||||
|
@Html.DisplayNameFor(model => model.Query.Client)
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
@SR["Performer"]
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
@SR["Id"]
|
||||||
|
</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
@ -34,6 +43,15 @@
|
||||||
<td>
|
<td>
|
||||||
@Html.DisplayFor(modelItem => item.Title)
|
@Html.DisplayFor(modelItem => item.Title)
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Query.Client.UserName)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Query.PerformerProfile.Performer.UserName)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Id)
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
@model Estimate
|
@model Estimate
|
||||||
|
@{
|
||||||
|
Layout = null;
|
||||||
|
}
|
||||||
\documentclass[french,11pt]{article}
|
\documentclass[french,11pt]{article}
|
||||||
\usepackage{babel}
|
\usepackage{babel}
|
||||||
\usepackage[T1]{fontenc}
|
\usepackage[T1]{fontenc}
|
||||||
|
|
@ -53,14 +55,11 @@
|
||||||
|
|
||||||
\newcommand{\ListeProduits}{}
|
\newcommand{\ListeProduits}{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
\def\FactureNum {@Model.Id.ToString()} % Numéro de facture
|
\def\FactureNum {@Model.Id.ToString()} % Numéro de facture
|
||||||
\def\FactureAcquittee {non} % Facture acquittée : oui/non
|
\def\FactureAcquittee {non} % Facture acquittée : oui/non
|
||||||
\def\FactureLieu {@Model.Command.Performer.PostalAddress} % Lieu de l'édition de la facture
|
\def\FactureLieu {@Model.Query.PerformerProfile.OrganizationAddress} % Lieu de l'édition de la facture
|
||||||
\def\FactureObjet {Facture : @Model.Title} % Objet du document
|
\def\FactureObjet {Facture : @Model.Title} % Objet du document
|
||||||
% Description de la facture
|
% Description de la facture
|
||||||
\def\FactureDescr {
|
\def\FactureDescr {
|
||||||
|
|
@ -68,27 +67,33 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
% Infos Client
|
% Infos Client
|
||||||
\def\ClientNom{@Model.Command.Client.Name} % Nom du client
|
\def\ClientNom{@ViewBag.To.UserName} % Nom du client
|
||||||
\def\ClientAdresse{% % Adresse du client
|
|
||||||
@if (!string.IsNullOrWhiteSpace(Model.Command.Client.PostalAddress.Address)) {
|
|
||||||
@string.Split("\n",Model.Command.Client.PostalAddress.Address).Join("\\\\\n")
|
|
||||||
}
|
|
||||||
if (!string.IsNullOrWhiteSpace(@Model.Command.Client.PhoneNumber)) {
|
|
||||||
Téléphone fixe: @Model.Command.Client.PhoneNumber \\
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(eto)) {
|
\def\ClientAdresse{
|
||||||
E-mail: @Model.Command.Client.Email }
|
% 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
|
||||||
|
</text>}
|
||||||
|
@if (!string.IsNullOrWhiteSpace(ViewBag.To.Email)) {<text>
|
||||||
|
\\ E-mail: @ViewBag.To.Email </text>}
|
||||||
}
|
}
|
||||||
|
|
||||||
% Liste des produits facturés : Désignation, prix
|
% Liste des produits facturés : Désignation, prix
|
||||||
|
|
||||||
@foreach (CommandLine line in Model.Command.Bill) {
|
@if (Model.Bill!=null) {
|
||||||
\AjouterService { @line.Article.Name - @line.Comment (Ref:YPR@line.Article.Id) } {@line.Count} {@line.UnitaryCost}
|
foreach (CommandLine line in Model.Bill) {
|
||||||
}
|
<text>
|
||||||
|
\AjouterService {@line.Description} {@line.Count} {@line.UnitaryCost}
|
||||||
|
</text>
|
||||||
|
} }
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}
|
\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}
|
||||||
\setlength{\parindent}{0pt}
|
\setlength{\parindent}{0pt}
|
||||||
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
|
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
|
||||||
|
|
@ -99,13 +104,11 @@ if (!string.IsNullOrWhiteSpace(eto)) {
|
||||||
|
|
||||||
\renewcommand{\headrulewidth}{0pt}
|
\renewcommand{\headrulewidth}{0pt}
|
||||||
\cfoot{
|
\cfoot{
|
||||||
@if (!string.IsNullOrWhiteSpace(from.Name)) { from.Name }
|
@if (!string.IsNullOrWhiteSpace(ViewBag.From.UserName)) { @ViewBag.From.UserName }
|
||||||
@if (!string.IsNullOrWhiteSpace(from.Address)) { @"-" @from.Address }
|
@if (!string.IsNullOrWhiteSpace(ViewBag.From.PostalAddress)) { <text> - @ViewBag.From.PostalAddress.Address </text> } } \newline
|
||||||
@if (!string.IsNullOrWhiteSpace(from.CityAndState)) { @"-" @from.CityAndState } \newline
|
|
||||||
\small{
|
\small{
|
||||||
@if (!string.IsNullOrWhiteSpace(efrom)) { E-mail: efrom }
|
@if (!string.IsNullOrWhiteSpace(ViewBag.From.Email)) { <text> E-mail: @ViewBag.From.Email </text> }
|
||||||
@if (!string.IsNullOrWhiteSpace(from.Mobile)) { @"-" Téléphone mobile: @from.Mobile }
|
@if (!string.IsNullOrWhiteSpace(ViewBag.From.PhoneNumber)) { <text> - Téléphone fixe: @ViewBag.From.PhoneNumber </text> }
|
||||||
@if (!string.IsNullOrWhiteSpace(from.Phone)) { @"-" Téléphone fixe: @from.Phone }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
91
Yavsc/Views/FrontOffice/tmp.cshtml
Normal file
91
Yavsc/Views/FrontOffice/tmp.cshtml
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\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}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue